comparison vc1data.h @ 3689:6d9e8253da2a libavcodec

Proper support for B/BI frames
author kostya
date Sat, 09 Sep 2006 11:21:56 +0000
parents 20938be7b67b
children c537a97eec66
comparison
equal deleted inserted replaced
3688:c63b9bb49532 3689:6d9e8253da2a
4 */ 4 */
5 5
6 #ifndef VC1DATA_H 6 #ifndef VC1DATA_H
7 #define VC1DATA_H 7 #define VC1DATA_H
8 8
9 #if 0 //original bfraction from vc9data.h, not conforming to standard
9 /* Denominator used for vc1_bfraction_lut */ 10 /* Denominator used for vc1_bfraction_lut */
10 #define B_FRACTION_DEN 840 11 #define B_FRACTION_DEN 840
11 12
12 /* bfraction is fractional, we scale to the GCD 3*5*7*8 = 840 */ 13 /* bfraction is fractional, we scale to the GCD 3*5*7*8 = 840 */
13 const int16_t vc1_bfraction_lut[23] = { 14 const int16_t vc1_bfraction_lut[23] = {
17 120 /*1/7*/, 240 /*2/7*/, 360 /*3/7*/, 480 /*4/7*/, 18 120 /*1/7*/, 240 /*2/7*/, 360 /*3/7*/, 480 /*4/7*/,
18 600 /*5/7*/, 720 /*6/7*/, 105 /*1/8*/, 315 /*3/8*/, 19 600 /*5/7*/, 720 /*6/7*/, 105 /*1/8*/, 315 /*3/8*/,
19 525 /*5/8*/, 735 /*7/8*/, 20 525 /*5/8*/, 735 /*7/8*/,
20 -1 /*inv.*/, 0 /*BI fm*/ 21 -1 /*inv.*/, 0 /*BI fm*/
21 }; 22 };
23 #else
24 /* Denominator used for vc1_bfraction_lut */
25 #define B_FRACTION_DEN 256
26
27 /* pre-computed scales for all bfractions and base=256 */
28 const int16_t vc1_bfraction_lut[23] = {
29 128 /*1/2*/, 85 /*1/3*/, 170 /*2/3*/, 64 /*1/4*/,
30 192 /*3/4*/, 51 /*1/5*/, 102 /*2/5*/,
31 153 /*3/5*/, 204 /*4/5*/, 43 /*1/6*/, 215 /*5/6*/,
32 37 /*1/7*/, 74 /*2/7*/, 111 /*3/7*/, 148 /*4/7*/,
33 185 /*5/7*/, 222 /*6/7*/, 32 /*1/8*/, 96 /*3/8*/,
34 160 /*5/8*/, 224 /*7/8*/,
35 -1 /*inv.*/, 0 /*BI fm*/
36 };
37 #endif
38
22 const uint8_t vc1_bfraction_bits[23] = { 39 const uint8_t vc1_bfraction_bits[23] = {
23 3, 3, 3, 3, 40 3, 3, 3, 3,
24 3, 3, 3, 41 3, 3, 3,
25 7, 7, 7, 7, 42 7, 7, 7, 7,
26 7, 7, 7, 7, 43 7, 7, 7, 7,