Mercurial > libavcodec.hg
comparison dvdata.h @ 1064:b32afefe7d33 libavcodec
* UINTX -> uintx_t INTX -> intx_t
| author | kabi |
|---|---|
| date | Tue, 11 Feb 2003 16:35:48 +0000 |
| parents | c7922c5becf6 |
| children | 7f10d38721ed |
comparison
equal
deleted
inserted
replaced
| 1063:fdeac9642346 | 1064:b32afefe7d33 |
|---|---|
| 18 */ | 18 */ |
| 19 | 19 |
| 20 #define NB_DV_VLC 409 | 20 #define NB_DV_VLC 409 |
| 21 #define AAUX_OFFSET (80*6 + 80*16*3 + 3) | 21 #define AAUX_OFFSET (80*6 + 80*16*3 + 3) |
| 22 | 22 |
| 23 static const UINT16 dv_vlc_bits[409] = { | 23 static const uint16_t dv_vlc_bits[409] = { |
| 24 0x0000, 0x0002, 0x0007, 0x0008, 0x0009, 0x0014, 0x0015, 0x0016, | 24 0x0000, 0x0002, 0x0007, 0x0008, 0x0009, 0x0014, 0x0015, 0x0016, |
| 25 0x0017, 0x0030, 0x0031, 0x0032, 0x0033, 0x0068, 0x0069, 0x006a, | 25 0x0017, 0x0030, 0x0031, 0x0032, 0x0033, 0x0068, 0x0069, 0x006a, |
| 26 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x00e0, 0x00e1, 0x00e2, | 26 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x00e0, 0x00e1, 0x00e2, |
| 27 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, | 27 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, |
| 28 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x01e0, 0x01e1, 0x01e2, | 28 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x01e0, 0x01e1, 0x01e2, |
| 73 0x7ff0, 0x7ff1, 0x7ff2, 0x7ff3, 0x7ff4, 0x7ff5, 0x7ff6, 0x7ff7, | 73 0x7ff0, 0x7ff1, 0x7ff2, 0x7ff3, 0x7ff4, 0x7ff5, 0x7ff6, 0x7ff7, |
| 74 0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff, | 74 0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff, |
| 75 0x0006, | 75 0x0006, |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 static const UINT8 dv_vlc_len[409] = { | 78 static const uint8_t dv_vlc_len[409] = { |
| 79 2, 3, 4, 4, 4, 5, 5, 5, | 79 2, 3, 4, 4, 4, 5, 5, 5, |
| 80 5, 6, 6, 6, 6, 7, 7, 7, | 80 5, 6, 6, 6, 6, 7, 7, 7, |
| 81 7, 7, 7, 7, 7, 8, 8, 8, | 81 7, 7, 7, 7, 7, 8, 8, 8, |
| 82 8, 8, 8, 8, 8, 8, 8, 8, | 82 8, 8, 8, 8, 8, 8, 8, 8, |
| 83 8, 8, 8, 8, 8, 9, 9, 9, | 83 8, 8, 8, 8, 8, 9, 9, 9, |
| 128 15, 15, 15, 15, 15, 15, 15, 15, | 128 15, 15, 15, 15, 15, 15, 15, 15, |
| 129 15, 15, 15, 15, 15, 15, 15, 15, | 129 15, 15, 15, 15, 15, 15, 15, 15, |
| 130 4, | 130 4, |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 static const UINT8 dv_vlc_run[409] = { | 133 static const uint8_t dv_vlc_run[409] = { |
| 134 0, 0, 1, 0, 0, 2, 1, 0, | 134 0, 0, 1, 0, 0, 2, 1, 0, |
| 135 0, 3, 4, 0, 0, 5, 6, 2, | 135 0, 3, 4, 0, 0, 5, 6, 2, |
| 136 1, 1, 0, 0, 0, 7, 8, 9, | 136 1, 1, 0, 0, 0, 7, 8, 9, |
| 137 10, 3, 4, 2, 1, 1, 1, 0, | 137 10, 3, 4, 2, 1, 1, 1, 0, |
| 138 0, 0, 0, 0, 0, 11, 12, 13, | 138 0, 0, 0, 0, 0, 11, 12, 13, |
| 183 0, 0, 0, 0, 0, 0, 0, 0, | 183 0, 0, 0, 0, 0, 0, 0, 0, |
| 184 0, 0, 0, 0, 0, 0, 0, 0, | 184 0, 0, 0, 0, 0, 0, 0, 0, |
| 185 0, | 185 0, |
| 186 }; | 186 }; |
| 187 | 187 |
| 188 static const UINT8 dv_vlc_level[409] = { | 188 static const uint8_t dv_vlc_level[409] = { |
| 189 1, 2, 1, 3, 4, 1, 2, 5, | 189 1, 2, 1, 3, 4, 1, 2, 5, |
| 190 6, 1, 1, 7, 8, 1, 1, 2, | 190 6, 1, 1, 7, 8, 1, 1, 2, |
| 191 3, 4, 9, 10, 11, 1, 1, 1, | 191 3, 4, 9, 10, 11, 1, 1, 1, |
| 192 1, 2, 2, 3, 5, 6, 7, 12, | 192 1, 2, 2, 3, 5, 6, 7, 12, |
| 193 13, 14, 15, 16, 17, 1, 1, 1, | 193 13, 14, 15, 16, 17, 1, 1, 1, |
| 240 0, | 240 0, |
| 241 }; | 241 }; |
| 242 | 242 |
| 243 /* Specific zigzag scan for 248 idct. NOTE that unlike the | 243 /* Specific zigzag scan for 248 idct. NOTE that unlike the |
| 244 specification, we interleave the fields */ | 244 specification, we interleave the fields */ |
| 245 static const UINT8 dv_248_zigzag[64] = { | 245 static const uint8_t dv_248_zigzag[64] = { |
| 246 0, 8, 1, 9, 16, 24, 2, 10, | 246 0, 8, 1, 9, 16, 24, 2, 10, |
| 247 17, 25, 32, 40, 48, 56, 33, 41, | 247 17, 25, 32, 40, 48, 56, 33, 41, |
| 248 18, 26, 3, 11, 4, 12, 19, 27, | 248 18, 26, 3, 11, 4, 12, 19, 27, |
| 249 34, 42, 49, 57, 50, 58, 35, 43, | 249 34, 42, 49, 57, 50, 58, 35, 43, |
| 250 20, 28, 5, 13, 6, 14, 21, 29, | 250 20, 28, 5, 13, 6, 14, 21, 29, |
| 252 22, 30, 7, 15, 23, 31, 38, 46, | 252 22, 30, 7, 15, 23, 31, 38, 46, |
| 253 53, 61, 54, 62, 39, 47, 55, 63, | 253 53, 61, 54, 62, 39, 47, 55, 63, |
| 254 }; | 254 }; |
| 255 | 255 |
| 256 /* unquant tables (not used directly) */ | 256 /* unquant tables (not used directly) */ |
| 257 static const UINT8 dv_88_areas[64] = { | 257 static const uint8_t dv_88_areas[64] = { |
| 258 0,0,0,1,1,1,2,2, | 258 0,0,0,1,1,1,2,2, |
| 259 0,0,1,1,1,2,2,2, | 259 0,0,1,1,1,2,2,2, |
| 260 0,1,1,1,2,2,2,3, | 260 0,1,1,1,2,2,2,3, |
| 261 1,1,1,2,2,2,3,3, | 261 1,1,1,2,2,2,3,3, |
| 262 1,1,2,2,2,3,3,3, | 262 1,1,2,2,2,3,3,3, |
| 263 1,2,2,2,3,3,3,3, | 263 1,2,2,2,3,3,3,3, |
| 264 2,2,2,3,3,3,3,3, | 264 2,2,2,3,3,3,3,3, |
| 265 2,2,3,3,3,3,3,3, | 265 2,2,3,3,3,3,3,3, |
| 266 }; | 266 }; |
| 267 | 267 |
| 268 static const UINT8 dv_248_areas[64] = { | 268 static const uint8_t dv_248_areas[64] = { |
| 269 0,0,1,1,1,2,2,3, | 269 0,0,1,1,1,2,2,3, |
| 270 0,0,1,1,2,2,2,3, | 270 0,0,1,1,2,2,2,3, |
| 271 0,1,1,2,2,2,3,3, | 271 0,1,1,2,2,2,3,3, |
| 272 0,1,1,2,2,2,3,3, | 272 0,1,1,2,2,2,3,3, |
| 273 1,1,2,2,2,3,3,3, | 273 1,1,2,2,2,3,3,3, |
| 274 1,1,2,2,2,3,3,3, | 274 1,1,2,2,2,3,3,3, |
| 275 1,2,2,2,3,3,3,3, | 275 1,2,2,2,3,3,3,3, |
| 276 1,2,2,3,3,3,3,3, | 276 1,2,2,3,3,3,3,3, |
| 277 }; | 277 }; |
| 278 | 278 |
| 279 static UINT8 dv_quant_shifts[22][4] = { | 279 static uint8_t dv_quant_shifts[22][4] = { |
| 280 { 3,3,4,4 }, | 280 { 3,3,4,4 }, |
| 281 { 3,3,4,4 }, | 281 { 3,3,4,4 }, |
| 282 { 2,3,3,4 }, | 282 { 2,3,3,4 }, |
| 283 { 2,3,3,4 }, | 283 { 2,3,3,4 }, |
| 284 { 2,2,3,3 }, | 284 { 2,2,3,3 }, |
| 299 { 0,0,0,0 }, | 299 { 0,0,0,0 }, |
| 300 { 0,0,0,0 }, | 300 { 0,0,0,0 }, |
| 301 { 0,0,0,0 }, | 301 { 0,0,0,0 }, |
| 302 }; | 302 }; |
| 303 | 303 |
| 304 static const UINT8 dv_quant_offset[4] = { 6, 3, 0, 1 }; | 304 static const uint8_t dv_quant_offset[4] = { 6, 3, 0, 1 }; |
| 305 | 305 |
| 306 /* NOTE: I prefer hardcoding the positionning of dv blocks, it is | 306 /* NOTE: I prefer hardcoding the positionning of dv blocks, it is |
| 307 simpler :-) */ | 307 simpler :-) */ |
| 308 | 308 |
| 309 static const UINT16 dv_place_420[1620] = { | 309 static const uint16_t dv_place_420[1620] = { |
| 310 0x0c24, 0x2412, 0x3036, 0x0000, 0x1848, | 310 0x0c24, 0x2412, 0x3036, 0x0000, 0x1848, |
| 311 0x0e24, 0x2612, 0x3236, 0x0200, 0x1a48, | 311 0x0e24, 0x2612, 0x3236, 0x0200, 0x1a48, |
| 312 0x1024, 0x2812, 0x3436, 0x0400, 0x1c48, | 312 0x1024, 0x2812, 0x3436, 0x0400, 0x1c48, |
| 313 0x1026, 0x2814, 0x3438, 0x0402, 0x1c4a, | 313 0x1026, 0x2814, 0x3438, 0x0402, 0x1c4a, |
| 314 0x0e26, 0x2614, 0x3238, 0x0202, 0x1a4a, | 314 0x0e26, 0x2614, 0x3238, 0x0202, 0x1a4a, |
| 631 0x0634, 0x1e22, 0x2a46, 0x4210, 0x1258, | 631 0x0634, 0x1e22, 0x2a46, 0x4210, 0x1258, |
| 632 0x0834, 0x2022, 0x2c46, 0x4410, 0x1458, | 632 0x0834, 0x2022, 0x2c46, 0x4410, 0x1458, |
| 633 0x0a34, 0x2222, 0x2e46, 0x4610, 0x1658, | 633 0x0a34, 0x2222, 0x2e46, 0x4610, 0x1658, |
| 634 }; | 634 }; |
| 635 | 635 |
| 636 static const UINT16 dv_place_411[1350] = { | 636 static const uint16_t dv_place_411[1350] = { |
| 637 0x0c24, 0x2710, 0x3334, 0x0000, 0x1848, | 637 0x0c24, 0x2710, 0x3334, 0x0000, 0x1848, |
| 638 0x0d24, 0x2810, 0x3434, 0x0100, 0x1948, | 638 0x0d24, 0x2810, 0x3434, 0x0100, 0x1948, |
| 639 0x0e24, 0x2910, 0x3534, 0x0200, 0x1a48, | 639 0x0e24, 0x2910, 0x3534, 0x0200, 0x1a48, |
| 640 0x0f24, 0x2914, 0x3538, 0x0300, 0x1b48, | 640 0x0f24, 0x2914, 0x3538, 0x0300, 0x1b48, |
| 641 0x1024, 0x2814, 0x3438, 0x0400, 0x1c48, | 641 0x1024, 0x2814, 0x3438, 0x0400, 0x1c48, |
| 904 0x0634, 0x2120, 0x2d44, 0x3610, 0x1258, | 904 0x0634, 0x2120, 0x2d44, 0x3610, 0x1258, |
| 905 0x0734, 0x2220, 0x2e44, 0x3710, 0x1458, | 905 0x0734, 0x2220, 0x2e44, 0x3710, 0x1458, |
| 906 0x0834, 0x2320, 0x2f44, 0x3810, 0x1658, | 906 0x0834, 0x2320, 0x2f44, 0x3810, 0x1658, |
| 907 }; | 907 }; |
| 908 | 908 |
| 909 static const UINT16 dv_place_audio60[10][9] = { | 909 static const uint16_t dv_place_audio60[10][9] = { |
| 910 { 0, 30, 60, 20, 50, 80, 10, 40, 70 }, /* 1st channel */ | 910 { 0, 30, 60, 20, 50, 80, 10, 40, 70 }, /* 1st channel */ |
| 911 { 6, 36, 66, 26, 56, 86, 16, 46, 76 }, | 911 { 6, 36, 66, 26, 56, 86, 16, 46, 76 }, |
| 912 { 12, 42, 72, 2, 32, 62, 22, 52, 82 }, | 912 { 12, 42, 72, 2, 32, 62, 22, 52, 82 }, |
| 913 { 18, 48, 78, 8, 38, 68, 28, 58, 88 }, | 913 { 18, 48, 78, 8, 38, 68, 28, 58, 88 }, |
| 914 { 24, 54, 84, 14, 44, 74, 4, 34, 64 }, | 914 { 24, 54, 84, 14, 44, 74, 4, 34, 64 }, |
| 918 { 13, 43, 73, 3, 33, 63, 23, 53, 83 }, | 918 { 13, 43, 73, 3, 33, 63, 23, 53, 83 }, |
| 919 { 19, 49, 79, 9, 39, 69, 29, 59, 89 }, | 919 { 19, 49, 79, 9, 39, 69, 29, 59, 89 }, |
| 920 { 25, 55, 85, 15, 45, 75, 5, 35, 65 }, | 920 { 25, 55, 85, 15, 45, 75, 5, 35, 65 }, |
| 921 }; | 921 }; |
| 922 | 922 |
| 923 static const UINT16 dv_place_audio50[12][9] = { | 923 static const uint16_t dv_place_audio50[12][9] = { |
| 924 { 0, 36, 72, 26, 62, 98, 16, 52, 88}, /* 1st channel */ | 924 { 0, 36, 72, 26, 62, 98, 16, 52, 88}, /* 1st channel */ |
| 925 { 6, 42, 78, 32, 68, 104, 22, 58, 94}, | 925 { 6, 42, 78, 32, 68, 104, 22, 58, 94}, |
| 926 { 12, 48, 84, 2, 38, 74, 28, 64, 100}, | 926 { 12, 48, 84, 2, 38, 74, 28, 64, 100}, |
| 927 { 18, 54, 90, 8, 44, 80, 34, 70, 106}, | 927 { 18, 54, 90, 8, 44, 80, 34, 70, 106}, |
| 928 { 24, 60, 96, 14, 50, 86, 4, 40, 76}, | 928 { 24, 60, 96, 14, 50, 86, 4, 40, 76}, |
