1 | /* The copyright in this software is being made available under the BSD |
---|
2 | * License, included below. This software may be subject to other third party |
---|
3 | * and contributor rights, including patent rights, and no such rights are |
---|
4 | * granted under this license. |
---|
5 | * |
---|
6 | * Copyright (c) 2010-2012, ITU/ISO/IEC |
---|
7 | * All rights reserved. |
---|
8 | * |
---|
9 | * Redistribution and use in source and binary forms, with or without |
---|
10 | * modification, are permitted provided that the following conditions are met: |
---|
11 | * |
---|
12 | * * Redistributions of source code must retain the above copyright notice, |
---|
13 | * this list of conditions and the following disclaimer. |
---|
14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
15 | * this list of conditions and the following disclaimer in the documentation |
---|
16 | * and/or other materials provided with the distribution. |
---|
17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
18 | * be used to endorse or promote products derived from this software without |
---|
19 | * specific prior written permission. |
---|
20 | * |
---|
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
32 | */ |
---|
33 | |
---|
34 | /** \file ContextTables.h |
---|
35 | \brief Defines constants and tables for SBAC |
---|
36 | \todo number of context models is not matched to actual use, should be fixed |
---|
37 | */ |
---|
38 | |
---|
39 | #ifndef __CONTEXTTABLES__ |
---|
40 | #define __CONTEXTTABLES__ |
---|
41 | |
---|
42 | //! \ingroup TLibCommon |
---|
43 | //! \{ |
---|
44 | |
---|
45 | // ==================================================================================================================== |
---|
46 | // Constants |
---|
47 | // ==================================================================================================================== |
---|
48 | |
---|
49 | #define MAX_NUM_CTX_MOD 512 ///< maximum number of supported contexts |
---|
50 | |
---|
51 | #define NUM_SPLIT_FLAG_CTX 3 ///< number of context models for split flag |
---|
52 | #define NUM_SKIP_FLAG_CTX 3 ///< number of context models for skip flag |
---|
53 | |
---|
54 | #define NUM_MERGE_FLAG_EXT_CTX 1 ///< number of context models for merge flag of merge extended |
---|
55 | #if MRG_IDX_CTX_RED |
---|
56 | #define NUM_MERGE_IDX_EXT_CTX 1 ///< number of context models for merge index of merge extended |
---|
57 | #else |
---|
58 | #define NUM_MERGE_IDX_EXT_CTX 4 ///< number of context models for merge index of merge extended |
---|
59 | #endif |
---|
60 | |
---|
61 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
62 | #define NUM_RES_PRED_FLAG_CTX 4 ///< number of context for residual prediction flag |
---|
63 | #endif |
---|
64 | |
---|
65 | #define NUM_ALF_CTRL_FLAG_CTX 1 ///< number of context models for ALF control flag |
---|
66 | #define NUM_PART_SIZE_CTX 4 ///< number of context models for partition size |
---|
67 | #if AMP_CTX |
---|
68 | #define NUM_CU_AMP_CTX 1 ///< number of context models for partition size (AMP) |
---|
69 | #else |
---|
70 | #define NUM_CU_X_POS_CTX 2 ///< number of context models for partition size (AMP) |
---|
71 | #define NUM_CU_Y_POS_CTX 2 ///< number of context models for partition size (AMP) |
---|
72 | #endif |
---|
73 | #define NUM_PRED_MODE_CTX 1 ///< number of context models for prediction mode |
---|
74 | |
---|
75 | #define NUM_ADI_CTX 1 ///< number of context models for intra prediction |
---|
76 | |
---|
77 | #define NUM_CHROMA_PRED_CTX 2 ///< number of context models for intra prediction (chroma) |
---|
78 | #define NUM_INTER_DIR_CTX 4 ///< number of context models for inter prediction direction |
---|
79 | #define NUM_MV_RES_CTX 2 ///< number of context models for motion vector difference |
---|
80 | |
---|
81 | #define NUM_REF_NO_CTX 4 ///< number of context models for reference index |
---|
82 | #define NUM_TRANS_SUBDIV_FLAG_CTX 10 ///< number of context models for transform subdivision flags |
---|
83 | #define NUM_QT_CBF_CTX 5 ///< number of context models for QT CBF |
---|
84 | #define NUM_QT_ROOT_CBF_CTX 1 ///< number of context models for QT ROOT CBF |
---|
85 | #define NUM_DELTA_QP_CTX 3 ///< number of context models for dQP |
---|
86 | |
---|
87 | #define NUM_SIG_CG_FLAG_CTX 2 ///< number of context models for MULTI_LEVEL_SIGNIFICANCE |
---|
88 | |
---|
89 | #define NUM_SIG_FLAG_CTX 48 ///< number of context models for sig flag |
---|
90 | |
---|
91 | #define NUM_SIG_FLAG_CTX_LUMA 27 ///< number of context models for luma sig flag |
---|
92 | #define NUM_SIG_FLAG_CTX_CHROMA 21 ///< number of context models for chroma sig flag |
---|
93 | #if LAST_CTX_REDUCTION |
---|
94 | #define NUM_CTX_LAST_FLAG_XY 15 ///< number of context models for last coefficient position |
---|
95 | #else |
---|
96 | #define NUM_CTX_LAST_FLAG_XY 18 ///< number of context models for last coefficient position |
---|
97 | #endif |
---|
98 | |
---|
99 | #if LEVEL_CTX_LUMA_RED |
---|
100 | #define NUM_ONE_FLAG_CTX 24 ///< number of context models for greater than 1 flag |
---|
101 | #define NUM_ONE_FLAG_CTX_LUMA 16 ///< number of context models for greater than 1 flag of luma |
---|
102 | #define NUM_ONE_FLAG_CTX_CHROMA 8 ///< number of context models for greater than 1 flag of chroma |
---|
103 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
104 | #define NUM_ABS_FLAG_CTX 6 ///< number of context models for greater than 2 flag |
---|
105 | #define NUM_ABS_FLAG_CTX_LUMA 4 ///< number of context models for greater than 2 flag of luma |
---|
106 | #define NUM_ABS_FLAG_CTX_CHROMA 2 ///< number of context models for greater than 2 flag of chroma |
---|
107 | #else |
---|
108 | #define NUM_ABS_FLAG_CTX 18 ///< number of context models for greater than 2 flag |
---|
109 | #define NUM_ABS_FLAG_CTX_LUMA 12 ///< number of context models for greater than 2 flag of luma |
---|
110 | #define NUM_ABS_FLAG_CTX_CHROMA 6 ///< number of context models for greater than 2 flag of chroma |
---|
111 | #endif |
---|
112 | #else |
---|
113 | #define NUM_ONE_FLAG_CTX 32 ///< number of context models for greater than 1 flag |
---|
114 | #define NUM_ONE_FLAG_CTX_LUMA 24 ///< number of context models for greater than 1 flag of luma |
---|
115 | #define NUM_ONE_FLAG_CTX_CHROMA 8 ///< number of context models for greater than 1 flag of chroma |
---|
116 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
117 | #define NUM_ABS_FLAG_CTX 8 ///< number of context models for greater than 2 flag |
---|
118 | #define NUM_ABS_FLAG_CTX_LUMA 6 ///< number of context models for greater than 2 flag of luma |
---|
119 | #define NUM_ABS_FLAG_CTX_CHROMA 2 ///< number of context models for greater than 2 flag of chroma |
---|
120 | #else |
---|
121 | #define NUM_ABS_FLAG_CTX 24 ///< number of context models for greater than 2 flag |
---|
122 | #define NUM_ABS_FLAG_CTX_LUMA 18 ///< number of context models for greater than 2 flag of luma |
---|
123 | #define NUM_ABS_FLAG_CTX_CHROMA 6 ///< number of context models for greater than 2 flag of chroma |
---|
124 | #endif |
---|
125 | #endif |
---|
126 | |
---|
127 | #define NUM_MVP_IDX_CTX 2 ///< number of context models for MVP index |
---|
128 | |
---|
129 | #define NUM_ALF_FLAG_CTX 1 ///< number of context models for ALF flag |
---|
130 | #define NUM_ALF_UVLC_CTX 2 ///< number of context models for ALF UVLC (filter length) |
---|
131 | #define NUM_ALF_SVLC_CTX 3 ///< number of context models for ALF SVLC (filter coeff.) |
---|
132 | |
---|
133 | #define NUM_SAO_FLAG_CTX 1 ///< number of context models for SAO flag |
---|
134 | #define NUM_SAO_UVLC_CTX 2 ///< number of context models for SAO UVLC |
---|
135 | #define NUM_SAO_SVLC_CTX 3 ///< number of context models for SAO SVLC |
---|
136 | #if SAO_UNIT_INTERLEAVING |
---|
137 | #define NUM_SAO_RUN_CTX 3 ///< number of context models for AO SVLC (filter coeff.) |
---|
138 | #define NUM_SAO_MERGE_LEFT_FLAG_CTX 3 ///< number of context models for AO SVLC (filter coeff.) |
---|
139 | #define NUM_SAO_MERGE_UP_FLAG_CTX 1 ///< number of context models for AO SVLC (filter coeff.) |
---|
140 | #define NUM_SAO_TYPE_IDX_CTX 2 ///< number of context models for AO SVLC (filter coeff.) |
---|
141 | #endif |
---|
142 | #if CABAC_LINEAR_INIT |
---|
143 | #define CNU 154 ///< dummy initialization value for unused context models 'Context model Not Used' |
---|
144 | #else |
---|
145 | #define CNU 119 ///< dummy initialization value for unused context models 'Context model Not Used' |
---|
146 | #endif |
---|
147 | |
---|
148 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
149 | #define NUM_DMM_FLAG_CTX 1 ///< number of context models for DMM flag |
---|
150 | #define NUM_DMM_MODE_CTX 1 ///< number of context models for DMM mode |
---|
151 | #define NUM_DMM_DATA_CTX 3 ///< number of context models for DMM data |
---|
152 | #endif |
---|
153 | |
---|
154 | // ==================================================================================================================== |
---|
155 | // Tables |
---|
156 | // ==================================================================================================================== |
---|
157 | |
---|
158 | // initial probability for split flag |
---|
159 | #if CABAC_LINEAR_INIT |
---|
160 | static const UChar |
---|
161 | INIT_SPLIT_FLAG[3][NUM_SPLIT_FLAG_CTX] = |
---|
162 | { |
---|
163 | { 139, 141, 157, }, |
---|
164 | { 107, 139, 126, }, |
---|
165 | { 107, 139, 126, }, |
---|
166 | }; |
---|
167 | |
---|
168 | static const UChar |
---|
169 | INIT_SKIP_FLAG[3][NUM_SKIP_FLAG_CTX] = |
---|
170 | { |
---|
171 | { CNU, CNU, CNU, }, |
---|
172 | { 197, 185, 201, }, |
---|
173 | { 197, 185, 201, }, |
---|
174 | }; |
---|
175 | |
---|
176 | static const UChar |
---|
177 | INIT_ALF_CTRL_FLAG[3][NUM_ALF_CTRL_FLAG_CTX] = |
---|
178 | { |
---|
179 | { 200, }, |
---|
180 | { 139, }, |
---|
181 | { 169, }, |
---|
182 | }; |
---|
183 | |
---|
184 | static const UChar |
---|
185 | INIT_MERGE_FLAG_EXT[3][NUM_MERGE_FLAG_EXT_CTX] = |
---|
186 | { |
---|
187 | { CNU, }, |
---|
188 | { 110, }, |
---|
189 | { 154, }, |
---|
190 | }; |
---|
191 | |
---|
192 | static const UChar |
---|
193 | INIT_MERGE_IDX_EXT[3][NUM_MERGE_IDX_EXT_CTX] = |
---|
194 | { |
---|
195 | #if MRG_IDX_CTX_RED |
---|
196 | { CNU, }, |
---|
197 | { 122, }, |
---|
198 | { 137, }, |
---|
199 | #else |
---|
200 | { CNU, CNU, CNU, CNU, }, |
---|
201 | { 122, 138, 153, 182, }, |
---|
202 | { 137, 139, 154, 139, }, |
---|
203 | #endif |
---|
204 | }; |
---|
205 | |
---|
206 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
207 | static const UChar |
---|
208 | INIT_RES_PRED_FLAG[3][NUM_RES_PRED_FLAG_CTX] = |
---|
209 | { |
---|
210 | { CNU, CNU, CNU, CNU }, |
---|
211 | { 154, 154, 154, 154 }, |
---|
212 | { 154, 154, 154, 154 }, |
---|
213 | }; |
---|
214 | #endif |
---|
215 | |
---|
216 | static const UChar |
---|
217 | INIT_PART_SIZE[3][NUM_PART_SIZE_CTX] = |
---|
218 | { |
---|
219 | { 184, CNU, CNU, CNU, }, |
---|
220 | { 154, 139, CNU, CNU, }, |
---|
221 | { 154, 139, CNU, CNU, }, |
---|
222 | }; |
---|
223 | |
---|
224 | #if AMP_CTX |
---|
225 | static const UChar |
---|
226 | INIT_CU_AMP_POS[3][NUM_CU_AMP_CTX] = |
---|
227 | { |
---|
228 | { CNU, }, |
---|
229 | { 154, }, |
---|
230 | { 154, }, |
---|
231 | }; |
---|
232 | #else |
---|
233 | static const UChar |
---|
234 | INIT_CU_X_POS[3][NUM_CU_X_POS_CTX] = |
---|
235 | { |
---|
236 | { CNU, CNU, }, |
---|
237 | { 154, 139, }, |
---|
238 | { 154, 139, }, |
---|
239 | }; |
---|
240 | |
---|
241 | static const UChar |
---|
242 | INIT_CU_Y_POS[3][NUM_CU_Y_POS_CTX] = |
---|
243 | { |
---|
244 | { CNU, CNU, }, |
---|
245 | { 154, 154, }, |
---|
246 | { 154, 139, }, |
---|
247 | }; |
---|
248 | #endif |
---|
249 | |
---|
250 | static const UChar |
---|
251 | INIT_PRED_MODE[3][NUM_PRED_MODE_CTX] = |
---|
252 | { |
---|
253 | { CNU, }, |
---|
254 | { 149, }, |
---|
255 | { 134, }, |
---|
256 | }; |
---|
257 | |
---|
258 | static const UChar |
---|
259 | INIT_INTRA_PRED_MODE[3][NUM_ADI_CTX] = |
---|
260 | { |
---|
261 | { 184, }, |
---|
262 | { 154, }, |
---|
263 | { 183, }, |
---|
264 | }; |
---|
265 | |
---|
266 | static const UChar |
---|
267 | INIT_CHROMA_PRED_MODE[3][NUM_CHROMA_PRED_CTX] = |
---|
268 | { |
---|
269 | { 63, 139, }, |
---|
270 | { 152, 139, }, |
---|
271 | { 152, 139, }, |
---|
272 | }; |
---|
273 | |
---|
274 | static const UChar |
---|
275 | INIT_INTER_DIR[3][NUM_INTER_DIR_CTX] = |
---|
276 | { |
---|
277 | { CNU, CNU, CNU, CNU, }, |
---|
278 | #if CABAC_INIT_FLAG |
---|
279 | { 95, 79, 63, 31, }, |
---|
280 | #else |
---|
281 | { CNU, CNU, CNU, CNU, }, |
---|
282 | #endif |
---|
283 | { 95, 79, 63, 31, }, |
---|
284 | }; |
---|
285 | |
---|
286 | static const UChar |
---|
287 | INIT_MVD[3][NUM_MV_RES_CTX] = |
---|
288 | { |
---|
289 | { CNU, CNU, }, |
---|
290 | { 140, 198, }, |
---|
291 | { 169, 198, }, |
---|
292 | }; |
---|
293 | |
---|
294 | static const UChar |
---|
295 | INIT_REF_PIC[3][NUM_REF_NO_CTX] = |
---|
296 | { |
---|
297 | { CNU, CNU, CNU, CNU, }, |
---|
298 | { 153, 153, 139, CNU, }, |
---|
299 | { 153, 153, 168, CNU, }, |
---|
300 | }; |
---|
301 | |
---|
302 | static const UChar |
---|
303 | INIT_DQP[3][NUM_DELTA_QP_CTX] = |
---|
304 | { |
---|
305 | { 154, 154, 154, }, |
---|
306 | { 154, 154, 154, }, |
---|
307 | { 154, 154, 154, }, |
---|
308 | }; |
---|
309 | |
---|
310 | static const UChar |
---|
311 | INIT_QT_CBF[3][2*NUM_QT_CBF_CTX] = |
---|
312 | { |
---|
313 | { 111, 141, CNU, CNU, CNU, 94, 138, 182, CNU, CNU, }, |
---|
314 | { 153, 111, CNU, CNU, CNU, 149, 107, 167, CNU, CNU, }, |
---|
315 | { 153, 111, CNU, CNU, CNU, 149, 92, 167, CNU, CNU, }, |
---|
316 | }; |
---|
317 | |
---|
318 | static const UChar |
---|
319 | INIT_QT_ROOT_CBF[3][NUM_QT_ROOT_CBF_CTX] = |
---|
320 | { |
---|
321 | { CNU, }, |
---|
322 | { 79, }, |
---|
323 | { 79, }, |
---|
324 | }; |
---|
325 | |
---|
326 | #if LAST_CTX_REDUCTION |
---|
327 | static const UChar |
---|
328 | INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] = |
---|
329 | { |
---|
330 | { 110, 110, 124, 110, 140, 111, 125, 111, 127, 111, 111, 156, 127, 127, 111, |
---|
331 | 108, 123, 63, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
332 | }, |
---|
333 | { 125, 110, 94, 110, 125, 110, 125, 111, 111, 110, 139, 111, 111, 111, 125, |
---|
334 | 108, 123, 108, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
335 | }, |
---|
336 | { 125, 110, 124, 110, 125, 110, 125, 111, 111, 110, 139, 111, 111, 111, 125, |
---|
337 | 108, 123, 93, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
338 | }, |
---|
339 | }; |
---|
340 | #else |
---|
341 | static const UChar |
---|
342 | INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] = |
---|
343 | { |
---|
344 | { 110, 110, 124, 110, 140, 111, 124, 125, 111, 127, 111, 138, 111, 156, 127, 127, 111, 94, |
---|
345 | 108, 123, 63, 63, 139, 124, 93, 108, 125, 111, 110, 63, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
346 | }, |
---|
347 | { 125, 110, 124, 110, 125, 110, 153, 125, 111, 111, 110, 153, 139, 111, 111, 111, 125, 139, |
---|
348 | 108, 123, 108, 152, 124, 94, 123, 137, 139, 110, 110, 154, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
349 | }, |
---|
350 | { 125, 110, 124, 110, 125, 110, 153, 125, 111, 111, 110, 153, 139, 111, 111, 111, 125, 139, |
---|
351 | 108, 123, 93, 152, 124, 94, 123, 152, 139, 110, 110, 154, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
352 | }, |
---|
353 | }; |
---|
354 | #endif |
---|
355 | |
---|
356 | static const UChar |
---|
357 | INIT_SIG_CG_FLAG[3][2 * NUM_SIG_CG_FLAG_CTX] = |
---|
358 | { |
---|
359 | { 91, 171, |
---|
360 | 134, 141, |
---|
361 | }, |
---|
362 | { 121, 140, |
---|
363 | 61, 154, |
---|
364 | }, |
---|
365 | { 121, 140, |
---|
366 | 61, 154, |
---|
367 | }, |
---|
368 | }; |
---|
369 | |
---|
370 | static const UChar |
---|
371 | INIT_SIG_FLAG[3][NUM_SIG_FLAG_CTX] = |
---|
372 | { |
---|
373 | { 141, 111, 125, 110, 110, 94, 124, 108, 124, 125, 139, 124, 63, 139, 168, 138, 107, 123, 92, 111, 141, 107, 125, 141, 179, 153, 125, 140, 139, 182, 123, 47, 153, 182, 137, 149, 192, 152, 224, 136, 31, 136, 74, 140, 141, 136, 139, 111, }, |
---|
374 | { 170, 154, 139, 153, 139, 123, 123, 63, 153, 168, 153, 152, 92, 152, 152, 137, 122, 92, 61, 155, 185, 166, 183, 140, 136, 153, 154, 155, 153, 123, 63, 61, 167, 153, 167, 136, 149, 107, 136, 121, 122, 91, 149, 170, 185, 151, 183, 140, }, |
---|
375 | { 170, 154, 139, 153, 139, 123, 123, 63, 124, 139, 153, 152, 92, 152, 152, 137, 137, 92, 61, 170, 185, 166, 183, 140, 136, 153, 154, 155, 153, 138, 107, 61, 167, 153, 167, 136, 121, 122, 136, 121, 122, 91, 149, 170, 170, 151, 183, 140, }, |
---|
376 | }; |
---|
377 | |
---|
378 | #if LEVEL_CTX_LUMA_RED |
---|
379 | static const UChar |
---|
380 | INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] = |
---|
381 | { |
---|
382 | { 140, 92, 137, 138, 140, 152, 138, 139, 153, 74, 149, 92, 139, 107, 122, 152, 140, 179, 166, 182, 140, 227, 122, 197, }, |
---|
383 | { 154, 196, 196, 167, 154, 152, 167, 182, 182, 134, 149, 136, 153, 121, 136, 137, 169, 194, 166, 167, 154, 167, 137, 182, }, |
---|
384 | { 154, 196, 167, 167, 154, 152, 167, 182, 182, 134, 149, 136, 153, 121, 136, 122, 169, 208, 166, 167, 154, 152, 167, 182, }, |
---|
385 | }; |
---|
386 | |
---|
387 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
388 | static const UChar |
---|
389 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
390 | { |
---|
391 | { 138, 153, 136, 167, 152, 152, }, |
---|
392 | { 107, 167, 91, 122, 107, 167, }, |
---|
393 | { 107, 167, 91, 107, 107, 167, }, |
---|
394 | }; |
---|
395 | #else |
---|
396 | static const UChar |
---|
397 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
398 | { |
---|
399 | { 138, 139, 111, 153, 139, 111, 136, 167, 139, 167, 153, 139, 152, 139, 140, 152, 184, 141, }, |
---|
400 | { 107, 153, 125, 167, 153, 140, 91, 137, 153, 122, 167, 139, 107, 153, 140, 167, 183, 140, }, |
---|
401 | { 107, 153, 125, 167, 153, 140, 91, 137, 153, 107, 167, 139, 107, 153, 140, 167, 183, 140, }, |
---|
402 | }; |
---|
403 | #endif |
---|
404 | #else |
---|
405 | static const UChar |
---|
406 | INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] = |
---|
407 | { |
---|
408 | { 140, 92, 137, 138, 140, 152, 138, 139, 126, 168, 139, 139, 153, 74, 149, 92, 139, 107, 122, 152, 110, 93, 152, 138, 140, 179, 166, 182, 140, 227, 122, 197, }, |
---|
409 | { 154, 196, 196, 167, 154, 152, 167, 182, 155, 139, 139, 139, 182, 134, 149, 136, 153, 121, 136, 137, 139, 122, 152, 167, 169, 194, 166, 167, 154, 167, 137, 182, }, |
---|
410 | { 154, 196, 167, 167, 154, 152, 167, 182, 155, 139, 139, 139, 182, 134, 149, 136, 153, 121, 136, 122, 139, 107, 152, 152, 169, 208, 166, 167, 154, 152, 167, 182, }, |
---|
411 | }; |
---|
412 | |
---|
413 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
414 | static const UChar |
---|
415 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
416 | { |
---|
417 | { 138, 153, 139, 136, 167, 153, 152, 152, }, |
---|
418 | { 107, 167, 139, 91, 122, 152, 107, 167, }, |
---|
419 | { 107, 167, 139, 91, 107, 93, 107, 167, }, |
---|
420 | }; |
---|
421 | #else |
---|
422 | static const UChar |
---|
423 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
424 | { |
---|
425 | { 138, 139, 111, 153, 139, 111, 139, 125, 111, 136, 167, 139, 167, 153, 139, 153, 139, 110, 152, 139, 140, 152, 184, 141, }, |
---|
426 | { 107, 153, 125, 167, 153, 140, 139, 154, 155, 91, 137, 153, 122, 167, 139, 152, 138, 139, 107, 153, 140, 167, 183, 140, }, |
---|
427 | { 107, 153, 125, 167, 153, 140, 139, 154, 155, 91, 137, 153, 107, 167, 139, 93, 138, 139, 107, 153, 140, 167, 183, 140, }, |
---|
428 | }; |
---|
429 | #endif |
---|
430 | #endif |
---|
431 | |
---|
432 | static const UChar |
---|
433 | INIT_MVP_IDX[3][NUM_MVP_IDX_CTX] = |
---|
434 | { |
---|
435 | { CNU, CNU, }, |
---|
436 | { 168, CNU, }, |
---|
437 | { 168, CNU, }, |
---|
438 | }; |
---|
439 | |
---|
440 | static const UChar |
---|
441 | INIT_ALF_FLAG[3][NUM_ALF_FLAG_CTX] = |
---|
442 | { |
---|
443 | { 153, }, |
---|
444 | { 153, }, |
---|
445 | { 153, }, |
---|
446 | }; |
---|
447 | |
---|
448 | static const UChar |
---|
449 | INIT_ALF_UVLC[3][NUM_ALF_UVLC_CTX] = |
---|
450 | { |
---|
451 | { 140, 154, }, |
---|
452 | { 154, 154, }, |
---|
453 | { 154, 154, }, |
---|
454 | }; |
---|
455 | |
---|
456 | static const UChar |
---|
457 | INIT_ALF_SVLC[3][NUM_ALF_SVLC_CTX] = |
---|
458 | { |
---|
459 | { 187, 154, 159, }, |
---|
460 | { 141, 154, 189, }, |
---|
461 | { 141, 154, 159, }, |
---|
462 | }; |
---|
463 | |
---|
464 | static const UChar |
---|
465 | INIT_SAO_FLAG[3][NUM_SAO_FLAG_CTX] = |
---|
466 | { |
---|
467 | { 154, }, |
---|
468 | { 153, }, |
---|
469 | { 153, }, |
---|
470 | }; |
---|
471 | |
---|
472 | static const UChar |
---|
473 | INIT_SAO_UVLC[3][NUM_SAO_UVLC_CTX] = |
---|
474 | { |
---|
475 | { 143, 140, }, |
---|
476 | { 185, 140, }, |
---|
477 | { 200, 140, }, |
---|
478 | }; |
---|
479 | |
---|
480 | static const UChar |
---|
481 | INIT_SAO_SVLC[3][NUM_SAO_SVLC_CTX] = |
---|
482 | { |
---|
483 | { 247, 154, 244, }, |
---|
484 | { 215, 154, 169, }, |
---|
485 | { 215, 154, 169, }, |
---|
486 | }; |
---|
487 | |
---|
488 | #if SAO_UNIT_INTERLEAVING |
---|
489 | static const UChar |
---|
490 | INIT_SAO_MERGE_LEFT_FLAG[3][NUM_SAO_MERGE_LEFT_FLAG_CTX] = |
---|
491 | { |
---|
492 | { 153, 153, 153, }, |
---|
493 | { 153, 153, 153, }, |
---|
494 | { 153, 153, 153, }, |
---|
495 | }; |
---|
496 | |
---|
497 | static const UChar |
---|
498 | INIT_SAO_MERGE_UP_FLAG[3][NUM_SAO_MERGE_UP_FLAG_CTX] = |
---|
499 | { |
---|
500 | { 175, }, |
---|
501 | { 153, }, |
---|
502 | { 153, }, |
---|
503 | }; |
---|
504 | |
---|
505 | static const UChar |
---|
506 | INIT_SAO_TYPE_IDX[3][NUM_SAO_TYPE_IDX_CTX] = |
---|
507 | { |
---|
508 | { 160, 140, }, |
---|
509 | { 185, 140, }, |
---|
510 | { 200, 140, }, |
---|
511 | }; |
---|
512 | #endif |
---|
513 | |
---|
514 | static const UChar |
---|
515 | INIT_TRANS_SUBDIV_FLAG[3][NUM_TRANS_SUBDIV_FLAG_CTX] = |
---|
516 | { |
---|
517 | { CNU, 224, 167, 122, CNU, CNU, CNU, CNU, CNU, CNU, }, |
---|
518 | { CNU, 124, 138, 94, CNU, CNU, CNU, CNU, CNU, CNU, }, |
---|
519 | { CNU, 153, 138, 138, CNU, CNU, CNU, CNU, CNU, CNU, }, |
---|
520 | }; |
---|
521 | #else |
---|
522 | static const UChar |
---|
523 | INIT_SPLIT_FLAG[3][NUM_SPLIT_FLAG_CTX] = |
---|
524 | { |
---|
525 | { |
---|
526 | 87, 74, 107, |
---|
527 | |
---|
528 | }, |
---|
529 | { |
---|
530 | 84, 103, 105, |
---|
531 | |
---|
532 | }, |
---|
533 | { |
---|
534 | 84, 103, 105, |
---|
535 | |
---|
536 | }, |
---|
537 | }; |
---|
538 | |
---|
539 | // initial probability for skip flag |
---|
540 | static const UChar |
---|
541 | INIT_SKIP_FLAG[3][NUM_SKIP_FLAG_CTX] = |
---|
542 | { |
---|
543 | { |
---|
544 | CNU, CNU, CNU, |
---|
545 | |
---|
546 | }, |
---|
547 | { |
---|
548 | 165, 168, 154, |
---|
549 | |
---|
550 | }, |
---|
551 | { |
---|
552 | 165, 168, 154, |
---|
553 | |
---|
554 | }, |
---|
555 | }; |
---|
556 | |
---|
557 | // initial probability for skip flag |
---|
558 | static const UChar |
---|
559 | INIT_ALF_CTRL_FLAG[3][NUM_ALF_CTRL_FLAG_CTX] = |
---|
560 | { |
---|
561 | { |
---|
562 | 153, |
---|
563 | |
---|
564 | }, |
---|
565 | { |
---|
566 | 87, |
---|
567 | |
---|
568 | }, |
---|
569 | { |
---|
570 | 135, |
---|
571 | |
---|
572 | }, |
---|
573 | }; |
---|
574 | |
---|
575 | // initial probability for merge flag |
---|
576 | static const UChar |
---|
577 | INIT_MERGE_FLAG_EXT[3][NUM_MERGE_FLAG_EXT_CTX] = |
---|
578 | { |
---|
579 | { |
---|
580 | CNU, |
---|
581 | |
---|
582 | }, |
---|
583 | { |
---|
584 | 72, |
---|
585 | |
---|
586 | }, |
---|
587 | { |
---|
588 | 119, |
---|
589 | |
---|
590 | }, |
---|
591 | }; |
---|
592 | |
---|
593 | static const UChar |
---|
594 | INIT_MERGE_IDX_EXT[3][NUM_MERGE_IDX_EXT_CTX] = |
---|
595 | { |
---|
596 | #if MRG_IDX_CTX_RED |
---|
597 | { |
---|
598 | CNU, |
---|
599 | |
---|
600 | }, |
---|
601 | { |
---|
602 | 100, |
---|
603 | |
---|
604 | }, |
---|
605 | { |
---|
606 | 116, |
---|
607 | }, |
---|
608 | #else |
---|
609 | { |
---|
610 | CNU, CNU, CNU, CNU, |
---|
611 | |
---|
612 | }, |
---|
613 | { |
---|
614 | 100, 86, 102, 133, |
---|
615 | |
---|
616 | }, |
---|
617 | { |
---|
618 | 116, 87, 119, 103, |
---|
619 | |
---|
620 | }, |
---|
621 | #endif |
---|
622 | }; |
---|
623 | |
---|
624 | // initial probability for PU size |
---|
625 | static const UChar |
---|
626 | INIT_PART_SIZE[3][NUM_PART_SIZE_CTX] = |
---|
627 | { |
---|
628 | { |
---|
629 | 167, CNU, CNU, CNU, |
---|
630 | |
---|
631 | }, |
---|
632 | { |
---|
633 | 119, 87, CNU, CNU, |
---|
634 | |
---|
635 | }, |
---|
636 | { |
---|
637 | 119, 87, CNU, CNU, |
---|
638 | |
---|
639 | }, |
---|
640 | }; |
---|
641 | #if AMP_CTX |
---|
642 | static const UChar |
---|
643 | INIT_CU_AMP_POS[3][NUM_CU_AMP_CTX] = |
---|
644 | { |
---|
645 | { |
---|
646 | CNU, |
---|
647 | }, |
---|
648 | { |
---|
649 | 119, |
---|
650 | }, |
---|
651 | { |
---|
652 | 119, |
---|
653 | }, |
---|
654 | }; |
---|
655 | #else |
---|
656 | // initial probability for AMP split position (X) |
---|
657 | static const UChar |
---|
658 | INIT_CU_X_POS[3][NUM_CU_X_POS_CTX] = |
---|
659 | { |
---|
660 | { |
---|
661 | CNU, CNU, |
---|
662 | |
---|
663 | }, |
---|
664 | { |
---|
665 | 119, 103, |
---|
666 | |
---|
667 | }, |
---|
668 | { |
---|
669 | 119, 103, |
---|
670 | |
---|
671 | }, |
---|
672 | }; |
---|
673 | |
---|
674 | // initial probability for AMP split position (Y) |
---|
675 | static const UChar |
---|
676 | INIT_CU_Y_POS[3][NUM_CU_Y_POS_CTX] = |
---|
677 | { |
---|
678 | { |
---|
679 | CNU, CNU, |
---|
680 | |
---|
681 | }, |
---|
682 | { |
---|
683 | 119, 119, |
---|
684 | |
---|
685 | }, |
---|
686 | { |
---|
687 | 119, 103, |
---|
688 | |
---|
689 | }, |
---|
690 | }; |
---|
691 | #endif |
---|
692 | // initial probability for prediction mode |
---|
693 | static const UChar |
---|
694 | INIT_PRED_MODE[3][NUM_PRED_MODE_CTX] = |
---|
695 | { |
---|
696 | { |
---|
697 | CNU, |
---|
698 | |
---|
699 | }, |
---|
700 | { |
---|
701 | 114, |
---|
702 | |
---|
703 | }, |
---|
704 | { |
---|
705 | 98, |
---|
706 | |
---|
707 | }, |
---|
708 | }; |
---|
709 | |
---|
710 | // initial probability for intra direction of luma |
---|
711 | static const UChar |
---|
712 | INIT_INTRA_PRED_MODE[3][NUM_ADI_CTX] = |
---|
713 | { |
---|
714 | { |
---|
715 | 167, |
---|
716 | |
---|
717 | }, |
---|
718 | { |
---|
719 | 119, |
---|
720 | |
---|
721 | }, |
---|
722 | { |
---|
723 | 150, |
---|
724 | |
---|
725 | }, |
---|
726 | }; |
---|
727 | |
---|
728 | // initial probability for intra direction of chroma |
---|
729 | static const UChar |
---|
730 | INIT_CHROMA_PRED_MODE[3][NUM_CHROMA_PRED_CTX] = |
---|
731 | { |
---|
732 | { |
---|
733 | 53, 103, |
---|
734 | |
---|
735 | }, |
---|
736 | { |
---|
737 | 85, 87, |
---|
738 | |
---|
739 | }, |
---|
740 | { |
---|
741 | 101, 87, |
---|
742 | |
---|
743 | }, |
---|
744 | }; |
---|
745 | |
---|
746 | // initial probability for temporal direction |
---|
747 | static const UChar |
---|
748 | INIT_INTER_DIR[3][NUM_INTER_DIR_CTX] = |
---|
749 | { |
---|
750 | { |
---|
751 | CNU, CNU, CNU, CNU, |
---|
752 | |
---|
753 | }, |
---|
754 | { |
---|
755 | CNU, CNU, CNU, CNU, |
---|
756 | |
---|
757 | }, |
---|
758 | { |
---|
759 | 41, 39, 38, 36, |
---|
760 | |
---|
761 | }, |
---|
762 | }; |
---|
763 | |
---|
764 | // initial probability for motion vector difference |
---|
765 | static const UChar |
---|
766 | INIT_MVD[3][NUM_MV_RES_CTX] = |
---|
767 | { |
---|
768 | { |
---|
769 | CNU, CNU, |
---|
770 | |
---|
771 | }, |
---|
772 | { |
---|
773 | 120, 166, |
---|
774 | |
---|
775 | }, |
---|
776 | { |
---|
777 | 135, 166, |
---|
778 | |
---|
779 | }, |
---|
780 | }; |
---|
781 | |
---|
782 | // initial probability for reference frame index |
---|
783 | static const UChar |
---|
784 | INIT_REF_PIC[3][NUM_REF_NO_CTX] = |
---|
785 | { |
---|
786 | { |
---|
787 | CNU, CNU, CNU, CNU, |
---|
788 | |
---|
789 | }, |
---|
790 | { |
---|
791 | 102, 118, 103, CNU, |
---|
792 | |
---|
793 | }, |
---|
794 | { |
---|
795 | 118, 118, 134, CNU, |
---|
796 | |
---|
797 | }, |
---|
798 | }; |
---|
799 | |
---|
800 | // initial probability for dQP |
---|
801 | static const UChar |
---|
802 | INIT_DQP[3][NUM_DELTA_QP_CTX] = |
---|
803 | { |
---|
804 | { |
---|
805 | CNU, CNU, CNU, |
---|
806 | |
---|
807 | }, |
---|
808 | { |
---|
809 | CNU, CNU, CNU, |
---|
810 | |
---|
811 | }, |
---|
812 | { |
---|
813 | CNU, CNU, CNU, |
---|
814 | |
---|
815 | }, |
---|
816 | }; |
---|
817 | |
---|
818 | static const UChar |
---|
819 | INIT_QT_CBF[3][2*NUM_QT_CBF_CTX] = |
---|
820 | { |
---|
821 | { |
---|
822 | 73, 74, CNU, CNU, CNU, |
---|
823 | 55, 86, 133, CNU, CNU, |
---|
824 | |
---|
825 | }, |
---|
826 | { |
---|
827 | 102, 89, CNU, CNU, CNU, |
---|
828 | 114, 84, 117, CNU, CNU, |
---|
829 | |
---|
830 | }, |
---|
831 | { |
---|
832 | 102, 89, CNU, CNU, CNU, |
---|
833 | 114, 68, 117, CNU, CNU, |
---|
834 | |
---|
835 | }, |
---|
836 | }; |
---|
837 | |
---|
838 | static const UChar |
---|
839 | INIT_QT_ROOT_CBF[3][NUM_QT_ROOT_CBF_CTX] = |
---|
840 | { |
---|
841 | { |
---|
842 | CNU, |
---|
843 | |
---|
844 | }, |
---|
845 | { |
---|
846 | 39, |
---|
847 | |
---|
848 | }, |
---|
849 | { |
---|
850 | 39, |
---|
851 | |
---|
852 | }, |
---|
853 | }; |
---|
854 | |
---|
855 | #if LAST_CTX_REDUCTION |
---|
856 | static const UChar |
---|
857 | INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] = |
---|
858 | { |
---|
859 | { |
---|
860 | 72, 72, 71, 72, 104, 89, 88, 89, 59, 73, 89, 106, 60, 59, 43, |
---|
861 | 54, 70, 53, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
862 | }, |
---|
863 | { |
---|
864 | 57, 72, 55, 72, 57, 72, 88, 73, 73, 72, 103, 73, 89, 73, 57, |
---|
865 | 54, 70, 54, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
866 | }, |
---|
867 | { |
---|
868 | 88, 72, 71, 72, 57, 72, 88, 73, 73, 72, 103, 73, 89, 73, 57, |
---|
869 | 54, 70, 69, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
870 | }, |
---|
871 | }; |
---|
872 | #else |
---|
873 | static const UChar |
---|
874 | INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] = |
---|
875 | { |
---|
876 | { |
---|
877 | 72, 72, 71, 72, 104, 89, 71, 88, 89, 59, 73, 86, 89, 106, 60, 59, 43, 55, |
---|
878 | 54, 70, 53, 53, 87, 71, 69, 54, 88, 73, 72, 53, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
879 | |
---|
880 | }, |
---|
881 | { |
---|
882 | 57, 72, 71, 72, 57, 72, 102, 88, 73, 73, 72, 102, 103, 73, 89, 73, 57, 87, |
---|
883 | 54, 70, 54, 101, 71, 55, 70, 116, 103, 72, 72, 119, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
884 | |
---|
885 | }, |
---|
886 | { |
---|
887 | 88, 72, 71, 72, 57, 72, 102, 88, 73, 73, 72, 118, 103, 73, 89, 73, 57, 87, |
---|
888 | 54, 70, 69, 85, 71, 55, 70, 85, 103, 72, 72, 119, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
889 | |
---|
890 | }, |
---|
891 | }; |
---|
892 | #endif |
---|
893 | |
---|
894 | static const UChar |
---|
895 | INIT_SIG_CG_FLAG[3][2 * NUM_SIG_CG_FLAG_CTX] = |
---|
896 | { |
---|
897 | { |
---|
898 | 83, 122, |
---|
899 | 98, 121, |
---|
900 | |
---|
901 | }, |
---|
902 | { |
---|
903 | 99, 120, |
---|
904 | 67, 119, |
---|
905 | |
---|
906 | }, |
---|
907 | { |
---|
908 | 99, 120, |
---|
909 | 67, 119, |
---|
910 | |
---|
911 | }, |
---|
912 | }; |
---|
913 | |
---|
914 | static const UChar |
---|
915 | INIT_SIG_FLAG[3][NUM_SIG_FLAG_CTX] = |
---|
916 | { |
---|
917 | { |
---|
918 | 74, 73, 88, 72, 72, 55, 71, 54, 71, 88, 103, 71, 53, 87, 134, 86, 84, 70, 68, 89, 90, 84, 88, 74, 130, 118, 88, |
---|
919 | 120, 87, 149, 70, 52, 118, 133, 116, 114, 129, 132, 162, 115, 51, 115, 66, 120, 74, 115, 87, 89, |
---|
920 | }, |
---|
921 | { |
---|
922 | 152, 119, 103, 118, 87, 70, 70, 53, 118, 134, 118, 101, 68, 85, 101, 116, 100, 68, 67, 136, 168, 147, 150, 120, 115, 118, 119, |
---|
923 | 136, 102, 70, 53, 67, 117, 102, 117, 115, 114, 84, 115, 99, 100, 83, 114, 152, 168, 131, 150, 120, |
---|
924 | }, |
---|
925 | { |
---|
926 | 152, 119, 103, 118, 87, 70, 70, 53, 71, 103, 118, 101, 68, 85, 101, 116, 116, 68, 67, 152, 168, 147, 150, 120, 115, 118, 119, |
---|
927 | 136, 102, 86, 84, 67, 117, 102, 117, 115, 99, 100, 115, 99, 100, 83, 114, 152, 152, 131, 150, 120, |
---|
928 | }, |
---|
929 | }; |
---|
930 | |
---|
931 | #if LEVEL_CTX_LUMA_RED |
---|
932 | static const UChar |
---|
933 | INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] = |
---|
934 | { |
---|
935 | { |
---|
936 | 104, 68, 116, 86, 104, 132, 86, 87, 102, 66, 114, 68, 87, 84, 100, 101, |
---|
937 | 104, 130, 147, 149, 104, 196, 100, 165, |
---|
938 | }, |
---|
939 | { |
---|
940 | 119, 179, 179, 164, 119, 85, 117, 149, 133, 98, 114, 115, 118, 99, 115, 116, |
---|
941 | 135, 146, 147, 164, 119, 148, 116, 133, |
---|
942 | }, |
---|
943 | { |
---|
944 | 119, 179, 148, 164, 119, 85, 117, 149, 133, 98, 114, 115, 118, 99, 115, 100, |
---|
945 | 135, 177, 147, 164, 119, 132, 148, 149, |
---|
946 | }, |
---|
947 | }; |
---|
948 | |
---|
949 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
950 | static const UChar |
---|
951 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
952 | { |
---|
953 | { |
---|
954 | 86, 102, 115, 117, 101, 101, |
---|
955 | }, |
---|
956 | { |
---|
957 | 84, 117, 83, 100, 84, 117, |
---|
958 | }, |
---|
959 | { |
---|
960 | 84, 117, 83, 84, 84, 117, |
---|
961 | }, |
---|
962 | }; |
---|
963 | #else |
---|
964 | static const UChar |
---|
965 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
966 | { |
---|
967 | { |
---|
968 | 86, 103, 73, 102, 103, 73, 115, 117, 103, 117, 118, 103, |
---|
969 | 101, 103, 104, 101, 167, 121, |
---|
970 | }, |
---|
971 | { |
---|
972 | 84, 102, 88, 117, 118, 104, 83, 116, 118, 100, 117, 87, |
---|
973 | 84, 118, 120, 117, 150, 120, |
---|
974 | }, |
---|
975 | { |
---|
976 | 84, 102, 88, 117, 118, 104, 83, 116, 118, 84, 117, 87, |
---|
977 | 84, 118, 120, 117, 150, 120, |
---|
978 | }, |
---|
979 | }; |
---|
980 | #endif |
---|
981 | #else |
---|
982 | static const UChar |
---|
983 | INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] = |
---|
984 | { |
---|
985 | { |
---|
986 | 104, 68, 116, 86, 104, 132, 86, 87, 105, 134, 87, 103, 102, 66, 114, 68, 87, 84, 100, 101, 72, 69, 101, 86, |
---|
987 | 104, 130, 147, 149, 104, 196, 100, 165, |
---|
988 | }, |
---|
989 | { |
---|
990 | 119, 179, 179, 164, 119, 85, 117, 149, 136, 103, 103, 103, 133, 98, 114, 115, 118, 99, 115, 116, 87, 100, 85, 117, |
---|
991 | 135, 146, 147, 164, 119, 148, 116, 133, |
---|
992 | }, |
---|
993 | { |
---|
994 | 119, 179, 148, 164, 119, 85, 117, 149, 136, 87, 103, 103, 133, 98, 114, 115, 118, 99, 115, 100, 87, 84, 85, 85, |
---|
995 | 135, 177, 147, 164, 119, 132, 148, 149, |
---|
996 | }, |
---|
997 | }; |
---|
998 | |
---|
999 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
1000 | static const UChar |
---|
1001 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
1002 | { |
---|
1003 | { |
---|
1004 | 86, 102, 103, 115, 117, 102, 101, 101, |
---|
1005 | }, |
---|
1006 | { |
---|
1007 | 84, 117, 103, 83, 100, 85, 84, 117, |
---|
1008 | }, |
---|
1009 | { |
---|
1010 | 84, 117, 87, 83, 84, 69, 84, 117, |
---|
1011 | }, |
---|
1012 | }; |
---|
1013 | #else |
---|
1014 | static const UChar |
---|
1015 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
1016 | { |
---|
1017 | { |
---|
1018 | 86, 103, 73, 102, 103, 73, 103, 88, 89, 115, 117, 103, 117, 118, 103, 102, 103, 72, |
---|
1019 | 101, 103, 104, 101, 167, 121, |
---|
1020 | }, |
---|
1021 | { |
---|
1022 | 84, 102, 88, 117, 118, 104, 103, 119, 136, 83, 116, 118, 100, 117, 87, 85, 86, 103, |
---|
1023 | 84, 118, 120, 117, 150, 120, |
---|
1024 | }, |
---|
1025 | { |
---|
1026 | 84, 102, 88, 117, 118, 104, 87, 119, 136, 83, 116, 118, 84, 117, 87, 69, 86, 87, |
---|
1027 | 84, 118, 120, 117, 150, 120, |
---|
1028 | }, |
---|
1029 | }; |
---|
1030 | #endif |
---|
1031 | #endif |
---|
1032 | // initial probability for motion vector predictor index |
---|
1033 | static const UChar |
---|
1034 | INIT_MVP_IDX[3][NUM_MVP_IDX_CTX] = |
---|
1035 | { |
---|
1036 | { |
---|
1037 | CNU, CNU, |
---|
1038 | |
---|
1039 | }, |
---|
1040 | { |
---|
1041 | 134, CNU, |
---|
1042 | |
---|
1043 | }, |
---|
1044 | { |
---|
1045 | 134, CNU, |
---|
1046 | |
---|
1047 | }, |
---|
1048 | }; |
---|
1049 | |
---|
1050 | // initial probability for ALF flag |
---|
1051 | static const UChar |
---|
1052 | INIT_ALF_FLAG[3][NUM_ALF_FLAG_CTX] = |
---|
1053 | { |
---|
1054 | { |
---|
1055 | 118, |
---|
1056 | |
---|
1057 | }, |
---|
1058 | { |
---|
1059 | 102, |
---|
1060 | |
---|
1061 | }, |
---|
1062 | { |
---|
1063 | 102, |
---|
1064 | |
---|
1065 | }, |
---|
1066 | }; |
---|
1067 | |
---|
1068 | // initial probability for ALF side information (unsigned) |
---|
1069 | static const UChar |
---|
1070 | INIT_ALF_UVLC[3][NUM_ALF_UVLC_CTX] = |
---|
1071 | { |
---|
1072 | { |
---|
1073 | 120, 119, |
---|
1074 | |
---|
1075 | }, |
---|
1076 | { |
---|
1077 | 119, 119, |
---|
1078 | |
---|
1079 | }, |
---|
1080 | { |
---|
1081 | 119, 119, |
---|
1082 | |
---|
1083 | }, |
---|
1084 | }; |
---|
1085 | |
---|
1086 | // initial probability for ALF side information (signed) |
---|
1087 | static const UChar |
---|
1088 | INIT_ALF_SVLC[3][NUM_ALF_SVLC_CTX] = |
---|
1089 | { |
---|
1090 | { |
---|
1091 | 139, 119, 124, |
---|
1092 | |
---|
1093 | }, |
---|
1094 | { |
---|
1095 | 90, 119, 140, |
---|
1096 | |
---|
1097 | }, |
---|
1098 | { |
---|
1099 | 90, 119, 124, |
---|
1100 | |
---|
1101 | }, |
---|
1102 | }; |
---|
1103 | |
---|
1104 | // initial probability for SAO flag |
---|
1105 | static const UChar |
---|
1106 | INIT_SAO_FLAG[3][NUM_SAO_FLAG_CTX] = |
---|
1107 | { |
---|
1108 | { |
---|
1109 | 119, |
---|
1110 | |
---|
1111 | }, |
---|
1112 | { |
---|
1113 | 102, |
---|
1114 | |
---|
1115 | }, |
---|
1116 | { |
---|
1117 | 102, |
---|
1118 | |
---|
1119 | }, |
---|
1120 | }; |
---|
1121 | |
---|
1122 | // initial probability for SAO side information (unsigned) |
---|
1123 | static const UChar |
---|
1124 | INIT_SAO_UVLC[3][NUM_SAO_UVLC_CTX] = |
---|
1125 | { |
---|
1126 | { |
---|
1127 | 61, 104, |
---|
1128 | |
---|
1129 | }, |
---|
1130 | { |
---|
1131 | 168, 120, |
---|
1132 | |
---|
1133 | }, |
---|
1134 | { |
---|
1135 | 184, 120, |
---|
1136 | |
---|
1137 | }, |
---|
1138 | }; |
---|
1139 | |
---|
1140 | // initial probability for SAO side information (signed) |
---|
1141 | static const UChar |
---|
1142 | INIT_SAO_SVLC[3][NUM_SAO_SVLC_CTX] = |
---|
1143 | { |
---|
1144 | { |
---|
1145 | 171, 119, 199, |
---|
1146 | |
---|
1147 | }, |
---|
1148 | { |
---|
1149 | 169, 119, 151, |
---|
1150 | |
---|
1151 | }, |
---|
1152 | { |
---|
1153 | 169, 119, 151, |
---|
1154 | |
---|
1155 | }, |
---|
1156 | }; |
---|
1157 | |
---|
1158 | #if SAO_UNIT_INTERLEAVING |
---|
1159 | static const UChar |
---|
1160 | INIT_SAO_MERGE_LEFT_FLAG[3][NUM_SAO_MERGE_LEFT_FLAG_CTX] = |
---|
1161 | { |
---|
1162 | { |
---|
1163 | 118, 118, 118, |
---|
1164 | }, |
---|
1165 | { |
---|
1166 | 102, 102, 102, |
---|
1167 | }, |
---|
1168 | { |
---|
1169 | 102, 102, 102, |
---|
1170 | }, |
---|
1171 | }; |
---|
1172 | |
---|
1173 | static const UChar |
---|
1174 | INIT_SAO_MERGE_UP_FLAG[3][NUM_SAO_MERGE_UP_FLAG_CTX] = |
---|
1175 | { |
---|
1176 | { |
---|
1177 | 109, |
---|
1178 | }, |
---|
1179 | { |
---|
1180 | 102, |
---|
1181 | }, |
---|
1182 | { |
---|
1183 | 102, |
---|
1184 | }, |
---|
1185 | }; |
---|
1186 | static const UChar |
---|
1187 | INIT_SAO_TYPE_IDX[3][NUM_SAO_TYPE_IDX_CTX] = |
---|
1188 | { |
---|
1189 | { |
---|
1190 | 64, 104 |
---|
1191 | }, |
---|
1192 | { |
---|
1193 | 168, 120 |
---|
1194 | }, |
---|
1195 | { |
---|
1196 | 184, 120 |
---|
1197 | }, |
---|
1198 | }; |
---|
1199 | static const Short |
---|
1200 | INIT_SAO_RUN[3][NUM_SAO_RUN_CTX][2] = |
---|
1201 | { |
---|
1202 | { |
---|
1203 | { 11, 57 }, { -1, 62 }, { 0, 64 } |
---|
1204 | }, |
---|
1205 | { |
---|
1206 | { 6, 66 }, { -1, 64 }, { 0, 64 } |
---|
1207 | }, |
---|
1208 | { |
---|
1209 | { 1, 73 }, { 2, 61 }, { 0, 64 } |
---|
1210 | } |
---|
1211 | }; |
---|
1212 | #endif |
---|
1213 | |
---|
1214 | static const UChar |
---|
1215 | INIT_TRANS_SUBDIV_FLAG[3][NUM_TRANS_SUBDIV_FLAG_CTX] = |
---|
1216 | { |
---|
1217 | { |
---|
1218 | CNU, 162, 148, 100, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
1219 | |
---|
1220 | }, |
---|
1221 | { |
---|
1222 | CNU, 71, 86, 55, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
1223 | |
---|
1224 | }, |
---|
1225 | { |
---|
1226 | CNU, 102, 86, 86, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
1227 | |
---|
1228 | }, |
---|
1229 | }; |
---|
1230 | #endif |
---|
1231 | |
---|
1232 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
1233 | static const Short |
---|
1234 | INIT_DMM_FLAG[3][NUM_DMM_FLAG_CTX] = |
---|
1235 | { |
---|
1236 | { |
---|
1237 | CNU |
---|
1238 | }, |
---|
1239 | { |
---|
1240 | CNU |
---|
1241 | }, |
---|
1242 | { |
---|
1243 | CNU |
---|
1244 | } |
---|
1245 | }; |
---|
1246 | |
---|
1247 | static const Short |
---|
1248 | INIT_DMM_MODE[3][NUM_DMM_MODE_CTX] = |
---|
1249 | { |
---|
1250 | { |
---|
1251 | CNU |
---|
1252 | }, |
---|
1253 | { |
---|
1254 | CNU |
---|
1255 | }, |
---|
1256 | { |
---|
1257 | CNU |
---|
1258 | } |
---|
1259 | }; |
---|
1260 | |
---|
1261 | static const Short |
---|
1262 | INIT_DMM_DATA[3][NUM_DMM_DATA_CTX] = |
---|
1263 | { |
---|
1264 | { |
---|
1265 | CNU, CNU, CNU |
---|
1266 | }, |
---|
1267 | { |
---|
1268 | CNU, CNU, CNU |
---|
1269 | }, |
---|
1270 | { |
---|
1271 | CNU, CNU, CNU |
---|
1272 | } |
---|
1273 | }; |
---|
1274 | #endif |
---|
1275 | |
---|
1276 | //! \} |
---|
1277 | |
---|
1278 | |
---|
1279 | #endif |
---|
1280 | |
---|