diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-07-22 23:29:29 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-07-28 03:49:54 +0200 |
commit | 062599d7863bd4c5a9dee57bc29a7839e38d38a5 (patch) | |
tree | 720cf67fca15c334dcfd691ff392054dbf8b8e09 /libavcodec/vp8.c | |
parent | f3fef1259c1c95f10033d913e0589a71617e457d (diff) |
avcodec/vp56.h: Move VP8-only functions to vp8.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/vp8.c')
-rw-r--r-- | libavcodec/vp8.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 10de962118..9e7616990f 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -52,6 +52,40 @@ #define VPX(vp7, f) vp8_ ## f #endif +// fixme: add 1 bit to all the calls to this? +static int vp8_rac_get_sint(VP56RangeCoder *c, int bits) +{ + int v; + + if (!vp8_rac_get(c)) + return 0; + + v = vp8_rac_get_uint(c, bits); + + if (vp8_rac_get(c)) + v = -v; + + return v; +} + +static int vp8_rac_get_nn(VP56RangeCoder *c) +{ + int v = vp8_rac_get_uint(c, 7) << 1; + return v + !v; +} + +// DCTextra +static int vp8_rac_get_coeff(VP56RangeCoder *c, const uint8_t *prob) +{ + int v = 0; + + do { + v = (v<<1) + vp56_rac_get_prob(c, *prob++); + } while (*prob); + + return v; +} + static void free_buffers(VP8Context *s) { int i; |