1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

vc1: Move INIT_LUT() further up to allow using it in more places

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Michael Niedermayer 2013-04-24 12:51:28 +02:00 committed by Martin Storsjö
parent 3ca3709ad4
commit 0379fc1487

View File

@ -570,6 +570,25 @@ int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContex
return 0;
}
/* fill lookup tables for intensity compensation */
#define INIT_LUT(lumscale, lumshift, luty, lutuv) \
if (!lumscale) { \
scale = -64; \
shift = (255 - lumshift * 2) << 6; \
if (lumshift > 31) \
shift += 128 << 6; \
} else { \
scale = lumscale + 32; \
if (lumshift > 31) \
shift = (lumshift - 64) << 6; \
else \
shift = lumshift << 6; \
} \
for (i = 0; i < 256; i++) { \
luty[i] = av_clip_uint8((scale * i + shift + 32) >> 6); \
lutuv[i] = av_clip_uint8((scale * (i - 128) + 128*64 + 32) >> 6); \
}
int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
{
int pqindex, lowquant, status;
@ -800,25 +819,6 @@ int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
return 0;
}
/* fill lookup tables for intensity compensation */
#define INIT_LUT(lumscale, lumshift, luty, lutuv) \
if (!lumscale) { \
scale = -64; \
shift = (255 - lumshift * 2) << 6; \
if (lumshift > 31) \
shift += 128 << 6; \
} else { \
scale = lumscale + 32; \
if (lumshift > 31) \
shift = (lumshift - 64) << 6; \
else \
shift = lumshift << 6; \
} \
for (i = 0; i < 256; i++) { \
luty[i] = av_clip_uint8((scale * i + shift + 32) >> 6); \
lutuv[i] = av_clip_uint8((scale * (i - 128) + 128*64 + 32) >> 6); \
}
int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
{
int pqindex, lowquant;