Revision be3492ec libavcodec/vc1data.h

View differences:

libavcodec/vc1data.h
1 1
/**
2 2
 * @file vc1data.h
3
 * VC1 tables.
3
 * VC-1 tables.
4 4
 */
5 5

  
6 6
#ifndef VC1DATA_H
......
167 167
};
168 168

  
169 169
const uint8_t wmv3_dc_scale_table[32]={
170
    0, 4, 6, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21
170
    0, 2, 4, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21
171 171
};
172 172

  
173 173
/* P-Picture CBPCY VLC tables */
174
#if 1 // Looks like original tables are not conforming to standard at all. Are they used for old WMV?
175
static const uint16_t vc1_cbpcy_p_codes[4][64] = {
176
  {
177
      0,   6,  15,  13,  13,  11,   3,  13,   5,   8,  49,  10,  12, 114, 102, 119,
178
      1,  54,  96,   8,  10, 111,   5,  15,  12,  10,   2,  12,  13, 115,  53,  63,
179
      1,   7,   1,   7,  14,  12,   4,  14,   1,   9,  97,  11,   7,  58,  52,  62,
180
      4, 103,   1,   9,  11,  56, 101, 118,   4, 110, 100,  30,   2,   5,   4,   3
181
  },
182
  {
183
      0,   9,   1,  18,   5,  14, 237,  26,   3, 121,   3,  22,  13,  16,   6,  30,
184
      2,  10,   1,  20,  12, 241,   5,  28,  16,  12,   3,  24,  28, 124, 239, 247,
185
      1, 240,   1,  19,  18,  15,   4,  27,   1, 122,   2,  23,   1,  17,   7,  31,
186
      1,  11,   2,  21,  19, 246, 238,  29,  17,  13, 236,  25,  58,  63,   8, 125
187
  },
188
  {
189
      0, 201,  25, 231,   5, 221,   1,   3,   2, 414,   2, 241,  16, 225, 195, 492,
190
      2, 412,   1, 240,   7, 224,  98, 245,   1, 220,  96,   5,   9, 230, 101, 247,
191
      1, 102,   1, 415,  24,   3,   2, 244,   3,  54,   3, 484,  17, 114, 200, 493,
192
      3, 413,   1,   4,  13, 113,  99, 485,   4, 111, 194, 243,   5,  29,  26,  31
193
  },
194
  {
195
      0,  28,  12,  44,   3,  36,  20,  52,   2,  32,  16,  48,   8,  40,  24,  28,
196
      1,  30,  14,  46,   6,  38,  22,  54,   3,  34,  18,  50,  10,  42,  26,  30,
197
      1,  29,  13,  45,   5,  37,  21,  53,   2,  33,  17,  49,   9,  41,  25,  29,
198
      1,  31,  15,  47,   7,  39,  23,  55,   4,  35,  19,  51,  11,  43,  27,  31
199
   }
200
};
201

  
202
static const uint8_t vc1_cbpcy_p_bits[4][64] = {
203
  {
204
    13,  13,   7,  13,   7,  13,  13,  12,   6,  13,   7,  12,   6,   8,   8,   8,
205
     5,   7,   8,  12,   6,   8,  13,  12,   7,  13,  13,  12,   6,   8,   7,   7,
206
     6,  13,   8,  12,   7,  13,  13,  12,   7,  13,   8,  12,   5,   7,   7,   7,
207
     6,   8,  13,  12,   6,   7,   8,   8,   5,   8,   8,   6,   3,   3,   3,   2
208
  },
209
  {
210
    14,  13,   8,  13,   3,  13,   8,  13,   3,   7,   8,  13,   4,  13,  13,  13,
211
     3,  13,  13,  13,   4,   8,  13,  13,   5,  13,  13,  13,   5,   7,   8,   8,
212
     3,   8,  14,  13,   5,  13,  13,  13,   4,   7,  13,  13,   6,  13,  13,  13,
213
     5,  13,   8,  13,   5,   8,   8,  13,   5,  13,   8,  13,   6,   6,  13,   7
214
  },
215
  {
216
    13,   8,   6,   8,   4,   8,  13,  12,   4,   9,   8,   8,   5,   8,   8,   9,
217
     5,   9,  10,   8,   4,   8,   7,   8,   6,   8,   7,  13,   4,   8,   7,   8,
218
     5,   7,   8,   9,   6,  13,  13,   8,   4,   6,   8,   9,   5,   7,   8,   9,
219
     5,   9,   9,  13,   5,   7,   7,   9,   4,   7,   8,   8,   3,   5,   5,   5
220
  },
221
  {
222
     9,   9,   9,   9,   2,   9,   9,   9,   2,   9,   9,   9,   9,   9,   9,   8,
223
     3,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   8,
224
     2,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   8,
225
     9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   8
226
  }
227
};
228
#else
174 229
static const uint16_t vc1_cbpcy_p_codes[4][64] = {
175 230
  {
176 231
      0,   1,   1,   4,   5,   1,  12,   4,  13,  14,  10,  11,  12,   7,  13,   2,
......
223 278
     9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  8,  8,  8,  8
224 279
  }
225 280
};
281
#endif
226 282

  
227 283
/* MacroBlock Transform Type: 7.1.3.11, p89
228 284
 * 8x8:B
......
402 458
/* DC differentials low+hi-mo, p217 are the same as in msmpeg4data .h */
403 459

  
404 460
/* Scantables/ZZ scan are at 11.9 (p262) and 8.1.1.12 (p10) */
461
static const int8_t vc1_normal_zz[64] = {
462
       0,     8,     1,     2,     9,    16,    24,    17,
463
      10,     3,     4,    11,    18,    25,    32,    40,
464
      33,    48,    26,    19,    12,     5,     6,    13,
465
      20,    27,    34,    41,    56,    49,    57,    42,
466
      35,    28,    21,    14,     7,    15,    22,    29,
467
      36,    43,    50,    58,    51,    59,    44,    37,
468
      30,    23,    31,    38,    45,    52,    60,    53,
469
      61,    46,    39,    47,    54,    62,    55,    63
470
};
471

  
472
static const int8_t vc1_horizontal_zz [64] = /* Table 227 */
473
{
474
       0,     1,     8,     2,     3,     9,    16,    24,
475
      17,    10,     4,     5,    11,    18,    25,    32,
476
      40,    48,    33,    26,    19,    12,     6,     7,
477
      13,    20,    27,    34,    41,    56,    49,    57,
478
      42,    35,    28,    21,    14,    15,    22,    29,
479
      36,    43,    50,    58,    51,    44,    37,    30,
480
      23,    31,    38,    45,    52,    59,    60,    53,
481
      46,    39,    47,    54,    61,    62,    55,    63
482
};
405 483

  
484
static const int8_t vc1_vertical_zz [64] = /* Table 228 */
485
{
486
       0,     8,    16,     1,    24,    32,    40,     9,
487
       2,     3,    10,    17,    25,    48,    56,    41,
488
      33,    26,    18,    11,     4,     5,    12,    19,
489
      27,    34,    49,    57,    50,    42,    35,    28,
490
      20,    13,     6,     7,    14,    21,    29,    36,
491
      43,    51,    58,    59,    52,    44,    37,    30,
492
      22,    15,    23,    31,    38,    45,    60,    53,
493
      46,    39,    47,    54,    61,    62,    55,    63
494
};
495

  
496
static const int8_t vc1_simple_progressive_8x8_zz [64] =
497
/* Table 229 */
498
{
499
       0,     8,     1,     2,     9,    16,    24,    17,
500
      10,     3,     4,    11,    18,    25,    32,    40,
501
      48,    56,    41,    33,    26,    19,    12,     5,
502
       6,    13,    20,    27,    34,    49,    57,    58,
503
      50,    42,    35,    28,    21,    14,     7,    15,
504
      22,    29,    36,    43,    51,    59,    60,    52,
505
      44,    37,    30,    23,    31,    38,    45,    53,
506
      61,    62,    54,    46,    39,    47,    55,    63
507
};
508

  
509
static const int8_t vc1_simple_progressive_8x4_zz [32] = /* Table 230 */
510
{
511
       0,     1,     2,     8,     3,     9,    10,    16,
512
       4,    11,    17,    24,    18,    12,     5,    19,
513
      25,    13,    20,    26,    27,     6,    21,    28,
514
      14,    22,    29,     7,    30,    15,    23,    31
515
};
516

  
517
static const int8_t vc1_simple_progressive_4x8_zz [32] = /* Table 231 */
518
{
519
       0,     8,     1,    16,
520
       9,    24,    17,     2,
521
      32,    10,    25,    40,
522
      18,    48,    33,    26,
523
      56,    41,    34,     3,
524
      49,    57,    11,    42,
525
      19,    50,    27,    58,
526
      35,    43,    51,    59
527
};
528

  
529
/* Table 232 */
530
static const int8_t vc1_simple_progressive_4x4_zz [16] =
531
{
532
       0,     8,    16,     1,
533
       9,    24,    17,     2,
534
      10,    18,    25,     3,
535
      11,    26,    19,    27
536
};
537

  
538
static const int8_t vc1_adv_progressive_8x4_zz [32] = /* Table 233 */
539
{
540
       0,     8,     1,    16,     2,     9,    10,     3,
541
      24,    17,     4,    11,    18,    12,     5,    19,
542
      25,    13,    20,    26,    27,     6,    21,    28,
543
      14,    22,    29,     7,    30,    15,    23,    31
544
};
545

  
546
static const int8_t vc1_adv_progressive_4x8_zz [32] = /* Table 234 */
547
{
548
       0,     1,     8,     2,
549
       9,    16,    17,    24,
550
      10,    32,    25,    18,
551
      40,     3,    33,    26,
552
      48,    11,    56,    41,
553
      34,    49,    57,    42,
554
      19,    50,    27,    58,
555
      35,    43,    51,    59
556
};
557

  
558
static const int8_t vc1_adv_interlaced_8x8_zz [64] = /* Table 235 */
559
{
560
       0,     8,     1,    16,    24,     9,     2,    32,
561
      40,    48,    56,    17,    10,     3,    25,    18,
562
      11,     4,    33,    41,    49,    57,    26,    34,
563
      42,    50,    58,    19,    12,     5,    27,    20,
564
      13,     6,    35,    28,    21,    14,     7,    15,
565
      22,    29,    36,    43,    51,    59,    60,    52,
566
      44,    37,    30,    23,    31,    38,    45,    53,
567
      61,    62,    54,    46,    39,    47,    55,    63
568
};
569

  
570
static const int8_t vc1_adv_interlaced_8x4_zz [32] = /* Table 236 */
571
{
572
       0,     8,    16,    24,     1,     9,     2,    17,
573
      25,    10,     3,    18,    26,     4,    11,    19,
574
      12,     5,    13,    20,    27,     6,    21,    28,
575
      14,    22,    29,     7,    30,    15,    23,    31
576
};
577

  
578
static const int8_t vc1_adv_interlaced_4x8_zz [32] = /* Table 237 */
579
{
580
       0,     1,     2,     8,
581
      16,     9,    24,    17,
582
      10,     3,    32,    40,
583
      48,    56,    25,    18,
584
      33,    26,    41,    34,
585
      49,    57,    11,    42,
586
      19,    50,    27,    58,
587
      35,    43,    51,    59
588
};
589

  
590
static const int8_t vc1_adv_interlaced_4x4_zz [16] = /* Table 238 */
591
{
592
       0,     8,    16,    24,
593
       1,     9,    17,     2,
594
      25,    10,    18,     3,
595
      26,    11,    19,    27
596
};
597

  
598

  
599
/* DQScale as specified in 8.1.3.9 - almost identical to 0x40000/i */
600
static const int32_t vc1_dqscale[63] = {
601
0x40000, 0x20000, 0x15555, 0x10000, 0xCCCD, 0xAAAB, 0x9249, 0x8000,
602
    0x71C7, 0x6666, 0x5D17, 0x5555, 0x4EC5, 0x4925, 0x4444, 0x4000,
603
    0x3C3C, 0x38E4, 0x35E5, 0x3333, 0x30C3, 0x2E8C, 0x2C86, 0x2AAB,
604
    0x28F6, 0x2762, 0x25ED, 0x2492, 0x234F, 0x2222, 0x2108, 0x2000,
605
    0x1F08, 0x1E1E, 0x1D42, 0x1C72, 0x1BAD, 0x1AF3, 0x1A42, 0x199A,
606
    0x18FA, 0x1862, 0x17D0, 0x1746, 0x16C1, 0x1643, 0x15CA, 0x1555,
607
    0x14E6, 0x147B, 0x1414, 0x13B1, 0x1352, 0x12F7, 0x129E, 0x1249,
608
    0x11F7, 0x11A8, 0x115B, 0x1111, 0x10C9, 0x1084, 0x1000
609
};
406 610
#endif /* VC1DATA_H */

Also available in: Unified diff