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:
authorzhaoxiu.zeng <zhaoxiu.zeng@gmail.com>2015-02-12 19:05:36 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-02-13 17:55:12 +0300
commite4ea84e12e3ae2a2479615c363cbec93b6d57f7e (patch)
tree2be4bf3ada67fea26554c6c8dcd5dae4a8f799d2 /libavcodec/wmv2enc.c
parentb4b9a64bdb61dee30008b1e089ab58ca631100e5 (diff)
avcodec/wmv2: simplify cbp_table_index calculation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wmv2enc.c')
-rw-r--r--libavcodec/wmv2enc.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c
index 62e99c0fc8..55ee089ed0 100644
--- a/libavcodec/wmv2enc.c
+++ b/libavcodec/wmv2enc.c
@@ -111,16 +111,7 @@ int ff_wmv2_encode_picture_header(MpegEncContext *s, int picture_number)
put_bits(&s->pb, 2, SKIP_TYPE_NONE);
ff_msmpeg4_code012(&s->pb, cbp_index = 0);
- 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)
put_bits(&s->pb, 1, s->mspel);