summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibVideo/VP9/Utilities.cpp
blob: 70336efc6da18c39611bce323ee77332f5ee5103 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * Copyright (c) 2021, Hunter Salyer <thefalsehonesty@gmail.com>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include "Utilities.h"

namespace Video::VP9 {

u8 clip_3(u8 x, u8 y, u8 z)
{
    return clamp(z, x, y);
}

u8 round_2(u8 x, u8 n)
{
    return (x + (1 << (n - 1))) >> n;
}

}