1
0

vlc_table.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. #pragma once
  2. typedef struct {
  3. int val, len;
  4. } VLCtab;
  5. typedef struct {
  6. char run, level, len;
  7. } DCTtab;
  8. static VLCtab TMNMVtab0[] = {
  9. {3,4}, {61,4}, {2,3}, {2,3}, {62,3}, {62,3},
  10. {1,2}, {1,2}, {1,2}, {1,2}, {63,2}, {63,2}, {63,2}, {63,2}
  11. };
  12. static VLCtab TMNMVtab1[] = {
  13. {12,10}, {52,10}, {11,10}, {53,10}, {10,9}, {10,9},
  14. {54,9}, {54,9}, {9,9}, {9,9}, {55,9}, {55,9},
  15. {8,9}, {8,9}, {56,9}, {56,9}, {7,7}, {7,7},
  16. {7,7}, {7,7}, {7,7}, {7,7}, {7,7}, {7,7},
  17. {57,7}, {57,7}, {57,7}, {57,7}, {57,7}, {57,7},
  18. {57,7}, {57,7}, {6,7}, {6,7}, {6,7}, {6,7},
  19. {6,7}, {6,7}, {6,7}, {6,7}, {58,7}, {58,7},
  20. {58,7}, {58,7}, {58,7}, {58,7}, {58,7}, {58,7},
  21. {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7},
  22. {5,7}, {5,7}, {59,7}, {59,7}, {59,7}, {59,7},
  23. {59,7}, {59,7}, {59,7}, {59,7}, {4,6}, {4,6},
  24. {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6},
  25. {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6},
  26. {4,6}, {4,6}, {60,6}, {60,6},{60,6},{60,6},
  27. {60,6},{60,6},{60,6},{60,6},{60,6},{60,6},
  28. {60,6},{60,6},{60,6},{60,6},{60,6},{60,6}
  29. };
  30. static VLCtab TMNMVtab2[] = {
  31. {32,12}, {31,12}, {33,12}, {30,11}, {30,11}, {34,11},
  32. {34,11}, {29,11}, {29,11}, {35,11}, {35,11}, {28,11},
  33. {28,11}, {36,11}, {36,11}, {27,11}, {27,11}, {37,11},
  34. {37,11}, {26,11}, {26,11}, {38,11}, {38,11}, {25,11},
  35. {25,11}, {39,11}, {39,11}, {24,10}, {24,10}, {24,10},
  36. {24,10}, {40,10}, {40,10}, {40,10}, {40,10}, {23,10},
  37. {23,10}, {23,10}, {23,10}, {41,10}, {41,10}, {41,10},
  38. {41,10}, {22,10}, {22,10}, {22,10}, {22,10}, {42,10},
  39. {42,10}, {42,10}, {42,10}, {21,10}, {21,10}, {21,10},
  40. {21,10}, {43,10}, {43,10}, {43,10}, {43,10}, {20,10},
  41. {20,10}, {20,10}, {20,10}, {44,10}, {44,10}, {44,10},
  42. {44,10}, {19,10}, {19,10}, {19,10}, {19,10}, {45,10},
  43. {45,10}, {45,10}, {45,10}, {18,10}, {18,10}, {18,10},
  44. {18,10}, {46,10}, {46,10}, {46,10}, {46,10}, {17,10},
  45. {17,10}, {17,10}, {17,10}, {47,10}, {47,10}, {47,10},
  46. {47,10}, {16,10}, {16,10}, {16,10}, {16,10}, {48,10},
  47. {48,10}, {48,10}, {48,10}, {15,10}, {15,10}, {15,10},
  48. {15,10}, {49,10}, {49,10}, {49,10}, {49,10}, {14,10},
  49. {14,10}, {14,10}, {14,10}, {50,10}, {50,10}, {50,10},
  50. {50,10}, {13,10}, {13,10}, {13,10}, {13,10}, {51,10},
  51. {51,10}, {51,10}, {51,10}
  52. };
  53. static VLCtab MCBPCtab[] = {
  54. {-1,0},
  55. {255,9}, {52,9}, {36,9}, {20,9}, {49,9}, {35,8}, {35,8}, {19,8}, {19,8},
  56. {50,8}, {50,8}, {51,7}, {51,7}, {51,7}, {51,7}, {34,7}, {34,7}, {34,7},
  57. {34,7}, {18,7}, {18,7}, {18,7}, {18,7}, {33,7}, {33,7}, {33,7}, {33,7},
  58. {17,7}, {17,7}, {17,7}, {17,7}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6},
  59. {4,6}, {4,6}, {4,6}, {48,6}, {48,6}, {48,6}, {48,6}, {48,6}, {48,6},
  60. {48,6}, {48,6}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5},
  61. {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5},
  62. {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4},
  63. {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4},
  64. {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4},
  65. {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {16,4}, {16,4}, {16,4}, {16,4},
  66. {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4},
  67. {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4},
  68. {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4},
  69. {16,4}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
  70. {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
  71. {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
  72. {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
  73. {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
  74. {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
  75. {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
  76. {2,3}, {2,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
  77. {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
  78. {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
  79. {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
  80. {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
  81. {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
  82. {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
  83. {1,3}, {1,3}, {1,3},
  84. };
  85. static VLCtab MCBPCtabintra[] = {
  86. {-1,0},
  87. {20,6}, {36,6}, {52,6}, {4,4}, {4,4}, {4,4},
  88. {4,4}, {19,3}, {19,3}, {19,3}, {19,3}, {19,3},
  89. {19,3}, {19,3}, {19,3}, {35,3}, {35,3}, {35,3},
  90. {35,3}, {35,3}, {35,3}, {35,3}, {35,3}, {51,3},
  91. {51,3}, {51,3}, {51,3}, {51,3}, {51,3}, {51,3},
  92. {51,3},
  93. };
  94. static VLCtab CBPYtab[48] =
  95. { {-1,0}, {-1,0}, {9,6}, {6,6}, {7,5}, {7,5}, {11,5}, {11,5},
  96. {13,5}, {13,5}, {14,5}, {14,5}, {15,4}, {15,4}, {15,4}, {15,4},
  97. {3,4}, {3,4}, {3,4}, {3,4}, {5,4},{5,4},{5,4},{5,4},
  98. {1,4}, {1,4}, {1,4}, {1,4}, {10,4}, {10,4}, {10,4}, {10,4},
  99. {2,4}, {2,4}, {2,4}, {2,4}, {12,4}, {12,4}, {12,4}, {12,4},
  100. {4,4}, {4,4}, {4,4}, {4,4}, {8,4}, {8,4}, {8,4}, {8,4},
  101. };
  102. extern VLCtab DCT3Dtab0[];
  103. extern VLCtab DCT3Dtab1[];
  104. extern VLCtab DCT3Dtab2[];
  105. static VLCtab MCBPCtab0[] = {
  106. {-1,0},
  107. {255,9}, {52,9}, {36,9}, {20,9}, {49,9}, {35,8}, {35,8}, {19,8}, {19,8},
  108. {50,8}, {50,8}, {51,7}, {51,7}, {51,7}, {51,7}, {34,7}, {34,7}, {34,7},
  109. {34,7}, {18,7}, {18,7}, {18,7}, {18,7}, {33,7}, {33,7}, {33,7}, {33,7},
  110. {17,7}, {17,7}, {17,7}, {17,7}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6},
  111. {4,6}, {4,6}, {4,6}, {48,6}, {48,6}, {48,6}, {48,6}, {48,6}, {48,6},
  112. {48,6}, {48,6}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5},
  113. {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5},
  114. {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4},
  115. {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4},
  116. {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4},
  117. {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {16,4}, {16,4}, {16,4}, {16,4},
  118. {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4},
  119. {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4},
  120. {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4},
  121. {16,4}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
  122. {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
  123. {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
  124. {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
  125. {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
  126. {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
  127. {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
  128. {2,3}, {2,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
  129. {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
  130. {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
  131. {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
  132. {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
  133. {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
  134. {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
  135. {1,3}, {1,3}, {1,3},
  136. };
  137. static VLCtab MCBPCtab1[] = {
  138. {5,11}, {5,11}, {5,11}, {5,11}, {21,13}, {21,13}, {37,13}, {53,13},
  139. };