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
commit0379fc1487d46445796903ab9cd4732cb7197bd2 (patch)
tree0ca20713dccc9ac37cc03420dd10bf5a0be11f0a /libavcodec/vc1.c
parent3ca3709ad450dffb2bef73b9f65bf023d589b2fe (diff)
downloadffmpeg-0379fc1487d46445796903ab9cd4732cb7197bd2.tar.gz
vc1: Move INIT_LUT() further up to allow using it in more places
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/vc1.c')
-rw-r--r--libavcodec/vc1.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 86651fecd8..f94d52a428 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -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;