From 1dc1ce643e141e78c7a10d98c51f3c9f01802e81 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 9 Sep 2006 11:21:56 +0000 Subject: Proper support for B/BI frames Originally committed as revision 6207 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/vc1data.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'libavcodec/vc1data.h') diff --git a/libavcodec/vc1data.h b/libavcodec/vc1data.h index 9f9e21b4a4..bffa7b83b3 100644 --- a/libavcodec/vc1data.h +++ b/libavcodec/vc1data.h @@ -6,6 +6,7 @@ #ifndef VC1DATA_H #define VC1DATA_H +#if 0 //original bfraction from vc9data.h, not conforming to standard /* Denominator used for vc1_bfraction_lut */ #define B_FRACTION_DEN 840 @@ -19,6 +20,22 @@ const int16_t vc1_bfraction_lut[23] = { 525 /*5/8*/, 735 /*7/8*/, -1 /*inv.*/, 0 /*BI fm*/ }; +#else +/* Denominator used for vc1_bfraction_lut */ +#define B_FRACTION_DEN 256 + +/* pre-computed scales for all bfractions and base=256 */ +const int16_t vc1_bfraction_lut[23] = { + 128 /*1/2*/, 85 /*1/3*/, 170 /*2/3*/, 64 /*1/4*/, + 192 /*3/4*/, 51 /*1/5*/, 102 /*2/5*/, + 153 /*3/5*/, 204 /*4/5*/, 43 /*1/6*/, 215 /*5/6*/, + 37 /*1/7*/, 74 /*2/7*/, 111 /*3/7*/, 148 /*4/7*/, + 185 /*5/7*/, 222 /*6/7*/, 32 /*1/8*/, 96 /*3/8*/, + 160 /*5/8*/, 224 /*7/8*/, + -1 /*inv.*/, 0 /*BI fm*/ +}; +#endif + const uint8_t vc1_bfraction_bits[23] = { 3, 3, 3, 3, 3, 3, 3, -- cgit v1.2.3