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