aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vc1.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-24 12:51:28 +0200
committerMartin Storsjö <martin@martin.st>2013-05-15 12:13:53 +0300
commit37f2ac36a9099b3489500ba79bb3831c8698feea (patch)
treead031c8897d6e8d7d48523d3b661b9631744bc96 /libavcodec/vc1.c
parent0379fc1487d46445796903ab9cd4732cb7197bd2 (diff)
downloadffmpeg-37f2ac36a9099b3489500ba79bb3831c8698feea.tar.gz
vc1: Simplify code by using INIT_LUT()
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/vc1.c')
-rw-r--r--libavcodec/vc1.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index f94d52a428..b490165644 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -693,22 +693,7 @@ int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
v->lumshift = get_bits(gb, 6);
v->use_ic = 1;
/* fill lookup tables for intensity compensation */
- if (!v->lumscale) {
- scale = -64;
- shift = (255 - v->lumshift * 2) << 6;
- if (v->lumshift > 31)
- shift += 128 << 6;
- } else {
- scale = v->lumscale + 32;
- if (v->lumshift > 31)
- shift = (v->lumshift - 64) << 6;
- else
- shift = v->lumshift << 6;
- }
- for (i = 0; i < 256; i++) {
- v->luty[i] = av_clip_uint8((scale * i + shift + 32) >> 6);
- v->lutuv[i] = av_clip_uint8((scale * (i - 128) + 128*64 + 32) >> 6);
- }
+ INIT_LUT(v->lumscale, v->lumshift, v->luty, v->lutuv);
}
v->qs_last = v->s.quarter_sample;
if (v->mv_mode == MV_PMODE_1MV_HPEL || v->mv_mode == MV_PMODE_1MV_HPEL_BILIN)