diff options
author | zhaoxiu.zeng <zhaoxiu.zeng@gmail.com> | 2015-02-13 00:05:36 +0800 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-13 15:55:12 +0100 |
commit | e4ea84e12e3ae2a2479615c363cbec93b6d57f7e (patch) | |
tree | 2be4bf3ada67fea26554c6c8dcd5dae4a8f799d2 /libavcodec/wmv2.h | |
parent | b4b9a64bdb61dee30008b1e089ab58ca631100e5 (diff) | |
download | ffmpeg-e4ea84e12e3ae2a2479615c363cbec93b6d57f7e.tar.gz |
avcodec/wmv2: simplify cbp_table_index calculation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wmv2.h')
-rw-r--r-- | libavcodec/wmv2.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/wmv2.h b/libavcodec/wmv2.h index cb5b14e219..4fa5e9bcec 100644 --- a/libavcodec/wmv2.h +++ b/libavcodec/wmv2.h @@ -56,4 +56,15 @@ typedef struct Wmv2Context { void ff_wmv2_common_init(Wmv2Context *w); +static av_always_inline int wmv2_get_cbp_table_index(MpegEncContext *s, int cbp_index) +{ + static const uint8_t map[3][3] = { + { 0, 2, 1 }, + { 1, 0, 2 }, + { 2, 1, 0 }, + }; + + return map[(s->qscale > 10) + (s->qscale > 20)][cbp_index]; +} + #endif /* AVCODEC_WMV2_H */ |