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 | #if LGE_ILLUCOMP_B0045 |
---|
55 | #define NUM_IC_FLAG_CTX 3 ///< number of context models for illumination compensation flag |
---|
56 | #endif |
---|
57 | |
---|
58 | #define NUM_MERGE_FLAG_EXT_CTX 1 ///< number of context models for merge flag of merge extended |
---|
59 | #if MRG_IDX_CTX_RED |
---|
60 | #define NUM_MERGE_IDX_EXT_CTX 1 ///< number of context models for merge index of merge extended |
---|
61 | #else |
---|
62 | #define NUM_MERGE_IDX_EXT_CTX 4 ///< number of context models for merge index of merge extended |
---|
63 | #endif |
---|
64 | |
---|
65 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
66 | #define NUM_RES_PRED_FLAG_CTX 4 ///< number of context for residual prediction flag |
---|
67 | #endif |
---|
68 | |
---|
69 | #define NUM_ALF_CTRL_FLAG_CTX 1 ///< number of context models for ALF control flag |
---|
70 | #define NUM_PART_SIZE_CTX 4 ///< number of context models for partition size |
---|
71 | #if AMP_CTX |
---|
72 | #define NUM_CU_AMP_CTX 1 ///< number of context models for partition size (AMP) |
---|
73 | #else |
---|
74 | #define NUM_CU_X_POS_CTX 2 ///< number of context models for partition size (AMP) |
---|
75 | #define NUM_CU_Y_POS_CTX 2 ///< number of context models for partition size (AMP) |
---|
76 | #endif |
---|
77 | #define NUM_PRED_MODE_CTX 1 ///< number of context models for prediction mode |
---|
78 | |
---|
79 | #define NUM_ADI_CTX 1 ///< number of context models for intra prediction |
---|
80 | |
---|
81 | #define NUM_CHROMA_PRED_CTX 2 ///< number of context models for intra prediction (chroma) |
---|
82 | #define NUM_INTER_DIR_CTX 4 ///< number of context models for inter prediction direction |
---|
83 | #define NUM_MV_RES_CTX 2 ///< number of context models for motion vector difference |
---|
84 | |
---|
85 | #define NUM_REF_NO_CTX 4 ///< number of context models for reference index |
---|
86 | #define NUM_TRANS_SUBDIV_FLAG_CTX 10 ///< number of context models for transform subdivision flags |
---|
87 | #define NUM_QT_CBF_CTX 5 ///< number of context models for QT CBF |
---|
88 | #define NUM_QT_ROOT_CBF_CTX 1 ///< number of context models for QT ROOT CBF |
---|
89 | #define NUM_DELTA_QP_CTX 3 ///< number of context models for dQP |
---|
90 | |
---|
91 | #define NUM_SIG_CG_FLAG_CTX 2 ///< number of context models for MULTI_LEVEL_SIGNIFICANCE |
---|
92 | |
---|
93 | #define NUM_SIG_FLAG_CTX 48 ///< number of context models for sig flag |
---|
94 | |
---|
95 | #define NUM_SIG_FLAG_CTX_LUMA 27 ///< number of context models for luma sig flag |
---|
96 | #define NUM_SIG_FLAG_CTX_CHROMA 21 ///< number of context models for chroma sig flag |
---|
97 | #if LAST_CTX_REDUCTION |
---|
98 | #define NUM_CTX_LAST_FLAG_XY 15 ///< number of context models for last coefficient position |
---|
99 | #else |
---|
100 | #define NUM_CTX_LAST_FLAG_XY 18 ///< number of context models for last coefficient position |
---|
101 | #endif |
---|
102 | |
---|
103 | #if LEVEL_CTX_LUMA_RED |
---|
104 | #define NUM_ONE_FLAG_CTX 24 ///< number of context models for greater than 1 flag |
---|
105 | #define NUM_ONE_FLAG_CTX_LUMA 16 ///< number of context models for greater than 1 flag of luma |
---|
106 | #define NUM_ONE_FLAG_CTX_CHROMA 8 ///< number of context models for greater than 1 flag of chroma |
---|
107 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
108 | #define NUM_ABS_FLAG_CTX 6 ///< number of context models for greater than 2 flag |
---|
109 | #define NUM_ABS_FLAG_CTX_LUMA 4 ///< number of context models for greater than 2 flag of luma |
---|
110 | #define NUM_ABS_FLAG_CTX_CHROMA 2 ///< number of context models for greater than 2 flag of chroma |
---|
111 | #else |
---|
112 | #define NUM_ABS_FLAG_CTX 18 ///< number of context models for greater than 2 flag |
---|
113 | #define NUM_ABS_FLAG_CTX_LUMA 12 ///< number of context models for greater than 2 flag of luma |
---|
114 | #define NUM_ABS_FLAG_CTX_CHROMA 6 ///< number of context models for greater than 2 flag of chroma |
---|
115 | #endif |
---|
116 | #else |
---|
117 | #define NUM_ONE_FLAG_CTX 32 ///< number of context models for greater than 1 flag |
---|
118 | #define NUM_ONE_FLAG_CTX_LUMA 24 ///< number of context models for greater than 1 flag of luma |
---|
119 | #define NUM_ONE_FLAG_CTX_CHROMA 8 ///< number of context models for greater than 1 flag of chroma |
---|
120 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
121 | #define NUM_ABS_FLAG_CTX 8 ///< number of context models for greater than 2 flag |
---|
122 | #define NUM_ABS_FLAG_CTX_LUMA 6 ///< number of context models for greater than 2 flag of luma |
---|
123 | #define NUM_ABS_FLAG_CTX_CHROMA 2 ///< number of context models for greater than 2 flag of chroma |
---|
124 | #else |
---|
125 | #define NUM_ABS_FLAG_CTX 24 ///< number of context models for greater than 2 flag |
---|
126 | #define NUM_ABS_FLAG_CTX_LUMA 18 ///< number of context models for greater than 2 flag of luma |
---|
127 | #define NUM_ABS_FLAG_CTX_CHROMA 6 ///< number of context models for greater than 2 flag of chroma |
---|
128 | #endif |
---|
129 | #endif |
---|
130 | |
---|
131 | #define NUM_MVP_IDX_CTX 2 ///< number of context models for MVP index |
---|
132 | |
---|
133 | #define NUM_ALF_FLAG_CTX 1 ///< number of context models for ALF flag |
---|
134 | #define NUM_ALF_UVLC_CTX 2 ///< number of context models for ALF UVLC (filter length) |
---|
135 | #define NUM_ALF_SVLC_CTX 3 ///< number of context models for ALF SVLC (filter coeff.) |
---|
136 | |
---|
137 | #define NUM_SAO_FLAG_CTX 1 ///< number of context models for SAO flag |
---|
138 | #define NUM_SAO_UVLC_CTX 2 ///< number of context models for SAO UVLC |
---|
139 | #define NUM_SAO_SVLC_CTX 3 ///< number of context models for SAO SVLC |
---|
140 | #if SAO_UNIT_INTERLEAVING |
---|
141 | #define NUM_SAO_RUN_CTX 3 ///< number of context models for AO SVLC (filter coeff.) |
---|
142 | #define NUM_SAO_MERGE_LEFT_FLAG_CTX 3 ///< number of context models for AO SVLC (filter coeff.) |
---|
143 | #define NUM_SAO_MERGE_UP_FLAG_CTX 1 ///< number of context models for AO SVLC (filter coeff.) |
---|
144 | #define NUM_SAO_TYPE_IDX_CTX 2 ///< number of context models for AO SVLC (filter coeff.) |
---|
145 | #endif |
---|
146 | #if CABAC_LINEAR_INIT |
---|
147 | #define CNU 154 ///< dummy initialization value for unused context models 'Context model Not Used' |
---|
148 | #else |
---|
149 | #define CNU 119 ///< dummy initialization value for unused context models 'Context model Not Used' |
---|
150 | #endif |
---|
151 | |
---|
152 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
153 | #define NUM_DMM_FLAG_CTX 1 ///< number of context models for DMM flag |
---|
154 | #define NUM_DMM_MODE_CTX 1 ///< number of context models for DMM mode |
---|
155 | #define NUM_DMM_DATA_CTX 3 ///< number of context models for DMM data |
---|
156 | #endif |
---|
157 | |
---|
158 | #if LGE_EDGE_INTRA_A0070 |
---|
159 | #define NUM_EDGE_INTRA_CTX 1 |
---|
160 | #if LGE_EDGE_INTRA_DELTA_DC |
---|
161 | #define NUM_EDGE_INTRA_DELTA_DC_CTX 2 // one for Delta_DC flag, another for Delta_DC value |
---|
162 | #endif |
---|
163 | #endif |
---|
164 | |
---|
165 | #if RWTH_SDC_DLT_B0036 |
---|
166 | #define SDC_NUM_FLAG_CTX 3 |
---|
167 | #define SDC_NUM_RESIDUAL_FLAG_CTX 1 |
---|
168 | #define SDC_NUM_SIGN_FLAG_CTX 1 |
---|
169 | #define SDC_NUM_RESIDUAL_CTX 10 |
---|
170 | |
---|
171 | #define SDC_NUM_PRED_MODE_CTX 5 |
---|
172 | #endif |
---|
173 | |
---|
174 | // ==================================================================================================================== |
---|
175 | // Tables |
---|
176 | // ==================================================================================================================== |
---|
177 | |
---|
178 | // initial probability for split flag |
---|
179 | #if CABAC_LINEAR_INIT |
---|
180 | static const UChar |
---|
181 | INIT_SPLIT_FLAG[3][NUM_SPLIT_FLAG_CTX] = |
---|
182 | { |
---|
183 | { 139, 141, 157, }, |
---|
184 | { 107, 139, 126, }, |
---|
185 | { 107, 139, 126, }, |
---|
186 | }; |
---|
187 | |
---|
188 | static const UChar |
---|
189 | INIT_SKIP_FLAG[3][NUM_SKIP_FLAG_CTX] = |
---|
190 | { |
---|
191 | { CNU, CNU, CNU, }, |
---|
192 | { 197, 185, 201, }, |
---|
193 | { 197, 185, 201, }, |
---|
194 | }; |
---|
195 | |
---|
196 | #if LGE_ILLUCOMP_B0045 |
---|
197 | static const UChar |
---|
198 | INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = |
---|
199 | { |
---|
200 | { CNU, CNU, CNU, }, |
---|
201 | { 197, 185, 201, }, |
---|
202 | { 197, 185, 201, }, |
---|
203 | }; |
---|
204 | #endif |
---|
205 | |
---|
206 | static const UChar |
---|
207 | INIT_ALF_CTRL_FLAG[3][NUM_ALF_CTRL_FLAG_CTX] = |
---|
208 | { |
---|
209 | { 200, }, |
---|
210 | { 139, }, |
---|
211 | { 169, }, |
---|
212 | }; |
---|
213 | |
---|
214 | static const UChar |
---|
215 | INIT_MERGE_FLAG_EXT[3][NUM_MERGE_FLAG_EXT_CTX] = |
---|
216 | { |
---|
217 | { CNU, }, |
---|
218 | { 110, }, |
---|
219 | { 154, }, |
---|
220 | }; |
---|
221 | |
---|
222 | static const UChar |
---|
223 | INIT_MERGE_IDX_EXT[3][NUM_MERGE_IDX_EXT_CTX] = |
---|
224 | { |
---|
225 | #if MRG_IDX_CTX_RED |
---|
226 | { CNU, }, |
---|
227 | { 122, }, |
---|
228 | { 137, }, |
---|
229 | #else |
---|
230 | { CNU, CNU, CNU, CNU, }, |
---|
231 | { 122, 138, 153, 182, }, |
---|
232 | { 137, 139, 154, 139, }, |
---|
233 | #endif |
---|
234 | }; |
---|
235 | |
---|
236 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
237 | static const UChar |
---|
238 | INIT_RES_PRED_FLAG[3][NUM_RES_PRED_FLAG_CTX] = |
---|
239 | { |
---|
240 | { CNU, CNU, CNU, CNU }, |
---|
241 | { 154, 154, 154, 154 }, |
---|
242 | { 154, 154, 154, 154 }, |
---|
243 | }; |
---|
244 | #endif |
---|
245 | |
---|
246 | static const UChar |
---|
247 | INIT_PART_SIZE[3][NUM_PART_SIZE_CTX] = |
---|
248 | { |
---|
249 | { 184, CNU, CNU, CNU, }, |
---|
250 | { 154, 139, CNU, CNU, }, |
---|
251 | { 154, 139, CNU, CNU, }, |
---|
252 | }; |
---|
253 | |
---|
254 | #if AMP_CTX |
---|
255 | static const UChar |
---|
256 | INIT_CU_AMP_POS[3][NUM_CU_AMP_CTX] = |
---|
257 | { |
---|
258 | { CNU, }, |
---|
259 | { 154, }, |
---|
260 | { 154, }, |
---|
261 | }; |
---|
262 | #else |
---|
263 | static const UChar |
---|
264 | INIT_CU_X_POS[3][NUM_CU_X_POS_CTX] = |
---|
265 | { |
---|
266 | { CNU, CNU, }, |
---|
267 | { 154, 139, }, |
---|
268 | { 154, 139, }, |
---|
269 | }; |
---|
270 | |
---|
271 | static const UChar |
---|
272 | INIT_CU_Y_POS[3][NUM_CU_Y_POS_CTX] = |
---|
273 | { |
---|
274 | { CNU, CNU, }, |
---|
275 | { 154, 154, }, |
---|
276 | { 154, 139, }, |
---|
277 | }; |
---|
278 | #endif |
---|
279 | |
---|
280 | static const UChar |
---|
281 | INIT_PRED_MODE[3][NUM_PRED_MODE_CTX] = |
---|
282 | { |
---|
283 | { CNU, }, |
---|
284 | { 149, }, |
---|
285 | { 134, }, |
---|
286 | }; |
---|
287 | |
---|
288 | static const UChar |
---|
289 | INIT_INTRA_PRED_MODE[3][NUM_ADI_CTX] = |
---|
290 | { |
---|
291 | { 184, }, |
---|
292 | { 154, }, |
---|
293 | { 183, }, |
---|
294 | }; |
---|
295 | |
---|
296 | static const UChar |
---|
297 | INIT_CHROMA_PRED_MODE[3][NUM_CHROMA_PRED_CTX] = |
---|
298 | { |
---|
299 | { 63, 139, }, |
---|
300 | { 152, 139, }, |
---|
301 | { 152, 139, }, |
---|
302 | }; |
---|
303 | |
---|
304 | static const UChar |
---|
305 | INIT_INTER_DIR[3][NUM_INTER_DIR_CTX] = |
---|
306 | { |
---|
307 | { CNU, CNU, CNU, CNU, }, |
---|
308 | #if CABAC_INIT_FLAG |
---|
309 | { 95, 79, 63, 31, }, |
---|
310 | #else |
---|
311 | { CNU, CNU, CNU, CNU, }, |
---|
312 | #endif |
---|
313 | { 95, 79, 63, 31, }, |
---|
314 | }; |
---|
315 | |
---|
316 | static const UChar |
---|
317 | INIT_MVD[3][NUM_MV_RES_CTX] = |
---|
318 | { |
---|
319 | { CNU, CNU, }, |
---|
320 | { 140, 198, }, |
---|
321 | { 169, 198, }, |
---|
322 | }; |
---|
323 | |
---|
324 | static const UChar |
---|
325 | INIT_REF_PIC[3][NUM_REF_NO_CTX] = |
---|
326 | { |
---|
327 | { CNU, CNU, CNU, CNU, }, |
---|
328 | { 153, 153, 139, CNU, }, |
---|
329 | { 153, 153, 168, CNU, }, |
---|
330 | }; |
---|
331 | |
---|
332 | static const UChar |
---|
333 | INIT_DQP[3][NUM_DELTA_QP_CTX] = |
---|
334 | { |
---|
335 | { 154, 154, 154, }, |
---|
336 | { 154, 154, 154, }, |
---|
337 | { 154, 154, 154, }, |
---|
338 | }; |
---|
339 | |
---|
340 | static const UChar |
---|
341 | INIT_QT_CBF[3][2*NUM_QT_CBF_CTX] = |
---|
342 | { |
---|
343 | { 111, 141, CNU, CNU, CNU, 94, 138, 182, CNU, CNU, }, |
---|
344 | { 153, 111, CNU, CNU, CNU, 149, 107, 167, CNU, CNU, }, |
---|
345 | { 153, 111, CNU, CNU, CNU, 149, 92, 167, CNU, CNU, }, |
---|
346 | }; |
---|
347 | |
---|
348 | static const UChar |
---|
349 | INIT_QT_ROOT_CBF[3][NUM_QT_ROOT_CBF_CTX] = |
---|
350 | { |
---|
351 | { CNU, }, |
---|
352 | { 79, }, |
---|
353 | { 79, }, |
---|
354 | }; |
---|
355 | |
---|
356 | #if LAST_CTX_REDUCTION |
---|
357 | static const UChar |
---|
358 | INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] = |
---|
359 | { |
---|
360 | { 110, 110, 124, 110, 140, 111, 125, 111, 127, 111, 111, 156, 127, 127, 111, |
---|
361 | 108, 123, 63, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
362 | }, |
---|
363 | { 125, 110, 94, 110, 125, 110, 125, 111, 111, 110, 139, 111, 111, 111, 125, |
---|
364 | 108, 123, 108, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
365 | }, |
---|
366 | { 125, 110, 124, 110, 125, 110, 125, 111, 111, 110, 139, 111, 111, 111, 125, |
---|
367 | 108, 123, 93, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
368 | }, |
---|
369 | }; |
---|
370 | #else |
---|
371 | static const UChar |
---|
372 | INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] = |
---|
373 | { |
---|
374 | { 110, 110, 124, 110, 140, 111, 124, 125, 111, 127, 111, 138, 111, 156, 127, 127, 111, 94, |
---|
375 | 108, 123, 63, 63, 139, 124, 93, 108, 125, 111, 110, 63, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
376 | }, |
---|
377 | { 125, 110, 124, 110, 125, 110, 153, 125, 111, 111, 110, 153, 139, 111, 111, 111, 125, 139, |
---|
378 | 108, 123, 108, 152, 124, 94, 123, 137, 139, 110, 110, 154, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
379 | }, |
---|
380 | { 125, 110, 124, 110, 125, 110, 153, 125, 111, 111, 110, 153, 139, 111, 111, 111, 125, 139, |
---|
381 | 108, 123, 93, 152, 124, 94, 123, 152, 139, 110, 110, 154, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
382 | }, |
---|
383 | }; |
---|
384 | #endif |
---|
385 | |
---|
386 | static const UChar |
---|
387 | INIT_SIG_CG_FLAG[3][2 * NUM_SIG_CG_FLAG_CTX] = |
---|
388 | { |
---|
389 | { 91, 171, |
---|
390 | 134, 141, |
---|
391 | }, |
---|
392 | { 121, 140, |
---|
393 | 61, 154, |
---|
394 | }, |
---|
395 | { 121, 140, |
---|
396 | 61, 154, |
---|
397 | }, |
---|
398 | }; |
---|
399 | |
---|
400 | static const UChar |
---|
401 | INIT_SIG_FLAG[3][NUM_SIG_FLAG_CTX] = |
---|
402 | { |
---|
403 | { 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, }, |
---|
404 | { 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, }, |
---|
405 | { 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, }, |
---|
406 | }; |
---|
407 | |
---|
408 | #if LEVEL_CTX_LUMA_RED |
---|
409 | static const UChar |
---|
410 | INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] = |
---|
411 | { |
---|
412 | { 140, 92, 137, 138, 140, 152, 138, 139, 153, 74, 149, 92, 139, 107, 122, 152, 140, 179, 166, 182, 140, 227, 122, 197, }, |
---|
413 | { 154, 196, 196, 167, 154, 152, 167, 182, 182, 134, 149, 136, 153, 121, 136, 137, 169, 194, 166, 167, 154, 167, 137, 182, }, |
---|
414 | { 154, 196, 167, 167, 154, 152, 167, 182, 182, 134, 149, 136, 153, 121, 136, 122, 169, 208, 166, 167, 154, 152, 167, 182, }, |
---|
415 | }; |
---|
416 | |
---|
417 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
418 | static const UChar |
---|
419 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
420 | { |
---|
421 | { 138, 153, 136, 167, 152, 152, }, |
---|
422 | { 107, 167, 91, 122, 107, 167, }, |
---|
423 | { 107, 167, 91, 107, 107, 167, }, |
---|
424 | }; |
---|
425 | #else |
---|
426 | static const UChar |
---|
427 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
428 | { |
---|
429 | { 138, 139, 111, 153, 139, 111, 136, 167, 139, 167, 153, 139, 152, 139, 140, 152, 184, 141, }, |
---|
430 | { 107, 153, 125, 167, 153, 140, 91, 137, 153, 122, 167, 139, 107, 153, 140, 167, 183, 140, }, |
---|
431 | { 107, 153, 125, 167, 153, 140, 91, 137, 153, 107, 167, 139, 107, 153, 140, 167, 183, 140, }, |
---|
432 | }; |
---|
433 | #endif |
---|
434 | #else |
---|
435 | static const UChar |
---|
436 | INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] = |
---|
437 | { |
---|
438 | { 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, }, |
---|
439 | { 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, }, |
---|
440 | { 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, }, |
---|
441 | }; |
---|
442 | |
---|
443 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
444 | static const UChar |
---|
445 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
446 | { |
---|
447 | { 138, 153, 139, 136, 167, 153, 152, 152, }, |
---|
448 | { 107, 167, 139, 91, 122, 152, 107, 167, }, |
---|
449 | { 107, 167, 139, 91, 107, 93, 107, 167, }, |
---|
450 | }; |
---|
451 | #else |
---|
452 | static const UChar |
---|
453 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
454 | { |
---|
455 | { 138, 139, 111, 153, 139, 111, 139, 125, 111, 136, 167, 139, 167, 153, 139, 153, 139, 110, 152, 139, 140, 152, 184, 141, }, |
---|
456 | { 107, 153, 125, 167, 153, 140, 139, 154, 155, 91, 137, 153, 122, 167, 139, 152, 138, 139, 107, 153, 140, 167, 183, 140, }, |
---|
457 | { 107, 153, 125, 167, 153, 140, 139, 154, 155, 91, 137, 153, 107, 167, 139, 93, 138, 139, 107, 153, 140, 167, 183, 140, }, |
---|
458 | }; |
---|
459 | #endif |
---|
460 | #endif |
---|
461 | |
---|
462 | static const UChar |
---|
463 | INIT_MVP_IDX[3][NUM_MVP_IDX_CTX] = |
---|
464 | { |
---|
465 | { CNU, CNU, }, |
---|
466 | { 168, CNU, }, |
---|
467 | { 168, CNU, }, |
---|
468 | }; |
---|
469 | |
---|
470 | static const UChar |
---|
471 | INIT_ALF_FLAG[3][NUM_ALF_FLAG_CTX] = |
---|
472 | { |
---|
473 | { 153, }, |
---|
474 | { 153, }, |
---|
475 | { 153, }, |
---|
476 | }; |
---|
477 | |
---|
478 | static const UChar |
---|
479 | INIT_ALF_UVLC[3][NUM_ALF_UVLC_CTX] = |
---|
480 | { |
---|
481 | { 140, 154, }, |
---|
482 | { 154, 154, }, |
---|
483 | { 154, 154, }, |
---|
484 | }; |
---|
485 | |
---|
486 | static const UChar |
---|
487 | INIT_ALF_SVLC[3][NUM_ALF_SVLC_CTX] = |
---|
488 | { |
---|
489 | { 187, 154, 159, }, |
---|
490 | { 141, 154, 189, }, |
---|
491 | { 141, 154, 159, }, |
---|
492 | }; |
---|
493 | |
---|
494 | static const UChar |
---|
495 | INIT_SAO_FLAG[3][NUM_SAO_FLAG_CTX] = |
---|
496 | { |
---|
497 | { 154, }, |
---|
498 | { 153, }, |
---|
499 | { 153, }, |
---|
500 | }; |
---|
501 | |
---|
502 | static const UChar |
---|
503 | INIT_SAO_UVLC[3][NUM_SAO_UVLC_CTX] = |
---|
504 | { |
---|
505 | { 143, 140, }, |
---|
506 | { 185, 140, }, |
---|
507 | { 200, 140, }, |
---|
508 | }; |
---|
509 | |
---|
510 | static const UChar |
---|
511 | INIT_SAO_SVLC[3][NUM_SAO_SVLC_CTX] = |
---|
512 | { |
---|
513 | { 247, 154, 244, }, |
---|
514 | { 215, 154, 169, }, |
---|
515 | { 215, 154, 169, }, |
---|
516 | }; |
---|
517 | |
---|
518 | #if SAO_UNIT_INTERLEAVING |
---|
519 | static const UChar |
---|
520 | INIT_SAO_MERGE_LEFT_FLAG[3][NUM_SAO_MERGE_LEFT_FLAG_CTX] = |
---|
521 | { |
---|
522 | { 153, 153, 153, }, |
---|
523 | { 153, 153, 153, }, |
---|
524 | { 153, 153, 153, }, |
---|
525 | }; |
---|
526 | |
---|
527 | static const UChar |
---|
528 | INIT_SAO_MERGE_UP_FLAG[3][NUM_SAO_MERGE_UP_FLAG_CTX] = |
---|
529 | { |
---|
530 | { 175, }, |
---|
531 | { 153, }, |
---|
532 | { 153, }, |
---|
533 | }; |
---|
534 | |
---|
535 | static const UChar |
---|
536 | INIT_SAO_TYPE_IDX[3][NUM_SAO_TYPE_IDX_CTX] = |
---|
537 | { |
---|
538 | { 160, 140, }, |
---|
539 | { 185, 140, }, |
---|
540 | { 200, 140, }, |
---|
541 | }; |
---|
542 | #endif |
---|
543 | |
---|
544 | static const UChar |
---|
545 | INIT_TRANS_SUBDIV_FLAG[3][NUM_TRANS_SUBDIV_FLAG_CTX] = |
---|
546 | { |
---|
547 | { CNU, 224, 167, 122, CNU, CNU, CNU, CNU, CNU, CNU, }, |
---|
548 | { CNU, 124, 138, 94, CNU, CNU, CNU, CNU, CNU, CNU, }, |
---|
549 | { CNU, 153, 138, 138, CNU, CNU, CNU, CNU, CNU, CNU, }, |
---|
550 | }; |
---|
551 | #else |
---|
552 | static const UChar |
---|
553 | INIT_SPLIT_FLAG[3][NUM_SPLIT_FLAG_CTX] = |
---|
554 | { |
---|
555 | { |
---|
556 | 87, 74, 107, |
---|
557 | |
---|
558 | }, |
---|
559 | { |
---|
560 | 84, 103, 105, |
---|
561 | |
---|
562 | }, |
---|
563 | { |
---|
564 | 84, 103, 105, |
---|
565 | |
---|
566 | }, |
---|
567 | }; |
---|
568 | |
---|
569 | // initial probability for skip flag |
---|
570 | static const UChar |
---|
571 | INIT_SKIP_FLAG[3][NUM_SKIP_FLAG_CTX] = |
---|
572 | { |
---|
573 | { |
---|
574 | CNU, CNU, CNU, |
---|
575 | |
---|
576 | }, |
---|
577 | { |
---|
578 | 165, 168, 154, |
---|
579 | |
---|
580 | }, |
---|
581 | { |
---|
582 | 165, 168, 154, |
---|
583 | |
---|
584 | }, |
---|
585 | }; |
---|
586 | |
---|
587 | // initial probability for skip flag |
---|
588 | static const UChar |
---|
589 | INIT_ALF_CTRL_FLAG[3][NUM_ALF_CTRL_FLAG_CTX] = |
---|
590 | { |
---|
591 | { |
---|
592 | 153, |
---|
593 | |
---|
594 | }, |
---|
595 | { |
---|
596 | 87, |
---|
597 | |
---|
598 | }, |
---|
599 | { |
---|
600 | 135, |
---|
601 | |
---|
602 | }, |
---|
603 | }; |
---|
604 | |
---|
605 | // initial probability for merge flag |
---|
606 | static const UChar |
---|
607 | INIT_MERGE_FLAG_EXT[3][NUM_MERGE_FLAG_EXT_CTX] = |
---|
608 | { |
---|
609 | { |
---|
610 | CNU, |
---|
611 | |
---|
612 | }, |
---|
613 | { |
---|
614 | 72, |
---|
615 | |
---|
616 | }, |
---|
617 | { |
---|
618 | 119, |
---|
619 | |
---|
620 | }, |
---|
621 | }; |
---|
622 | |
---|
623 | static const UChar |
---|
624 | INIT_MERGE_IDX_EXT[3][NUM_MERGE_IDX_EXT_CTX] = |
---|
625 | { |
---|
626 | #if MRG_IDX_CTX_RED |
---|
627 | { |
---|
628 | CNU, |
---|
629 | |
---|
630 | }, |
---|
631 | { |
---|
632 | 100, |
---|
633 | |
---|
634 | }, |
---|
635 | { |
---|
636 | 116, |
---|
637 | }, |
---|
638 | #else |
---|
639 | { |
---|
640 | CNU, CNU, CNU, CNU, |
---|
641 | |
---|
642 | }, |
---|
643 | { |
---|
644 | 100, 86, 102, 133, |
---|
645 | |
---|
646 | }, |
---|
647 | { |
---|
648 | 116, 87, 119, 103, |
---|
649 | |
---|
650 | }, |
---|
651 | #endif |
---|
652 | }; |
---|
653 | |
---|
654 | // initial probability for PU size |
---|
655 | static const UChar |
---|
656 | INIT_PART_SIZE[3][NUM_PART_SIZE_CTX] = |
---|
657 | { |
---|
658 | { |
---|
659 | 167, CNU, CNU, CNU, |
---|
660 | |
---|
661 | }, |
---|
662 | { |
---|
663 | 119, 87, CNU, CNU, |
---|
664 | |
---|
665 | }, |
---|
666 | { |
---|
667 | 119, 87, CNU, CNU, |
---|
668 | |
---|
669 | }, |
---|
670 | }; |
---|
671 | #if AMP_CTX |
---|
672 | static const UChar |
---|
673 | INIT_CU_AMP_POS[3][NUM_CU_AMP_CTX] = |
---|
674 | { |
---|
675 | { |
---|
676 | CNU, |
---|
677 | }, |
---|
678 | { |
---|
679 | 119, |
---|
680 | }, |
---|
681 | { |
---|
682 | 119, |
---|
683 | }, |
---|
684 | }; |
---|
685 | #else |
---|
686 | // initial probability for AMP split position (X) |
---|
687 | static const UChar |
---|
688 | INIT_CU_X_POS[3][NUM_CU_X_POS_CTX] = |
---|
689 | { |
---|
690 | { |
---|
691 | CNU, CNU, |
---|
692 | |
---|
693 | }, |
---|
694 | { |
---|
695 | 119, 103, |
---|
696 | |
---|
697 | }, |
---|
698 | { |
---|
699 | 119, 103, |
---|
700 | |
---|
701 | }, |
---|
702 | }; |
---|
703 | |
---|
704 | // initial probability for AMP split position (Y) |
---|
705 | static const UChar |
---|
706 | INIT_CU_Y_POS[3][NUM_CU_Y_POS_CTX] = |
---|
707 | { |
---|
708 | { |
---|
709 | CNU, CNU, |
---|
710 | |
---|
711 | }, |
---|
712 | { |
---|
713 | 119, 119, |
---|
714 | |
---|
715 | }, |
---|
716 | { |
---|
717 | 119, 103, |
---|
718 | |
---|
719 | }, |
---|
720 | }; |
---|
721 | #endif |
---|
722 | // initial probability for prediction mode |
---|
723 | static const UChar |
---|
724 | INIT_PRED_MODE[3][NUM_PRED_MODE_CTX] = |
---|
725 | { |
---|
726 | { |
---|
727 | CNU, |
---|
728 | |
---|
729 | }, |
---|
730 | { |
---|
731 | 114, |
---|
732 | |
---|
733 | }, |
---|
734 | { |
---|
735 | 98, |
---|
736 | |
---|
737 | }, |
---|
738 | }; |
---|
739 | |
---|
740 | // initial probability for intra direction of luma |
---|
741 | static const UChar |
---|
742 | INIT_INTRA_PRED_MODE[3][NUM_ADI_CTX] = |
---|
743 | { |
---|
744 | { |
---|
745 | 167, |
---|
746 | |
---|
747 | }, |
---|
748 | { |
---|
749 | 119, |
---|
750 | |
---|
751 | }, |
---|
752 | { |
---|
753 | 150, |
---|
754 | |
---|
755 | }, |
---|
756 | }; |
---|
757 | |
---|
758 | // initial probability for intra direction of chroma |
---|
759 | static const UChar |
---|
760 | INIT_CHROMA_PRED_MODE[3][NUM_CHROMA_PRED_CTX] = |
---|
761 | { |
---|
762 | { |
---|
763 | 53, 103, |
---|
764 | |
---|
765 | }, |
---|
766 | { |
---|
767 | 85, 87, |
---|
768 | |
---|
769 | }, |
---|
770 | { |
---|
771 | 101, 87, |
---|
772 | |
---|
773 | }, |
---|
774 | }; |
---|
775 | |
---|
776 | // initial probability for temporal direction |
---|
777 | static const UChar |
---|
778 | INIT_INTER_DIR[3][NUM_INTER_DIR_CTX] = |
---|
779 | { |
---|
780 | { |
---|
781 | CNU, CNU, CNU, CNU, |
---|
782 | |
---|
783 | }, |
---|
784 | { |
---|
785 | CNU, CNU, CNU, CNU, |
---|
786 | |
---|
787 | }, |
---|
788 | { |
---|
789 | 41, 39, 38, 36, |
---|
790 | |
---|
791 | }, |
---|
792 | }; |
---|
793 | |
---|
794 | // initial probability for motion vector difference |
---|
795 | static const UChar |
---|
796 | INIT_MVD[3][NUM_MV_RES_CTX] = |
---|
797 | { |
---|
798 | { |
---|
799 | CNU, CNU, |
---|
800 | |
---|
801 | }, |
---|
802 | { |
---|
803 | 120, 166, |
---|
804 | |
---|
805 | }, |
---|
806 | { |
---|
807 | 135, 166, |
---|
808 | |
---|
809 | }, |
---|
810 | }; |
---|
811 | |
---|
812 | // initial probability for reference frame index |
---|
813 | static const UChar |
---|
814 | INIT_REF_PIC[3][NUM_REF_NO_CTX] = |
---|
815 | { |
---|
816 | { |
---|
817 | CNU, CNU, CNU, CNU, |
---|
818 | |
---|
819 | }, |
---|
820 | { |
---|
821 | 102, 118, 103, CNU, |
---|
822 | |
---|
823 | }, |
---|
824 | { |
---|
825 | 118, 118, 134, CNU, |
---|
826 | |
---|
827 | }, |
---|
828 | }; |
---|
829 | |
---|
830 | // initial probability for dQP |
---|
831 | static const UChar |
---|
832 | INIT_DQP[3][NUM_DELTA_QP_CTX] = |
---|
833 | { |
---|
834 | { |
---|
835 | CNU, CNU, CNU, |
---|
836 | |
---|
837 | }, |
---|
838 | { |
---|
839 | CNU, CNU, CNU, |
---|
840 | |
---|
841 | }, |
---|
842 | { |
---|
843 | CNU, CNU, CNU, |
---|
844 | |
---|
845 | }, |
---|
846 | }; |
---|
847 | |
---|
848 | static const UChar |
---|
849 | INIT_QT_CBF[3][2*NUM_QT_CBF_CTX] = |
---|
850 | { |
---|
851 | { |
---|
852 | 73, 74, CNU, CNU, CNU, |
---|
853 | 55, 86, 133, CNU, CNU, |
---|
854 | |
---|
855 | }, |
---|
856 | { |
---|
857 | 102, 89, CNU, CNU, CNU, |
---|
858 | 114, 84, 117, CNU, CNU, |
---|
859 | |
---|
860 | }, |
---|
861 | { |
---|
862 | 102, 89, CNU, CNU, CNU, |
---|
863 | 114, 68, 117, CNU, CNU, |
---|
864 | |
---|
865 | }, |
---|
866 | }; |
---|
867 | |
---|
868 | static const UChar |
---|
869 | INIT_QT_ROOT_CBF[3][NUM_QT_ROOT_CBF_CTX] = |
---|
870 | { |
---|
871 | { |
---|
872 | CNU, |
---|
873 | |
---|
874 | }, |
---|
875 | { |
---|
876 | 39, |
---|
877 | |
---|
878 | }, |
---|
879 | { |
---|
880 | 39, |
---|
881 | |
---|
882 | }, |
---|
883 | }; |
---|
884 | |
---|
885 | #if LAST_CTX_REDUCTION |
---|
886 | static const UChar |
---|
887 | INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] = |
---|
888 | { |
---|
889 | { |
---|
890 | 72, 72, 71, 72, 104, 89, 88, 89, 59, 73, 89, 106, 60, 59, 43, |
---|
891 | 54, 70, 53, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
892 | }, |
---|
893 | { |
---|
894 | 57, 72, 55, 72, 57, 72, 88, 73, 73, 72, 103, 73, 89, 73, 57, |
---|
895 | 54, 70, 54, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
896 | }, |
---|
897 | { |
---|
898 | 88, 72, 71, 72, 57, 72, 88, 73, 73, 72, 103, 73, 89, 73, 57, |
---|
899 | 54, 70, 69, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
900 | }, |
---|
901 | }; |
---|
902 | #else |
---|
903 | static const UChar |
---|
904 | INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] = |
---|
905 | { |
---|
906 | { |
---|
907 | 72, 72, 71, 72, 104, 89, 71, 88, 89, 59, 73, 86, 89, 106, 60, 59, 43, 55, |
---|
908 | 54, 70, 53, 53, 87, 71, 69, 54, 88, 73, 72, 53, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
909 | |
---|
910 | }, |
---|
911 | { |
---|
912 | 57, 72, 71, 72, 57, 72, 102, 88, 73, 73, 72, 102, 103, 73, 89, 73, 57, 87, |
---|
913 | 54, 70, 54, 101, 71, 55, 70, 116, 103, 72, 72, 119, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
914 | |
---|
915 | }, |
---|
916 | { |
---|
917 | 88, 72, 71, 72, 57, 72, 102, 88, 73, 73, 72, 118, 103, 73, 89, 73, 57, 87, |
---|
918 | 54, 70, 69, 85, 71, 55, 70, 85, 103, 72, 72, 119, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
919 | |
---|
920 | }, |
---|
921 | }; |
---|
922 | #endif |
---|
923 | |
---|
924 | static const UChar |
---|
925 | INIT_SIG_CG_FLAG[3][2 * NUM_SIG_CG_FLAG_CTX] = |
---|
926 | { |
---|
927 | { |
---|
928 | 83, 122, |
---|
929 | 98, 121, |
---|
930 | |
---|
931 | }, |
---|
932 | { |
---|
933 | 99, 120, |
---|
934 | 67, 119, |
---|
935 | |
---|
936 | }, |
---|
937 | { |
---|
938 | 99, 120, |
---|
939 | 67, 119, |
---|
940 | |
---|
941 | }, |
---|
942 | }; |
---|
943 | |
---|
944 | static const UChar |
---|
945 | INIT_SIG_FLAG[3][NUM_SIG_FLAG_CTX] = |
---|
946 | { |
---|
947 | { |
---|
948 | 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, |
---|
949 | 120, 87, 149, 70, 52, 118, 133, 116, 114, 129, 132, 162, 115, 51, 115, 66, 120, 74, 115, 87, 89, |
---|
950 | }, |
---|
951 | { |
---|
952 | 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, |
---|
953 | 136, 102, 70, 53, 67, 117, 102, 117, 115, 114, 84, 115, 99, 100, 83, 114, 152, 168, 131, 150, 120, |
---|
954 | }, |
---|
955 | { |
---|
956 | 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, |
---|
957 | 136, 102, 86, 84, 67, 117, 102, 117, 115, 99, 100, 115, 99, 100, 83, 114, 152, 152, 131, 150, 120, |
---|
958 | }, |
---|
959 | }; |
---|
960 | |
---|
961 | #if LEVEL_CTX_LUMA_RED |
---|
962 | static const UChar |
---|
963 | INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] = |
---|
964 | { |
---|
965 | { |
---|
966 | 104, 68, 116, 86, 104, 132, 86, 87, 102, 66, 114, 68, 87, 84, 100, 101, |
---|
967 | 104, 130, 147, 149, 104, 196, 100, 165, |
---|
968 | }, |
---|
969 | { |
---|
970 | 119, 179, 179, 164, 119, 85, 117, 149, 133, 98, 114, 115, 118, 99, 115, 116, |
---|
971 | 135, 146, 147, 164, 119, 148, 116, 133, |
---|
972 | }, |
---|
973 | { |
---|
974 | 119, 179, 148, 164, 119, 85, 117, 149, 133, 98, 114, 115, 118, 99, 115, 100, |
---|
975 | 135, 177, 147, 164, 119, 132, 148, 149, |
---|
976 | }, |
---|
977 | }; |
---|
978 | |
---|
979 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
980 | static const UChar |
---|
981 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
982 | { |
---|
983 | { |
---|
984 | 86, 102, 115, 117, 101, 101, |
---|
985 | }, |
---|
986 | { |
---|
987 | 84, 117, 83, 100, 84, 117, |
---|
988 | }, |
---|
989 | { |
---|
990 | 84, 117, 83, 84, 84, 117, |
---|
991 | }, |
---|
992 | }; |
---|
993 | #else |
---|
994 | static const UChar |
---|
995 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
996 | { |
---|
997 | { |
---|
998 | 86, 103, 73, 102, 103, 73, 115, 117, 103, 117, 118, 103, |
---|
999 | 101, 103, 104, 101, 167, 121, |
---|
1000 | }, |
---|
1001 | { |
---|
1002 | 84, 102, 88, 117, 118, 104, 83, 116, 118, 100, 117, 87, |
---|
1003 | 84, 118, 120, 117, 150, 120, |
---|
1004 | }, |
---|
1005 | { |
---|
1006 | 84, 102, 88, 117, 118, 104, 83, 116, 118, 84, 117, 87, |
---|
1007 | 84, 118, 120, 117, 150, 120, |
---|
1008 | }, |
---|
1009 | }; |
---|
1010 | #endif |
---|
1011 | #else |
---|
1012 | static const UChar |
---|
1013 | INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] = |
---|
1014 | { |
---|
1015 | { |
---|
1016 | 104, 68, 116, 86, 104, 132, 86, 87, 105, 134, 87, 103, 102, 66, 114, 68, 87, 84, 100, 101, 72, 69, 101, 86, |
---|
1017 | 104, 130, 147, 149, 104, 196, 100, 165, |
---|
1018 | }, |
---|
1019 | { |
---|
1020 | 119, 179, 179, 164, 119, 85, 117, 149, 136, 103, 103, 103, 133, 98, 114, 115, 118, 99, 115, 116, 87, 100, 85, 117, |
---|
1021 | 135, 146, 147, 164, 119, 148, 116, 133, |
---|
1022 | }, |
---|
1023 | { |
---|
1024 | 119, 179, 148, 164, 119, 85, 117, 149, 136, 87, 103, 103, 133, 98, 114, 115, 118, 99, 115, 100, 87, 84, 85, 85, |
---|
1025 | 135, 177, 147, 164, 119, 132, 148, 149, |
---|
1026 | }, |
---|
1027 | }; |
---|
1028 | |
---|
1029 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
1030 | static const UChar |
---|
1031 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
1032 | { |
---|
1033 | { |
---|
1034 | 86, 102, 103, 115, 117, 102, 101, 101, |
---|
1035 | }, |
---|
1036 | { |
---|
1037 | 84, 117, 103, 83, 100, 85, 84, 117, |
---|
1038 | }, |
---|
1039 | { |
---|
1040 | 84, 117, 87, 83, 84, 69, 84, 117, |
---|
1041 | }, |
---|
1042 | }; |
---|
1043 | #else |
---|
1044 | static const UChar |
---|
1045 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
1046 | { |
---|
1047 | { |
---|
1048 | 86, 103, 73, 102, 103, 73, 103, 88, 89, 115, 117, 103, 117, 118, 103, 102, 103, 72, |
---|
1049 | 101, 103, 104, 101, 167, 121, |
---|
1050 | }, |
---|
1051 | { |
---|
1052 | 84, 102, 88, 117, 118, 104, 103, 119, 136, 83, 116, 118, 100, 117, 87, 85, 86, 103, |
---|
1053 | 84, 118, 120, 117, 150, 120, |
---|
1054 | }, |
---|
1055 | { |
---|
1056 | 84, 102, 88, 117, 118, 104, 87, 119, 136, 83, 116, 118, 84, 117, 87, 69, 86, 87, |
---|
1057 | 84, 118, 120, 117, 150, 120, |
---|
1058 | }, |
---|
1059 | }; |
---|
1060 | #endif |
---|
1061 | #endif |
---|
1062 | // initial probability for motion vector predictor index |
---|
1063 | static const UChar |
---|
1064 | INIT_MVP_IDX[3][NUM_MVP_IDX_CTX] = |
---|
1065 | { |
---|
1066 | { |
---|
1067 | CNU, CNU, |
---|
1068 | |
---|
1069 | }, |
---|
1070 | { |
---|
1071 | 134, CNU, |
---|
1072 | |
---|
1073 | }, |
---|
1074 | { |
---|
1075 | 134, CNU, |
---|
1076 | |
---|
1077 | }, |
---|
1078 | }; |
---|
1079 | |
---|
1080 | // initial probability for ALF flag |
---|
1081 | static const UChar |
---|
1082 | INIT_ALF_FLAG[3][NUM_ALF_FLAG_CTX] = |
---|
1083 | { |
---|
1084 | { |
---|
1085 | 118, |
---|
1086 | |
---|
1087 | }, |
---|
1088 | { |
---|
1089 | 102, |
---|
1090 | |
---|
1091 | }, |
---|
1092 | { |
---|
1093 | 102, |
---|
1094 | |
---|
1095 | }, |
---|
1096 | }; |
---|
1097 | |
---|
1098 | // initial probability for ALF side information (unsigned) |
---|
1099 | static const UChar |
---|
1100 | INIT_ALF_UVLC[3][NUM_ALF_UVLC_CTX] = |
---|
1101 | { |
---|
1102 | { |
---|
1103 | 120, 119, |
---|
1104 | |
---|
1105 | }, |
---|
1106 | { |
---|
1107 | 119, 119, |
---|
1108 | |
---|
1109 | }, |
---|
1110 | { |
---|
1111 | 119, 119, |
---|
1112 | |
---|
1113 | }, |
---|
1114 | }; |
---|
1115 | |
---|
1116 | // initial probability for ALF side information (signed) |
---|
1117 | static const UChar |
---|
1118 | INIT_ALF_SVLC[3][NUM_ALF_SVLC_CTX] = |
---|
1119 | { |
---|
1120 | { |
---|
1121 | 139, 119, 124, |
---|
1122 | |
---|
1123 | }, |
---|
1124 | { |
---|
1125 | 90, 119, 140, |
---|
1126 | |
---|
1127 | }, |
---|
1128 | { |
---|
1129 | 90, 119, 124, |
---|
1130 | |
---|
1131 | }, |
---|
1132 | }; |
---|
1133 | |
---|
1134 | // initial probability for SAO flag |
---|
1135 | static const UChar |
---|
1136 | INIT_SAO_FLAG[3][NUM_SAO_FLAG_CTX] = |
---|
1137 | { |
---|
1138 | { |
---|
1139 | 119, |
---|
1140 | |
---|
1141 | }, |
---|
1142 | { |
---|
1143 | 102, |
---|
1144 | |
---|
1145 | }, |
---|
1146 | { |
---|
1147 | 102, |
---|
1148 | |
---|
1149 | }, |
---|
1150 | }; |
---|
1151 | |
---|
1152 | // initial probability for SAO side information (unsigned) |
---|
1153 | static const UChar |
---|
1154 | INIT_SAO_UVLC[3][NUM_SAO_UVLC_CTX] = |
---|
1155 | { |
---|
1156 | { |
---|
1157 | 61, 104, |
---|
1158 | |
---|
1159 | }, |
---|
1160 | { |
---|
1161 | 168, 120, |
---|
1162 | |
---|
1163 | }, |
---|
1164 | { |
---|
1165 | 184, 120, |
---|
1166 | |
---|
1167 | }, |
---|
1168 | }; |
---|
1169 | |
---|
1170 | // initial probability for SAO side information (signed) |
---|
1171 | static const UChar |
---|
1172 | INIT_SAO_SVLC[3][NUM_SAO_SVLC_CTX] = |
---|
1173 | { |
---|
1174 | { |
---|
1175 | 171, 119, 199, |
---|
1176 | |
---|
1177 | }, |
---|
1178 | { |
---|
1179 | 169, 119, 151, |
---|
1180 | |
---|
1181 | }, |
---|
1182 | { |
---|
1183 | 169, 119, 151, |
---|
1184 | |
---|
1185 | }, |
---|
1186 | }; |
---|
1187 | |
---|
1188 | #if SAO_UNIT_INTERLEAVING |
---|
1189 | static const UChar |
---|
1190 | INIT_SAO_MERGE_LEFT_FLAG[3][NUM_SAO_MERGE_LEFT_FLAG_CTX] = |
---|
1191 | { |
---|
1192 | { |
---|
1193 | 118, 118, 118, |
---|
1194 | }, |
---|
1195 | { |
---|
1196 | 102, 102, 102, |
---|
1197 | }, |
---|
1198 | { |
---|
1199 | 102, 102, 102, |
---|
1200 | }, |
---|
1201 | }; |
---|
1202 | |
---|
1203 | static const UChar |
---|
1204 | INIT_SAO_MERGE_UP_FLAG[3][NUM_SAO_MERGE_UP_FLAG_CTX] = |
---|
1205 | { |
---|
1206 | { |
---|
1207 | 109, |
---|
1208 | }, |
---|
1209 | { |
---|
1210 | 102, |
---|
1211 | }, |
---|
1212 | { |
---|
1213 | 102, |
---|
1214 | }, |
---|
1215 | }; |
---|
1216 | static const UChar |
---|
1217 | INIT_SAO_TYPE_IDX[3][NUM_SAO_TYPE_IDX_CTX] = |
---|
1218 | { |
---|
1219 | { |
---|
1220 | 64, 104 |
---|
1221 | }, |
---|
1222 | { |
---|
1223 | 168, 120 |
---|
1224 | }, |
---|
1225 | { |
---|
1226 | 184, 120 |
---|
1227 | }, |
---|
1228 | }; |
---|
1229 | static const Short |
---|
1230 | INIT_SAO_RUN[3][NUM_SAO_RUN_CTX][2] = |
---|
1231 | { |
---|
1232 | { |
---|
1233 | { 11, 57 }, { -1, 62 }, { 0, 64 } |
---|
1234 | }, |
---|
1235 | { |
---|
1236 | { 6, 66 }, { -1, 64 }, { 0, 64 } |
---|
1237 | }, |
---|
1238 | { |
---|
1239 | { 1, 73 }, { 2, 61 }, { 0, 64 } |
---|
1240 | } |
---|
1241 | }; |
---|
1242 | #endif |
---|
1243 | |
---|
1244 | static const UChar |
---|
1245 | INIT_TRANS_SUBDIV_FLAG[3][NUM_TRANS_SUBDIV_FLAG_CTX] = |
---|
1246 | { |
---|
1247 | { |
---|
1248 | CNU, 162, 148, 100, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
1249 | |
---|
1250 | }, |
---|
1251 | { |
---|
1252 | CNU, 71, 86, 55, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
1253 | |
---|
1254 | }, |
---|
1255 | { |
---|
1256 | CNU, 102, 86, 86, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
1257 | |
---|
1258 | }, |
---|
1259 | }; |
---|
1260 | #endif |
---|
1261 | |
---|
1262 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
1263 | static const Short |
---|
1264 | INIT_DMM_FLAG[3][NUM_DMM_FLAG_CTX] = |
---|
1265 | { |
---|
1266 | { |
---|
1267 | CNU |
---|
1268 | }, |
---|
1269 | { |
---|
1270 | CNU |
---|
1271 | }, |
---|
1272 | { |
---|
1273 | CNU |
---|
1274 | } |
---|
1275 | }; |
---|
1276 | |
---|
1277 | static const Short |
---|
1278 | INIT_DMM_MODE[3][NUM_DMM_MODE_CTX] = |
---|
1279 | { |
---|
1280 | { |
---|
1281 | CNU |
---|
1282 | }, |
---|
1283 | { |
---|
1284 | CNU |
---|
1285 | }, |
---|
1286 | { |
---|
1287 | CNU |
---|
1288 | } |
---|
1289 | }; |
---|
1290 | |
---|
1291 | static const Short |
---|
1292 | INIT_DMM_DATA[3][NUM_DMM_DATA_CTX] = |
---|
1293 | { |
---|
1294 | { |
---|
1295 | CNU, CNU, CNU |
---|
1296 | }, |
---|
1297 | { |
---|
1298 | CNU, CNU, CNU |
---|
1299 | }, |
---|
1300 | { |
---|
1301 | CNU, CNU, CNU |
---|
1302 | } |
---|
1303 | }; |
---|
1304 | |
---|
1305 | #if LGE_EDGE_INTRA_A0070 |
---|
1306 | static const Short |
---|
1307 | INIT_EDGE_INTRA[3][NUM_EDGE_INTRA_CTX] = |
---|
1308 | { |
---|
1309 | { |
---|
1310 | CNU |
---|
1311 | }, |
---|
1312 | { |
---|
1313 | CNU |
---|
1314 | }, |
---|
1315 | { |
---|
1316 | CNU |
---|
1317 | } |
---|
1318 | }; |
---|
1319 | |
---|
1320 | #if LGE_EDGE_INTRA_DELTA_DC |
---|
1321 | static const Short |
---|
1322 | INIT_EDGE_INTRA_DELTA_DC[3][NUM_EDGE_INTRA_DELTA_DC_CTX] = |
---|
1323 | { |
---|
1324 | { |
---|
1325 | CNU, CNU |
---|
1326 | }, |
---|
1327 | { |
---|
1328 | CNU, CNU |
---|
1329 | }, |
---|
1330 | { |
---|
1331 | CNU, CNU |
---|
1332 | } |
---|
1333 | }; |
---|
1334 | #endif |
---|
1335 | #endif |
---|
1336 | |
---|
1337 | #endif |
---|
1338 | |
---|
1339 | #if RWTH_SDC_DLT_B0036 |
---|
1340 | static const Short INIT_SDC_FLAG[3][SDC_NUM_FLAG_CTX][2] = |
---|
1341 | { |
---|
1342 | { |
---|
1343 | { 0, 64 }, { 0, 64 }, { 0, 64 } |
---|
1344 | }, |
---|
1345 | { |
---|
1346 | { 0, 64 }, { 0, 64 }, { 0, 64 } |
---|
1347 | }, |
---|
1348 | { |
---|
1349 | { 0, 64 }, { 0, 64 }, { 0, 64 } |
---|
1350 | } |
---|
1351 | }; |
---|
1352 | |
---|
1353 | static const Short INIT_SDC_RESIDUAL_FLAG[3][3*SDC_NUM_RESIDUAL_FLAG_CTX][2] = |
---|
1354 | { |
---|
1355 | { |
---|
1356 | { -5, 35 }, |
---|
1357 | { -0, 56 }, |
---|
1358 | { -0, 56 } |
---|
1359 | |
---|
1360 | }, |
---|
1361 | { |
---|
1362 | { -5, 35 }, |
---|
1363 | { -0, 56 }, |
---|
1364 | { -0, 56 } |
---|
1365 | }, |
---|
1366 | { |
---|
1367 | { -5, 35 }, |
---|
1368 | { -0, 56 }, |
---|
1369 | { -0, 56 } |
---|
1370 | } |
---|
1371 | }; |
---|
1372 | |
---|
1373 | static const Short INIT_SDC_SIGN_FLAG[3][3*SDC_NUM_SIGN_FLAG_CTX][2] = |
---|
1374 | { |
---|
1375 | { |
---|
1376 | { -1, 56 }, |
---|
1377 | { -4, 55 }, |
---|
1378 | { -4, 55 } |
---|
1379 | }, |
---|
1380 | { |
---|
1381 | { -1, 56 }, |
---|
1382 | { -4, 55 }, |
---|
1383 | { -4, 55 } |
---|
1384 | }, |
---|
1385 | { |
---|
1386 | { -1, 56 }, |
---|
1387 | { -4, 55 }, |
---|
1388 | { -4, 55 } |
---|
1389 | } |
---|
1390 | }; |
---|
1391 | |
---|
1392 | static const Short INIT_SDC_RESIDUAL[3][3*SDC_NUM_RESIDUAL_CTX][2] = |
---|
1393 | { |
---|
1394 | { |
---|
1395 | { -1, 64 }, { 2, 64 }, { 6, 67 }, { 8, 61 }, { 7, 47 }, { 10, 33 }, { 12, 14 }, { 33, -13 }, { 12, 14 }, { 33, -13 }, |
---|
1396 | { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 }, |
---|
1397 | { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 } |
---|
1398 | }, |
---|
1399 | { |
---|
1400 | { -1, 64 }, { 2, 64 }, { 6, 67 }, { 8, 61 }, { 7, 47 }, { 10, 33 }, { 12, 14 }, { 33, -13 }, { 12, 14 }, { 33, -13 }, |
---|
1401 | { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 }, |
---|
1402 | { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 } |
---|
1403 | }, |
---|
1404 | { |
---|
1405 | { -1, 64 }, { 2, 64 }, { 6, 67 }, { 8, 61 }, { 7, 47 }, { 10, 33 }, { 12, 14 }, { 33, -13 }, { 12, 14 }, { 33, -13 }, |
---|
1406 | { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 }, |
---|
1407 | { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 } |
---|
1408 | } |
---|
1409 | }; |
---|
1410 | |
---|
1411 | static const Short INIT_SDC_PRED_MODE[3][3*SDC_NUM_PRED_MODE_CTX][2] = |
---|
1412 | { |
---|
1413 | { |
---|
1414 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, |
---|
1415 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, |
---|
1416 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 } |
---|
1417 | }, |
---|
1418 | { |
---|
1419 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, |
---|
1420 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, |
---|
1421 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 } |
---|
1422 | }, |
---|
1423 | { |
---|
1424 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, |
---|
1425 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, |
---|
1426 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 } |
---|
1427 | } |
---|
1428 | }; |
---|
1429 | #endif |
---|
1430 | |
---|
1431 | //! \} |
---|
1432 | |
---|
1433 | #endif |
---|
1434 | |
---|