Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-10-18 08:46:16 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-10-21 08:47:55 +0300
commitbce8e2f374db390d50ec79a6288a607782cca64a (patch)
treec18ebfa7092b4a08e0f6537d6ec66ff5e2f65cab /libavcodec/on2avc.c
parent26cc9db744be8d5057a28c81cebb670197ac5692 (diff)
avcodec/on2avc: Use least max_depth for get_vlc2()
The longest codes of any VLC codebooks are 18 bits long and the VLC tables itself use 9 bits; therefore it is sufficient to read twice from the table, yet this has been done thrice. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/on2avc.c')
-rw-r--r--libavcodec/on2avc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c
index e54c23cb1c..625e733ca3 100644
--- a/libavcodec/on2avc.c
+++ b/libavcodec/on2avc.c
@@ -195,7 +195,7 @@ static int on2avc_decode_quads(On2AVCContext *c, GetBitContext *gb, float *dst,
int i, j, val, val1;
for (i = 0; i < dst_size; i += 4) {
- val = get_vlc2(gb, c->cb_vlc[type].table, 9, 3);
+ val = get_vlc2(gb, c->cb_vlc[type].table, 9, 2);
for (j = 0; j < 4; j++) {
val1 = sign_extend((val >> (12 - j * 4)) & 0xF, 4);
@@ -228,7 +228,7 @@ static int on2avc_decode_pairs(On2AVCContext *c, GetBitContext *gb, float *dst,
int i, val, val1, val2, sign;
for (i = 0; i < dst_size; i += 2) {
- val = get_vlc2(gb, c->cb_vlc[type].table, 9, 3);
+ val = get_vlc2(gb, c->cb_vlc[type].table, 9, 2);
val1 = sign_extend(val >> 8, 8);
val2 = sign_extend(val & 0xFF, 8);