00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "avcodec.h"
00023 #include "dnxhddata.h"
00024 #include "libavutil/common.h"
00025
00026
00027
00028 static const uint8_t dnxhd_1235_luma_weight[] = {
00029 0, 32, 32, 32, 33, 32, 32, 32,
00030 32, 31, 32, 33, 33, 33, 33, 35,
00031 36, 36, 34, 34, 36, 37, 37, 36,
00032 36, 35, 36, 38, 39, 39, 37, 36,
00033 37, 37, 39, 41, 42, 41, 39, 39,
00034 40, 41, 42, 43, 42, 42, 41, 41,
00035 41, 44, 47, 46, 46, 48, 51, 51,
00036 50, 50, 53, 55, 55, 56, 60, 60,
00037 };
00038
00039 static const uint8_t dnxhd_1235_chroma_weight[] = {
00040 0, 32, 33, 34, 34, 33, 34, 35,
00041 37, 40, 43, 42, 39, 38, 39, 41,
00042 43, 44, 47, 50, 55, 61, 63, 56,
00043 48, 46, 49, 54, 59, 58, 55, 58,
00044 63, 65, 67, 74, 84, 82, 75, 72,
00045 70, 74, 84, 87, 87, 94, 93, 81,
00046 75, 78, 83, 89, 91, 86, 82, 85,
00047 90, 90, 85, 79, 73, 73, 73, 73,
00048 };
00049
00050 static const uint8_t dnxhd_1237_luma_weight[] = {
00051 0, 32, 33, 34, 34, 36, 37, 36,
00052 36, 37, 38, 38, 38, 39, 41, 44,
00053 43, 41, 40, 41, 46, 49, 47, 46,
00054 47, 49, 51, 54, 60, 62, 59, 55,
00055 54, 56, 58, 61, 65, 66, 64, 63,
00056 66, 73, 78, 79, 80, 79, 78, 78,
00057 82, 87, 89, 90, 93, 95, 96, 97,
00058 97, 100, 104, 102, 98, 98, 99, 99,
00059 };
00060
00061 static const uint8_t dnxhd_1237_chroma_weight[] = {
00062 0, 32, 36, 39, 39, 38, 39, 41,
00063 45, 51, 57, 58, 53, 48, 47, 51,
00064 55, 58, 66, 75, 81, 83, 82, 78,
00065 73, 72, 74, 77, 83, 85, 83, 82,
00066 89, 99, 96, 90, 94, 97, 99, 105,
00067 109, 105, 95, 89, 92, 95, 94, 93,
00068 92, 88, 89, 90, 93, 95, 96, 97,
00069 97, 100, 104, 102, 98, 98, 99, 99,
00070 };
00071
00072 static const uint8_t dnxhd_1238_luma_weight[] = {
00073 0, 32, 32, 33, 34, 33, 33, 33,
00074 33, 33, 33, 33, 33, 35, 37, 37,
00075 36, 36, 35, 36, 38, 38, 36, 35,
00076 36, 37, 38, 41, 42, 41, 39, 38,
00077 38, 38, 39, 41, 42, 41, 39, 39,
00078 40, 41, 43, 44, 44, 44, 44, 44,
00079 45, 47, 47, 47, 49, 50, 51, 51,
00080 51, 53, 55, 57, 58, 59, 57, 57,
00081 };
00082
00083 static const uint8_t dnxhd_1238_chroma_weight[] = {
00084 0, 32, 35, 35, 35, 34, 34, 35,
00085 39, 43, 45, 45, 41, 39, 40, 41,
00086 42, 44, 48, 55, 59, 63, 65, 59,
00087 53, 52, 52, 55, 61, 62, 58, 58,
00088 63, 66, 66, 65, 70, 74, 70, 66,
00089 65, 68, 75, 77, 74, 74, 77, 76,
00090 73, 73, 73, 73, 76, 80, 89, 90,
00091 82, 77, 80, 86, 84, 82, 82, 82,
00092 };
00093
00094 static const uint8_t dnxhd_1241_luma_weight[] = {
00095 0, 32, 33, 34, 34, 35, 36, 37,
00096 36, 37, 38, 38, 38, 39, 39, 40,
00097 40, 38, 38, 39, 38, 37, 39, 41,
00098 41, 42, 43, 45, 45, 46, 47, 46,
00099 45, 43, 39, 37, 37, 40, 44, 45,
00100 45, 46, 46, 46, 47, 47, 46, 44,
00101 42, 43, 45, 47, 48, 49, 50, 49,
00102 48, 46, 47, 48, 48, 49, 49, 49,
00103 };
00104
00105 static const uint8_t dnxhd_1241_chroma_weight[] = {
00106 0, 32, 36, 38, 37, 37, 40, 41,
00107 40, 40, 42, 42, 41, 41, 41, 41,
00108 42, 43, 44, 44, 45, 46, 46, 45,
00109 44, 45, 45, 45, 45, 46, 47, 46,
00110 45, 44, 42, 41, 43, 45, 45, 47,
00111 48, 48, 48, 46, 47, 47, 46, 47,
00112 46, 45, 45, 47, 48, 49, 50, 49,
00113 48, 46, 48, 49, 48, 49, 49, 49,
00114 };
00115
00116 static const uint8_t dnxhd_1242_luma_weight[] = {
00117 0, 32, 33, 33, 34, 35, 36, 35,
00118 33, 33, 35, 36, 37, 37, 38, 37,
00119 37, 37, 36, 37, 37, 37, 38, 39,
00120 37, 36, 37, 40, 42, 45, 46, 44,
00121 41, 42, 44, 45, 47, 49, 50, 48,
00122 46, 48, 49, 50, 52, 52, 50, 49,
00123 47, 48, 50, 50, 51, 51, 50, 49,
00124 49, 51, 52, 51, 49, 47, 47, 47,
00125 };
00126
00127 static const uint8_t dnxhd_1242_chroma_weight[] = {
00128 0, 32, 37, 42, 45, 45, 45, 44,
00129 38, 37, 40, 42, 44, 49, 51, 47,
00130 41, 40, 43, 44, 46, 48, 51, 54,
00131 51, 47, 47, 45, 47, 50, 51, 49,
00132 46, 47, 49, 47, 50, 55, 55, 51,
00133 48, 49, 51, 51, 52, 52, 54, 54,
00134 49, 49, 52, 53, 54, 54, 53, 53,
00135 55, 59, 63, 62, 60, 60, 60, 60,
00136 };
00137
00138 static const uint8_t dnxhd_1243_luma_weight[] = {
00139 0, 32, 32, 33, 33, 35, 35, 35,
00140 35, 35, 35, 35, 34, 35, 38, 40,
00141 39, 37, 37, 37, 36, 35, 36, 38,
00142 40, 41, 42, 44, 45, 44, 42, 41,
00143 40, 38, 36, 36, 37, 38, 40, 43,
00144 44, 45, 45, 45, 45, 45, 45, 41,
00145 39, 41, 45, 47, 47, 48, 48, 48,
00146 46, 44, 45, 47, 47, 48, 47, 47,
00147 };
00148
00149 static const uint8_t dnxhd_1243_chroma_weight[] = {
00150 0, 32, 36, 37, 36, 37, 39, 39,
00151 41, 43, 43, 42, 41, 41, 41, 42,
00152 43, 43, 43, 44, 44, 44, 46, 47,
00153 46, 45, 45, 45, 45, 46, 44, 44,
00154 45, 44, 42, 41, 43, 46, 45, 44,
00155 45, 45, 45, 46, 46, 46, 45, 44,
00156 45, 44, 45, 47, 47, 48, 49, 48,
00157 46, 45, 46, 47, 47, 48, 47, 47,
00158 };
00159
00160 static const uint8_t dnxhd_1250_luma_weight[] = {
00161 0, 32, 32, 33, 34, 35, 35, 35,
00162 34, 34, 35, 36, 36, 36, 36, 36,
00163 37, 38, 38, 38, 38, 38, 39, 39,
00164 38, 38, 39, 41, 43, 43, 42, 41,
00165 40, 40, 39, 40, 41, 41, 39, 39,
00166 40, 42, 47, 50, 47, 45, 46, 46,
00167 44, 45, 46, 47, 49, 54, 58, 54,
00168 48, 49, 54, 57, 60, 62, 63, 63,
00169 };
00170
00171 static const uint8_t dnxhd_1250_chroma_weight[] = {
00172 0, 32, 35, 36, 36, 35, 36, 39,
00173 41, 43, 45, 44, 41, 39, 40, 42,
00174 43, 43, 45, 48, 49, 51, 52, 50,
00175 50, 51, 51, 51, 51, 52, 53, 54,
00176 51, 49, 51, 52, 52, 56, 57, 55,
00177 54, 54, 55, 56, 55, 58, 58, 58,
00178 60, 61, 62, 62, 59, 57, 58, 58,
00179 61, 59, 59, 59, 60, 62, 63, 63,
00180 };
00181
00182 static const uint8_t dnxhd_1251_luma_weight[] = {
00183 0, 32, 32, 34, 34, 34, 34, 35,
00184 35, 35, 36, 37, 36, 36, 35, 36,
00185 38, 38, 38, 38, 38, 38, 38, 38,
00186 38, 38, 39, 41, 44, 43, 41, 40,
00187 40, 40, 40, 39, 40, 41, 40, 39,
00188 40, 43, 46, 46, 44, 44, 44, 42,
00189 41, 43, 46, 48, 50, 55, 58, 53,
00190 48, 50, 55, 58, 61, 62, 62, 62,
00191 };
00192
00193 static const uint8_t dnxhd_1251_chroma_weight[] = {
00194 0, 32, 35, 36, 36, 35, 36, 39,
00195 41, 43, 45, 44, 41, 39, 40, 42,
00196 43, 43, 45, 48, 48, 48, 50, 50,
00197 50, 51, 51, 51, 51, 52, 53, 54,
00198 51, 49, 51, 52, 52, 56, 57, 55,
00199 54, 54, 55, 56, 55, 58, 58, 58,
00200 60, 61, 62, 62, 59, 57, 58, 58,
00201 61, 59, 59, 59, 61, 62, 62, 62,
00202 };
00203
00204 static const uint8_t dnxhd_1252_luma_weight[] = {
00205 0, 32, 34, 35, 36, 36, 36, 37,
00206 36, 37, 39, 40, 41, 40, 40, 40,
00207 41, 41, 42, 41, 41, 43, 44, 44,
00208 45, 46, 48, 55, 60, 57, 52, 50,
00209 49, 49, 52, 52, 53, 55, 58, 62,
00210 65, 73, 82, 82, 80, 78, 73, 68,
00211 71, 82, 90, 90, 88, 87, 90, 95,
00212 100, 107, 103, 97, 95, 93, 99, 99,
00213 };
00214 static const uint8_t dnxhd_1252_chroma_weight[] = {
00215 0, 32, 35, 36, 37, 37, 38, 40,
00216 42, 46, 49, 50, 50, 49, 49, 53,
00217 56, 56, 57, 58, 60, 62, 64, 65,
00218 63, 64, 64, 65, 66, 65, 67, 71,
00219 72, 74, 74, 74, 74, 77, 81, 78,
00220 72, 73, 82, 85, 89, 88, 84, 80,
00221 90, 100, 90, 90, 88, 87, 90, 95,
00222 114, 128, 125, 129, 134, 125, 116, 116,
00223 };
00224
00225 static const uint8_t dnxhd_1237_dc_codes[12] = {
00226 0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63,
00227 };
00228
00229 static const uint8_t dnxhd_1237_dc_bits[12] = {
00230 3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6,
00231 };
00232
00233 static const uint16_t dnxhd_1237_ac_codes[257] = {
00234 0, 1, 4, 5, 12, 26, 27, 56,
00235 57, 58, 59, 120, 121, 244, 245, 246,
00236 247, 248, 498, 499, 500, 501, 502, 1006,
00237 1007, 1008, 1009, 1010, 1011, 2024, 2025, 2026,
00238 2027, 2028, 2029, 2030, 2031, 4064, 4065, 4066,
00239 4067, 4068, 4069, 4070, 4071, 4072, 4073, 8148,
00240 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156,
00241 8157, 8158, 16318, 16319, 16320, 16321, 16322, 16323,
00242 16324, 16325, 16326, 16327, 16328, 16329, 16330, 16331,
00243 16332, 16333, 32668, 32669, 32670, 32671, 32672, 32673,
00244 32674, 32675, 32676, 32677, 32678, 32679, 32680, 32681,
00245 32682, 32683, 32684, 65370, 65371, 65372, 65373, 65374,
00246 65375, 65376, 65377, 65378, 65379, 65380, 65381, 65382,
00247 65383, 65384, 65385, 65386, 65387, 65388, 65389, 65390,
00248 65391, 65392, 65393, 65394, 65395, 65396, 65397, 65398,
00249 65399, 65400, 65401, 65402, 65403, 65404, 65405, 65406,
00250 65407, 65408, 65409, 65410, 65411, 65412, 65413, 65414,
00251 65415, 65416, 65417, 65418, 65419, 65420, 65421, 65422,
00252 65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430,
00253 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438,
00254 65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446,
00255 65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454,
00256 65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462,
00257 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470,
00258 65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478,
00259 65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486,
00260 65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494,
00261 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502,
00262 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510,
00263 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518,
00264 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526,
00265 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534,
00266 65535,
00267 };
00268
00269 static const uint8_t dnxhd_1237_ac_bits[257] = {
00270 2, 2, 3, 3, 4, 5, 5, 6, 6, 6, 6, 7, 7, 8, 8, 8,
00271 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11,
00272 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13,
00273 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14,
00274 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15,
00275 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16,
00276 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00277 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00278 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00279 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00280 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00281 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00282 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00283 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00284 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00285 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00286 16,
00287 };
00288
00289 static const uint8_t dnxhd_1237_ac_level[257] = {
00290 3, 3, 5, 0, 7, 9, 5, 11, 13, 15, 7, 17, 19, 21, 23, 25,
00291 9, 11, 27, 29, 31, 33, 13, 35, 37, 39, 41, 43, 15, 45, 47, 49,
00292 51, 53, 55, 17, 19, 57, 59, 61, 63, 65, 67, 69, 21, 23, 25, 71,
00293 73, 75, 77, 79, 81, 83, 27, 29, 31, 33, 85, 87, 89, 91, 93, 95,
00294 97, 99,101,103,105, 35, 37, 39, 41, 43,107,109,111,113,115,117,
00295 119,121,123,129, 3, 45, 47, 49, 51, 53, 55,125,127, 5, 7, 9,
00296 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41,
00297 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73,
00298 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99,101,103,105,
00299 107,109,111,113,115,117,119,121,123,125,127,129, 57, 59, 61, 63,
00300 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
00301 97, 99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,
00302 129, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31,
00303 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63,
00304 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
00305 97, 99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,
00306 129,
00307 };
00308
00309 static const uint8_t dnxhd_1237_ac_flags[257] = {
00310 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0,
00311 2, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0,
00312 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0,
00313 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0,
00314 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0,
00315 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1,
00316 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00317 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00318 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00319 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2,
00320 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00321 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00322 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00323 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00324 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00325 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00326 3,
00327 };
00328
00329 static const uint16_t dnxhd_1237_run_codes[62] = {
00330 0, 4, 10, 11, 24, 25, 26, 54,
00331 55, 56, 57, 58, 118, 119, 240, 482,
00332 483, 484, 485, 486, 487, 488, 489, 490,
00333 491, 492, 493, 494, 990, 991, 992, 993,
00334 994, 995, 996, 997, 998, 999, 1000, 1001,
00335 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009,
00336 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
00337 1018, 1019, 1020, 1021, 1022, 1023,
00338 };
00339
00340 static const uint8_t dnxhd_1237_run_bits[62] = {
00341 1, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 8, 9,
00342 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10,
00343 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
00344 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
00345 };
00346
00347 static const uint8_t dnxhd_1237_run[62] = {
00348 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
00349 17, 18, 19, 20, 21, 53, 57, 58, 59, 60, 61, 62, 22, 23, 24, 25,
00350 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
00351 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56,
00352 };
00353
00354 static const uint8_t dnxhd_1238_dc_codes[12] = {
00355 0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63,
00356 };
00357
00358 static const uint8_t dnxhd_1238_dc_bits[12] = {
00359 3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6,
00360 };
00361
00362 static const uint16_t dnxhd_1238_ac_codes[257] = {
00363 0, 1, 4, 10, 11, 24, 25, 26,
00364 54, 55, 56, 57, 116, 117, 118, 119,
00365 240, 241, 242, 243, 244, 245, 492, 493,
00366 494, 495, 496, 497, 498, 499, 1000, 1001,
00367 1002, 1003, 1004, 1005, 1006, 1007, 1008, 2018,
00368 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026,
00369 2027, 4056, 4057, 4058, 4059, 4060, 4061, 4062,
00370 4063, 4064, 4065, 4066, 4067, 4068, 4069, 8140,
00371 8141, 8142, 8143, 8144, 8145, 8146, 8147, 8148,
00372 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156,
00373 16314, 16315, 16316, 16317, 16318, 16319, 16320, 16321,
00374 16322, 16323, 16324, 16325, 16326, 16327, 16328, 16329,
00375 16330, 16331, 16332, 16333, 16334, 16335, 16336, 16337,
00376 16338, 32678, 32679, 32680, 32681, 32682, 32683, 32684,
00377 32685, 32686, 32687, 32688, 32689, 32690, 32691, 32692,
00378 32693, 32694, 32695, 32696, 32697, 32698, 32699, 32700,
00379 32701, 32702, 32703, 32704, 32705, 65412, 65413, 65414,
00380 65415, 65416, 65417, 65418, 65419, 65420, 65421, 65422,
00381 65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430,
00382 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438,
00383 65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446,
00384 65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454,
00385 65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462,
00386 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470,
00387 65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478,
00388 65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486,
00389 65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494,
00390 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502,
00391 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510,
00392 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518,
00393 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526,
00394 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534,
00395 65535,
00396 };
00397
00398 static const uint8_t dnxhd_1238_ac_bits[257] = {
00399 2, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7,
00400 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10,
00401 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11,
00402 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13,
00403 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
00404 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
00405 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15,
00406 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
00407 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00408 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00409 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00410 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00411 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00412 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00413 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00414 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00415 16,
00416 };
00417
00418 static const uint8_t dnxhd_1238_ac_level[257] = {
00419 3, 3, 5, 7, 0, 9, 11, 5, 13, 15, 17, 7, 19, 21, 23, 9,
00420 25, 27, 29, 31, 33, 11, 35, 37, 39, 41, 43, 45, 13, 15, 47, 49,
00421 51, 53, 55, 57, 59, 17, 19, 61, 63, 65, 67, 69, 71, 73, 75, 21,
00422 23, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 25, 27, 29, 99,
00423 101,103,105,107,109,111,113,115,117,119,121,123, 31, 33, 35, 37,
00424 125,127,129, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27,
00425 29, 31, 33, 39, 41, 43, 45, 47, 49, 35, 37, 39, 41, 43, 45, 47,
00426 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 81, 51,
00427 53, 55, 57, 59, 61, 77, 79, 83, 85, 87, 89, 91, 93, 95, 97, 99,
00428 101,103,105,107,109,111,113,115,117,119,121,123,125,127,129, 63,
00429 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
00430 97, 99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,
00431 129, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31,
00432 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63,
00433 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
00434 97, 99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,
00435 129,
00436 };
00437
00438 static const uint8_t dnxhd_1238_ac_flags[257] = {
00439 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2,
00440 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0,
00441 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2,
00442 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0,
00443 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2,
00444 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00445 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
00446 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
00447 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00448 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
00449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00451 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00452 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00453 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00454 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00455 3,
00456 };
00457
00458 static const uint16_t dnxhd_1235_1238_1241_run_codes[62] = {
00459 0, 4, 10, 11, 24, 25, 26, 27,
00460 56, 57, 58, 59, 120, 242, 486, 487,
00461 488, 489, 980, 981, 982, 983, 984, 985,
00462 986, 987, 988, 989, 990, 991, 992, 993,
00463 994, 995, 996, 997, 998, 999, 1000, 1001,
00464 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009,
00465 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
00466 1018, 1019, 1020, 1021, 1022, 1023,
00467 };
00468
00469 static const uint8_t dnxhd_1235_1238_1241_run_bits[62] = {
00470 1, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 8, 9, 9,
00471 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
00472 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
00473 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
00474 };
00475
00476 static const uint8_t dnxhd_1238_run[62] = {
00477 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
00478 20, 21, 17, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
00479 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
00480 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
00481 };
00482
00483 static const uint8_t dnxhd_1235_1241_dc_codes[14] = {
00484 10, 62, 11, 12, 13, 0, 1, 2, 3, 4, 14, 30, 126, 127,
00485 };
00486
00487 static const uint8_t dnxhd_1235_1241_dc_bits[14] = {
00488 4, 6, 4, 4, 4, 3, 3, 3, 3, 3, 4, 5, 7, 7,
00489 };
00490
00491 static const uint16_t dnxhd_1235_1241_ac_codes[257] = {
00492 0, 1, 4, 10, 11, 24, 25, 26,
00493 54, 55, 56, 57, 116, 117, 118, 119,
00494 240, 241, 242, 243, 244, 245, 492, 493,
00495 494, 495, 496, 497, 498, 998, 999, 1000,
00496 1001, 1002, 1003, 1004, 1005, 1006, 1007, 2016,
00497 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024,
00498 2025, 2026, 4054, 4055, 4056, 4057, 4058, 4059,
00499 4060, 4061, 4062, 4063, 4064, 4065, 4066, 4067,
00500 4068, 4069, 8140, 8141, 8142, 8143, 8144, 8145,
00501 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153,
00502 8154, 8155, 8156, 8157, 16316, 16317, 16318, 16319,
00503 16320, 16321, 16322, 16323, 16324, 16325, 16326, 16327,
00504 16328, 16329, 16330, 16331, 16332, 16333, 16334, 16335,
00505 16336, 16337, 32676, 32677, 32678, 32679, 32680, 32681,
00506 32682, 32683, 32684, 32685, 32686, 32687, 32688, 32689,
00507 32690, 32691, 32692, 32693, 32694, 32695, 32696, 32697,
00508 32698, 32699, 32700, 32701, 32702, 32703, 32704, 32705,
00509 32706, 32707, 32708, 65418, 65419, 65420, 65421, 65422,
00510 65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430,
00511 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438,
00512 65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446,
00513 65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454,
00514 65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462,
00515 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470,
00516 65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478,
00517 65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486,
00518 65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494,
00519 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502,
00520 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510,
00521 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518,
00522 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526,
00523 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534,
00524 65535,
00525 };
00526
00527 static const uint8_t dnxhd_1235_1241_ac_bits[257] = {
00528 2, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7,
00529 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10,
00530 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11,
00531 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
00532 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
00533 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
00534 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15,
00535 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
00536 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16,
00537 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00538 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00539 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00540 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00541 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00542 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00543 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00544 16,
00545 };
00546
00547 static const uint8_t dnxhd_1235_1241_ac_level[257] = {
00548 3, 3, 5, 7, 0, 9, 11, 5, 13, 15, 17, 7, 19, 21, 23, 9,
00549 25, 27, 29, 31, 33, 11, 35, 37, 39, 41, 43, 13, 15, 45, 47, 49,
00550 51, 53, 55, 57, 59, 17, 19, 61, 63, 65, 67, 69, 71, 73, 75, 77,
00551 21, 23, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99,101, 25, 27,
00552 29, 31,103,105,107,109,111,113,115,117,119,121,123,125,127, 3,
00553 33, 35, 37, 39,129, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25,
00554 27, 29, 31, 33, 35, 41, 43, 45, 47, 49, 37, 39, 41, 43, 45, 47,
00555 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79,
00556 81, 83, 85, 51, 53, 55, 57, 59, 61, 63, 65, 87, 89, 91, 93, 95,
00557 97, 99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,
00558 129, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
00559 97, 99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,
00560 129, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31,
00561 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63,
00562 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
00563 97, 99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,
00564 129,
00565 };
00566
00567 static const uint8_t dnxhd_1235_1241_ac_flags[257] = {
00568 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2,
00569 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0,
00570 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00571 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,
00572 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
00573 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00574 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1,
00575 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00576 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1,
00577 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00578 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00580 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00581 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00582 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00583 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00584 3,
00585 };
00586
00587 static const uint8_t dnxhd_1235_1241_run[62] = {
00588 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
00589 18, 20, 17, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
00590 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
00591 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
00592 };
00593
00594 static const uint8_t dnxhd_1250_dc_codes[14] = {
00595 10, 62, 11, 12, 13, 0, 1, 2, 3, 4, 14, 30, 126, 127
00596 };
00597 static const uint8_t dnxhd_1250_dc_bits[14] = {
00598 4, 6, 4, 4, 4, 3, 3, 3, 3, 3, 4, 5, 7, 7
00599 };
00600 static const uint16_t dnxhd_1250_ac_codes[257] = {
00601 0, 1, 4, 10, 11, 24, 25, 26,
00602 54, 55, 56, 57, 116, 117, 118, 119,
00603 240, 241, 242, 243, 244, 245, 492, 493,
00604 494, 495, 496, 497, 498, 998, 999, 1000,
00605 1001, 1002, 1003, 1004, 1005, 1006, 2014, 2015,
00606 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023,
00607 2024, 2025, 4052, 4053, 4054, 4055, 4056, 4057,
00608 4058, 4059, 4060, 4061, 4062, 4063, 4064, 4065,
00609 4066, 4067, 8136, 8137, 8138, 8139, 8140, 8141,
00610 8142, 8143, 8144, 8145, 8146, 8147, 8148, 8149,
00611 8150, 8151, 8152, 8153, 8154, 8155, 8156, 16314,
00612 16315, 16316, 16317, 16318, 16319, 16320, 16321, 16322,
00613 16323, 16324, 16325, 16326, 16327, 16328, 16329, 16330,
00614 16331, 16332, 16333, 16334, 16335, 16336, 16337, 16338,
00615 32678, 32679, 32680, 32681, 32682, 32683, 32684, 32685,
00616 32686, 32687, 32688, 32689, 32690, 32691, 32692, 32693,
00617 32694, 32695, 32696, 32697, 32698, 32699, 32700, 32701,
00618 32702, 32703, 32704, 32705, 32706, 32707, 32708, 32709,
00619 32710, 32711, 32712, 65426, 65427, 65428, 65429, 65430,
00620 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438,
00621 65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446,
00622 65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454,
00623 65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462,
00624 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470,
00625 65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478,
00626 65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486,
00627 65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494,
00628 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502,
00629 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510,
00630 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518,
00631 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526,
00632 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534,
00633 65535
00634 };
00635 static const uint8_t dnxhd_1250_ac_bits[257] = {
00636 2, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7,
00637 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10,
00638 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
00639 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
00640 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
00641 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14,
00642 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
00643 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
00644 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
00645 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00646 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00647 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00648 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00649 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00650 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00651 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00652 16
00653 };
00654 static const uint8_t dnxhd_1250_ac_level[257] = {
00655 3, 3, 5, 7, 0, 9, 11, 5, 13, 15, 17, 7, 19, 21, 23, 9,
00656 25, 27, 29, 31, 33, 11, 35, 37, 39, 41, 43, 45, 13, 47, 49, 51,
00657 53, 55, 57, 59, 15, 17, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79,
00658 19, 21, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99,101,103,105, 23,
00659 25, 27,107,109,111,113,115,117,119,121,123,125,127,129, 3, 5,
00660 7, 9, 11, 29, 31, 33, 35, 13, 15, 17, 19, 21, 23, 25, 27, 29,
00661 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 37, 39, 41, 43,
00662 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85,
00663 87, 89, 91, 93, 95, 97, 99,101,103,105,107,111,113, 45, 47, 49,
00664 51, 53, 55,109,115,117,119,121,123,125,127,129, 57, 59, 61, 63,
00665 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
00666 97, 99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,
00667 129, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31,
00668 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63,
00669 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
00670 97, 99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,
00671 129
00672 };
00673 static const uint8_t dnxhd_1250_ac_flags[257] = {
00674 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2,
00675 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
00676 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00677 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
00678 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
00679 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00680 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2,
00681 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00682 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
00683 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2,
00684 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00685 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00686 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00687 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00688 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00689 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00690 3,
00691 };
00692 static const uint16_t dnxhd_1250_run_codes[62] = {
00693 0, 4, 5, 12, 26, 27, 28, 58,
00694 118, 119, 120, 242, 486, 487, 976, 977,
00695 978, 979, 980, 981, 982, 983, 984, 985,
00696 986, 987, 988, 989, 990, 991, 992, 993,
00697 994, 995, 996, 997, 998, 999, 1000, 1001,
00698 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009,
00699 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
00700 1018, 1019, 1020, 1021, 1022, 1023
00701 };
00702 static const uint8_t dnxhd_1250_run_bits[62] = {
00703 1, 3, 3, 4, 5, 5, 5, 6, 7, 7, 7, 8, 9, 9, 10, 10,
00704 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
00705 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
00706 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
00707 };
00708 static const uint8_t dnxhd_1250_run[62] = {
00709 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
00710 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
00711 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
00712 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62
00713 };
00714
00715 static const uint8_t dnxhd_1251_dc_codes[12] = {
00716 0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63,
00717 };
00718
00719 static const uint8_t dnxhd_1251_dc_bits[12] = {
00720 3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6,
00721 };
00722
00723 static const uint16_t dnxhd_1251_ac_codes[257] = {
00724 0, 1, 4, 10, 11, 24, 25, 26,
00725 54, 55, 56, 57, 116, 117, 118, 119,
00726 240, 241, 242, 243, 244, 245, 492, 493,
00727 494, 495, 496, 497, 996, 997, 998, 999,
00728 1000, 1001, 1002, 1003, 1004, 1005, 2012, 2013,
00729 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021,
00730 2022, 2023, 2024, 2025, 4052, 4053, 4054, 4055,
00731 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063,
00732 4064, 4065, 4066, 8134, 8135, 8136, 8137, 8138,
00733 8139, 8140, 8141, 8142, 8143, 8144, 8145, 8146,
00734 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154,
00735 8155, 8156, 16314, 16315, 16316, 16317, 16318, 16319,
00736 16320, 16321, 16322, 16323, 16324, 16325, 16326, 16327,
00737 16328, 16329, 16330, 16331, 16332, 16333, 16334, 16335,
00738 16336, 16337, 16338, 16339, 32680, 32681, 32682, 32683,
00739 32684, 32685, 32686, 32687, 32688, 32689, 32690, 32691,
00740 32692, 32693, 32694, 32695, 32696, 32697, 32698, 32699,
00741 32700, 32701, 32702, 32703, 32704, 32705, 32706, 32707,
00742 32708, 32709, 32710, 32711, 32712, 32713, 32714, 65430,
00743 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438,
00744 65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446,
00745 65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454,
00746 65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462,
00747 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470,
00748 65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478,
00749 65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486,
00750 65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494,
00751 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502,
00752 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510,
00753 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518,
00754 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526,
00755 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534,
00756 65535,
00757 };
00758
00759 static const uint8_t dnxhd_1251_ac_bits[257] = {
00760 2, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7,
00761 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10,
00762 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
00763 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
00764 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
00765 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14,
00766 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
00767 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
00768 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
00769 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00770 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00771 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00772 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00773 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00774 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00775 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00776 16,
00777 };
00778
00779 static const uint8_t dnxhd_1251_ac_level[257] = {
00780 3, 3, 5, 7, 0, 9, 11, 5, 13, 15, 17, 7, 19, 21, 23, 9,
00781 25, 27, 29, 31, 33, 11, 35, 37, 39, 41, 43, 13, 45, 47, 49, 51,
00782 53, 55, 57, 59, 15, 17, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79,
00783 81, 19, 21, 23, 83, 85, 87, 89, 91, 93, 95, 97, 99,101,103,105,
00784 25, 27, 29,107,109,111,113,115,117,119,121,123,125,127,129, 3,
00785 5, 7, 9, 11, 13, 15, 17, 31, 33, 35, 19, 21, 23, 25, 27, 29,
00786 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 37,
00787 39, 41, 43, 45, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83,
00788 85, 87, 89, 91, 93, 95, 97, 99,101,103,105,107,109,111,113,115,
00789 117, 47, 49, 51, 53, 55, 57,119,121,123,125,127,129, 59, 61, 63,
00790 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
00791 97, 99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,
00792 129, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31,
00793 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63,
00794 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
00795 97, 99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,
00796 129,
00797 };
00798
00799 static const uint8_t dnxhd_1251_ac_flags[257] = {
00800 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2,
00801 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
00802 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00803 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00804 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
00805 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1,
00806 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
00807 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00808 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00809 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2,
00810 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00811 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00812 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00813 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00814 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00815 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00816 3,
00817 };
00818
00819 static const uint16_t dnxhd_1251_run_codes[62] = {
00820 0, 4, 5, 12, 26, 27, 28, 58,
00821 118, 119, 120, 242, 486, 487, 976, 977,
00822 978, 979, 980, 981, 982, 983, 984, 985,
00823 986, 987, 988, 989, 990, 991, 992, 993,
00824 994, 995, 996, 997, 998, 999, 1000, 1001,
00825 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009,
00826 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
00827 1018, 1019, 1020, 1021, 1022, 1023,
00828 };
00829
00830 static const uint8_t dnxhd_1251_run_bits[62] = {
00831 1, 3, 3, 4, 5, 5, 5, 6, 7, 7, 7, 8, 9, 9, 10, 10,
00832 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
00833 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
00834 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
00835 };
00836
00837 static const uint8_t dnxhd_1251_run[62] = {
00838 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
00839 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
00840 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
00841 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
00842 };
00843
00844 static const uint8_t dnxhd_1252_dc_codes[12] = {
00845 0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63,
00846 };
00847
00848 static const uint8_t dnxhd_1252_dc_bits[12] = {
00849 3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6,
00850 };
00851
00852 static const uint16_t dnxhd_1252_ac_codes[257] = {
00853 0, 1, 4, 10, 11, 12, 26, 27,
00854 56, 57, 58, 118, 119, 120, 242, 243,
00855 244, 245, 246, 247, 496, 497, 498, 499,
00856 500, 1002, 1003, 1004, 1005, 1006, 1007, 1008,
00857 1009, 2020, 2021, 2022, 2023, 2024, 2025, 2026,
00858 2027, 2028, 2029, 4060, 4061, 4062, 4063, 4064,
00859 4065, 4066, 4067, 4068, 4069, 4070, 4071, 8144,
00860 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152,
00861 8153, 8154, 8155, 8156, 8157, 8158, 16318, 16319,
00862 16320, 16321, 16322, 16323, 16324, 16325, 16326, 16327,
00863 16328, 16329, 16330, 16331, 16332, 16333, 16334, 16335,
00864 32672, 32673, 32674, 32675, 32676, 32677, 32678, 32679,
00865 32680, 32681, 32682, 32683, 32684, 32685, 32686, 32687,
00866 32688, 32689, 32690, 32691, 32692, 32693, 32694, 65390,
00867 65391, 65392, 65393, 65394, 65395, 65396, 65397, 65398,
00868 65399, 65400, 65401, 65402, 65403, 65404, 65405, 65406,
00869 65407, 65408, 65409, 65410, 65411, 65412, 65413, 65414,
00870 65415, 65416, 65417, 65418, 65419, 65420, 65421, 65422,
00871 65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430,
00872 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438,
00873 65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446,
00874 65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454,
00875 65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462,
00876 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470,
00877 65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478,
00878 65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486,
00879 65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494,
00880 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502,
00881 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510,
00882 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518,
00883 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526,
00884 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534,
00885 65535,
00886 };
00887
00888 static const uint8_t dnxhd_1252_ac_bits[257] = {
00889 2, 2, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8,
00890 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10,
00891 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12,
00892 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13,
00893 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
00894 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
00895 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16,
00896 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00897 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00898 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00899 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00900 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00901 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00902 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00903 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00904 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00905 16,
00906 };
00907
00908 static const uint8_t dnxhd_1252_ac_level[257] = {
00909 3, 3, 5, 7, 5, 0, 9, 11, 13, 15, 7, 17, 19, 21, 23, 25,
00910 27, 29, 9, 11, 31, 33, 35, 37, 13, 39, 41, 43, 45, 47, 49, 15,
00911 17, 51, 53, 55, 57, 59, 61, 63, 65, 19, 21, 67, 69, 71, 73, 75,
00912 77, 79, 81, 83, 23, 25, 27, 85, 87, 89, 91, 93, 95, 97, 99,101,
00913 103,105,107, 29, 31, 33,109,111,113,115,117,119,121,123,125,127,
00914 129, 3, 5, 7, 35, 37, 39, 41, 9, 11, 13, 15, 17, 19, 21, 23,
00915 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 43, 45, 47, 49, 51, 45,
00916 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
00917 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99,101,103,105,107,109,
00918 111,113,115,117,119,121,123,125,127,129, 53, 55, 57, 59, 61, 63,
00919 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
00920 97, 99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,
00921 129, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31,
00922 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63,
00923 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
00924 97, 99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,
00925 129,
00926 };
00927
00928 static const uint8_t dnxhd_1252_ac_flags[257] = {
00929 0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
00930 0, 0, 2, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2,
00931 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0,
00932 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00933 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00934 0, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
00935 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1,
00936 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00937 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00938 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
00939 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00940 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00941 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00942 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00943 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00944 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00945 3,
00946 };
00947
00948 const CIDEntry ff_dnxhd_cid_table[] = {
00949 { 1235, 1920, 1080, 0, 917504, 917504, 6, 10, 4,
00950 dnxhd_1235_luma_weight, dnxhd_1235_chroma_weight,
00951 dnxhd_1235_1241_dc_codes, dnxhd_1235_1241_dc_bits,
00952 dnxhd_1235_1241_ac_codes, dnxhd_1235_1241_ac_bits, dnxhd_1235_1241_ac_level,
00953 dnxhd_1235_1241_ac_flags,
00954 dnxhd_1235_1238_1241_run_codes, dnxhd_1235_1238_1241_run_bits, dnxhd_1235_1241_run,
00955 { 175, 185, 365, 440 } },
00956 { 1237, 1920, 1080, 0, 606208, 606208, 4, 8, 3,
00957 dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight,
00958 dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
00959 dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
00960 dnxhd_1237_ac_flags,
00961 dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
00962 { 115, 120, 145, 240, 290 } },
00963 { 1238, 1920, 1080, 0, 917504, 917504, 4, 8, 4,
00964 dnxhd_1238_luma_weight, dnxhd_1238_chroma_weight,
00965 dnxhd_1238_dc_codes, dnxhd_1238_dc_bits,
00966 dnxhd_1238_ac_codes, dnxhd_1238_ac_bits, dnxhd_1238_ac_level,
00967 dnxhd_1238_ac_flags,
00968 dnxhd_1235_1238_1241_run_codes, dnxhd_1235_1238_1241_run_bits, dnxhd_1238_run,
00969 { 175, 185, 220, 365, 440 } },
00970 { 1241, 1920, 1080, 1, 917504, 458752, 6, 10, 4,
00971 dnxhd_1241_luma_weight, dnxhd_1241_chroma_weight,
00972 dnxhd_1235_1241_dc_codes, dnxhd_1235_1241_dc_bits,
00973 dnxhd_1235_1241_ac_codes, dnxhd_1235_1241_ac_bits, dnxhd_1235_1241_ac_level,
00974 dnxhd_1235_1241_ac_flags,
00975 dnxhd_1235_1238_1241_run_codes, dnxhd_1235_1238_1241_run_bits, dnxhd_1235_1241_run,
00976 { 185, 220 } },
00977 { 1242, 1920, 1080, 1, 606208, 303104, 4, 8, 3,
00978 dnxhd_1242_luma_weight, dnxhd_1242_chroma_weight,
00979 dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
00980 dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
00981 dnxhd_1237_ac_flags,
00982 dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
00983 { 120, 145 } },
00984 { 1243, 1920, 1080, 1, 917504, 458752, 4, 8, 4,
00985 dnxhd_1243_luma_weight, dnxhd_1243_chroma_weight,
00986 dnxhd_1238_dc_codes, dnxhd_1238_dc_bits,
00987 dnxhd_1238_ac_codes, dnxhd_1238_ac_bits, dnxhd_1238_ac_level,
00988 dnxhd_1238_ac_flags,
00989 dnxhd_1235_1238_1241_run_codes, dnxhd_1235_1238_1241_run_bits, dnxhd_1238_run,
00990 { 185, 220 } },
00991 { 1250, 1280, 720, 0, 458752, 458752, 6, 10, 4,
00992 dnxhd_1250_luma_weight, dnxhd_1250_chroma_weight,
00993 dnxhd_1250_dc_codes, dnxhd_1250_dc_bits,
00994 dnxhd_1250_ac_codes, dnxhd_1250_ac_bits, dnxhd_1250_ac_level,
00995 dnxhd_1250_ac_flags,
00996 dnxhd_1250_run_codes, dnxhd_1250_run_bits, dnxhd_1250_run,
00997 { 90, 180, 220 } },
00998 { 1251, 1280, 720, 0, 458752, 458752, 4, 8, 4,
00999 dnxhd_1251_luma_weight, dnxhd_1251_chroma_weight,
01000 dnxhd_1251_dc_codes, dnxhd_1251_dc_bits,
01001 dnxhd_1251_ac_codes, dnxhd_1251_ac_bits, dnxhd_1251_ac_level,
01002 dnxhd_1251_ac_flags,
01003 dnxhd_1251_run_codes, dnxhd_1251_run_bits, dnxhd_1251_run,
01004 { 90, 110, 175, 220 } },
01005 { 1252, 1280, 720, 0, 303104, 303104, 4, 8, 5,
01006 dnxhd_1252_luma_weight, dnxhd_1252_chroma_weight,
01007 dnxhd_1252_dc_codes, dnxhd_1252_dc_bits,
01008 dnxhd_1252_ac_codes, dnxhd_1252_ac_bits, dnxhd_1252_ac_level,
01009 dnxhd_1252_ac_flags,
01010 dnxhd_1251_run_codes, dnxhd_1251_run_bits, dnxhd_1251_run,
01011 { 60, 75, 115, 145 } },
01012 { 1253, 1920, 1080, 0, 188416, 188416, 4, 8, 3,
01013 dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight,
01014 dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
01015 dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
01016 dnxhd_1237_ac_flags,
01017 dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
01018 { 36, 45, 75, 90 } },
01019 };
01020
01021 int ff_dnxhd_get_cid_table(int cid)
01022 {
01023 int i;
01024 for (i = 0; i < FF_ARRAY_ELEMS(ff_dnxhd_cid_table); i++)
01025 if (ff_dnxhd_cid_table[i].cid == cid)
01026 return i;
01027 return -1;
01028 }
01029
01030 int ff_dnxhd_find_cid(AVCodecContext *avctx, int bit_depth)
01031 {
01032 int i, j;
01033 int mbs = avctx->bit_rate/1000000;
01034 if (!mbs)
01035 return 0;
01036 for (i = 0; i < FF_ARRAY_ELEMS(ff_dnxhd_cid_table); i++) {
01037 const CIDEntry *cid = &ff_dnxhd_cid_table[i];
01038 if (cid->width == avctx->width && cid->height == avctx->height &&
01039 cid->interlaced == !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT) &&
01040 cid->bit_depth == bit_depth) {
01041 for (j = 0; j < sizeof(cid->bit_rates); j++) {
01042 if (cid->bit_rates[j] == mbs)
01043 return cid->cid;
01044 }
01045 }
01046 }
01047 return 0;
01048 }