summaryrefslogtreecommitdiff
path: root/libavcodec/wmv2dec.c
diff options
context:
space:
mode:
authorzhaoxiu.zeng <zhaoxiu.zeng@gmail.com>2015-02-13 00:05:36 +0800
committerMichael Niedermayer <michaelni@gmx.at>2015-02-13 15:55:12 +0100
commite4ea84e12e3ae2a2479615c363cbec93b6d57f7e (patch)
tree2be4bf3ada67fea26554c6c8dcd5dae4a8f799d2 /libavcodec/wmv2dec.c
parentb4b9a64bdb61dee30008b1e089ab58ca631100e5 (diff)
avcodec/wmv2: simplify cbp_table_index calculation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wmv2dec.c')
-rw-r--r--libavcodec/wmv2dec.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
index d9cbfd15ed..b1bcd092b0 100644
--- a/libavcodec/wmv2dec.c
+++ b/libavcodec/wmv2dec.c
@@ -173,16 +173,7 @@ int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s)
parse_mb_skip(w);
cbp_index = decode012(&s->gb);
- if (s->qscale <= 10) {
- int map[3] = { 0, 2, 1 };
- w->cbp_table_index = map[cbp_index];
- } else if (s->qscale <= 20) {
- int map[3] = { 1, 0, 2 };
- w->cbp_table_index = map[cbp_index];
- } else {
- int map[3] = {2,1,0};
- w->cbp_table_index = map[cbp_index];
- }
+ w->cbp_table_index = wmv2_get_cbp_table_index(s, cbp_index);
if (w->mspel_bit)
s->mspel = get_bits1(&s->gb);