Line data Source code
1 : /******************************************************************************************************
2 :
3 : (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
4 : Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
5 : Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
6 : Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
7 : contributors to this repository. All Rights Reserved.
8 :
9 : This software is protected by copyright law and by international treaties.
10 : The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
11 : Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
12 : Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
13 : Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
14 : contributors to this repository retain full ownership rights in their respective contributions in
15 : the software. This notice grants no license of any kind, including but not limited to patent
16 : license, nor is any license granted by implication, estoppel or otherwise.
17 :
18 : Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
19 : contributions.
20 :
21 : This software is provided "AS IS", without any express or implied warranties. The software is in the
22 : development stage. It is intended exclusively for experts who have experience with such software and
23 : solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
24 : and fitness for a particular purpose are hereby disclaimed and excluded.
25 :
26 : Any dispute, controversy or claim arising under or in relation to providing this software shall be
27 : submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
28 : accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
29 : the United Nations Convention on Contracts on the International Sales of Goods.
30 :
31 : *******************************************************************************************************/
32 :
33 : #include <stdint.h>
34 : #include "options.h"
35 : #include "ivas_rom_com.h"
36 : #include "math.h"
37 : #include "prot_fx.h"
38 : #include "wmc_auto.h"
39 : #include "ivas_prot_fx.h"
40 :
41 :
42 : /*-----------------------------------------------------------------------------------------*
43 : * Function ivas_wrap_arround)
44 : *
45 : * wrap around
46 : *-----------------------------------------------------------------------------------------*/
47 :
48 460041 : void ivas_wrap_arround_fx(
49 : Word16 *pArr,
50 : const Word16 min_val,
51 : const Word16 max_val,
52 : const Word16 length )
53 : {
54 : Word16 i;
55 :
56 6731733 : FOR( i = 0; i < length; i++ )
57 : {
58 6271692 : IF( LT_16( pArr[i], min_val ) )
59 : {
60 3137 : pArr[i] = add( sub( max_val, min_val ), add( pArr[i], 1 ) );
61 3137 : move16();
62 : }
63 6271692 : IF( GT_16( pArr[i], max_val ) )
64 : {
65 1530 : pArr[i] = sub( add( min_val, pArr[i] ), add( max_val, 1 ) );
66 1530 : move16();
67 : }
68 : }
69 :
70 460041 : return;
71 : }
72 :
73 :
74 : /*-----------------------------------------------------------------------------------------*
75 : * Function ivas_get_cum_freq_model()
76 : *
77 : * get cumulative frequency model
78 : *-----------------------------------------------------------------------------------------*/
79 :
80 274608 : void ivas_get_cum_freq_model_fx(
81 : const Word16 *pFreq_model,
82 : const Word16 length,
83 : Word16 *pCum_freq_model )
84 : {
85 : Word16 i;
86 :
87 274608 : pCum_freq_model[length] = 0;
88 274608 : move16();
89 :
90 2555280 : FOR( i = length; i > 0; i-- )
91 : {
92 2280672 : pCum_freq_model[i - 1] = add( pCum_freq_model[i], pFreq_model[i] );
93 2280672 : move16();
94 : }
95 :
96 274608 : return;
97 : }
98 :
99 :
100 : /*-----------------------------------------------------------------------------------------*
101 : * Function ivas_map_num_pred_r_to_idx()
102 : *
103 : * Map the ivas_arith_pred_r_consts and ivas_huff_pred_r_consts tables
104 : *-----------------------------------------------------------------------------------------*/
105 :
106 22884 : Word16 ivas_map_num_pred_r_to_idx_fx(
107 : const Word16 num_quant_points_pred_r,
108 : const Word16 active_w_flag )
109 : {
110 22884 : Word16 pred_r_to_idx = -1;
111 22884 : move16();
112 22884 : IF( active_w_flag == 0 )
113 : {
114 18720 : SWITCH( num_quant_points_pred_r )
115 : {
116 2756 : case 1:
117 2756 : pred_r_to_idx = PRED_Q_1;
118 2756 : move16();
119 2756 : BREAK;
120 1389 : case 7:
121 1389 : pred_r_to_idx = PRED_Q_7;
122 1389 : move16();
123 1389 : BREAK;
124 5792 : case 15:
125 5792 : pred_r_to_idx = PRED_Q_15;
126 5792 : move16();
127 5792 : BREAK;
128 7405 : case 21:
129 7405 : pred_r_to_idx = PRED_Q_21;
130 7405 : move16();
131 7405 : BREAK;
132 1378 : case 31:
133 1378 : pred_r_to_idx = PRED_Q_31;
134 1378 : move16();
135 1378 : BREAK;
136 0 : default:
137 0 : assert( !"Forbidden value for prediction quantization strategy index" );
138 : BREAK;
139 : }
140 : }
141 : ELSE
142 : {
143 4164 : SWITCH( num_quant_points_pred_r )
144 : {
145 1059 : case 7:
146 1059 : pred_r_to_idx = PRED_Q_7_ACTIVE_W;
147 1059 : move16();
148 1059 : BREAK;
149 2776 : case 15:
150 2776 : pred_r_to_idx = PRED_Q_15_ACTIVE_W;
151 2776 : move16();
152 2776 : BREAK;
153 329 : case 21:
154 329 : pred_r_to_idx = PRED_Q_21_ACTIVE_W;
155 329 : move16();
156 329 : BREAK;
157 0 : default:
158 0 : assert( !"Forbidden value for prediction quantization strategy index" );
159 : BREAK;
160 : }
161 : }
162 :
163 22884 : return pred_r_to_idx;
164 : }
165 :
166 :
167 : /*-----------------------------------------------------------------------------------------*
168 : * Function ivas_map_num_drct_r_to_idx()
169 : *
170 : * Map the ivas_arith_drct_r_consts and ivas_huff_drct_r_consts tables
171 : *-----------------------------------------------------------------------------------------*/
172 :
173 22884 : Word16 ivas_map_num_drct_r_to_idx_fx(
174 : const Word16 num_quant_points_drct_r )
175 : {
176 22884 : Word16 drct_r_to_idx = -1;
177 22884 : move16();
178 22884 : SWITCH( num_quant_points_drct_r )
179 : {
180 11464 : case 1:
181 11464 : drct_r_to_idx = DRCT_Q_1;
182 11464 : move16();
183 11464 : BREAK;
184 7054 : case 7:
185 7054 : drct_r_to_idx = DRCT_Q_7;
186 7054 : move16();
187 7054 : BREAK;
188 1966 : case 9:
189 1966 : drct_r_to_idx = DRCT_Q_9;
190 1966 : move16();
191 1966 : BREAK;
192 2400 : case 11:
193 2400 : drct_r_to_idx = DRCT_Q_11;
194 2400 : move16();
195 2400 : BREAK;
196 0 : default:
197 0 : assert( !"Forbidden value for DRCT quantization strategy index" );
198 : BREAK;
199 : }
200 22884 : return drct_r_to_idx;
201 : }
202 :
203 :
204 : /*-----------------------------------------------------------------------------------------*
205 : * Function ivas_map_num_decd_r_to_idx()
206 : *
207 : * Map the ivas_arith_decd_r_consts and ivas_huff_decd_r_consts tables
208 : *-----------------------------------------------------------------------------------------*/
209 :
210 22884 : Word16 ivas_map_num_decd_r_to_idx_fx(
211 : const Word16 num_quant_points_decd_r )
212 : {
213 22884 : Word16 decd_r_to_idx = -1;
214 22884 : move16();
215 22884 : SWITCH( num_quant_points_decd_r )
216 : {
217 3136 : case 1:
218 3136 : decd_r_to_idx = DECD_Q_1;
219 3136 : move16();
220 3136 : BREAK;
221 6732 : case 3:
222 6732 : decd_r_to_idx = DECD_Q_3;
223 6732 : move16();
224 6732 : BREAK;
225 7248 : case 5:
226 7248 : decd_r_to_idx = DECD_Q_5;
227 7248 : move16();
228 7248 : BREAK;
229 1850 : case 7:
230 1850 : decd_r_to_idx = DECD_Q_7;
231 1850 : move16();
232 1850 : BREAK;
233 1966 : case 9:
234 1966 : decd_r_to_idx = DECD_Q_9;
235 1966 : move16();
236 1966 : BREAK;
237 1952 : case 11:
238 1952 : decd_r_to_idx = DECD_Q_11;
239 1952 : move16();
240 1952 : BREAK;
241 0 : default:
242 0 : assert( !"Forbidden value for DECD quantization strategy index" );
243 : BREAK;
244 : }
245 :
246 22884 : return decd_r_to_idx;
247 : }
248 :
249 :
250 : /*---------------------------------------------------------------------------------------- - *
251 : * Function ivas_spar_arith_com_init()
252 : *
253 : * arith coder init
254 : *---------------------------------------------------------------------------------------- - */
255 :
256 34326 : static void ivas_spar_arith_com_init_fx(
257 : ivas_arith_t *pArith,
258 : const ivas_freq_models_t *pFreq_models,
259 : ivas_arith_t *pArith_diff,
260 : const Word16 q_levels,
261 : const Word16 enc_dec )
262 : {
263 : Word16 i, j;
264 : Word16 sum, log2_int, log2_frac;
265 : Word32 tmp32, log2_int32, L_tmp1, L_tmp2;
266 :
267 34326 : pArith->vals = pFreq_models->vals;
268 34326 : pArith->range = q_levels;
269 34326 : move16();
270 34326 : pArith->num_models = pFreq_models->num_models;
271 34326 : move16();
272 34326 : pArith->dyn_model_bits = ivas_get_bits_to_encode( pArith->num_models - 1 );
273 34326 : move16();
274 34326 : pArith->pFreq_model = pFreq_models->freq_model[0];
275 :
276 34326 : ivas_get_cum_freq_model_fx( pArith->pFreq_model, pArith->range, pArith->cum_freq[0] );
277 :
278 137304 : FOR( i = 0; i < pArith->num_models - 1; i++ )
279 : {
280 102978 : pArith->pAlt_freq_models[i] = pFreq_models->freq_model[i + 1];
281 102978 : ivas_get_cum_freq_model_fx( pArith->pAlt_freq_models[i], pArith->range, pArith->cum_freq[i + 1] );
282 : }
283 :
284 34326 : IF( enc_dec == ENC )
285 : {
286 17586 : sum = 0;
287 17586 : move16();
288 163666 : FOR( i = 1; i < pArith->range + 1; i++ )
289 : {
290 146080 : sum = add( sum, pArith->pFreq_model[i] );
291 : }
292 17586 : log2_int = norm_s( sum );
293 17586 : tmp32 = L_deposit_h( shl( sum, log2_int ) );
294 17586 : log2_frac = Log2_norm_lc( tmp32 );
295 17586 : log2_int32 = L_shl( sub( sub( 30, log2_int ), 16 ), 15 );
296 17586 : L_tmp2 = L_add( log2_int32, log2_frac ); /* Q15 */
297 163666 : FOR( i = 1; i < pArith->range + 1; i++ )
298 : {
299 146080 : log2_int = norm_s( pArith->pFreq_model[i] );
300 146080 : tmp32 = L_deposit_h( shl( pArith->pFreq_model[i], log2_int ) );
301 146080 : log2_frac = Log2_norm_lc( tmp32 );
302 146080 : log2_int32 = L_shl( sub( sub( 30, log2_int ), 16 ), 15 );
303 146080 : L_tmp1 = L_add( log2_int32, log2_frac ); /* Q15 */
304 146080 : pArith->saved_dist_arr[0][i - 1] = L_sub( L_tmp1, L_tmp2 );
305 146080 : move32();
306 : }
307 :
308 70344 : FOR( j = 0; j < pArith->num_models - 1; j++ )
309 : {
310 52758 : sum = 0;
311 52758 : move16();
312 490998 : FOR( i = 1; i < pArith->range + 1; i++ )
313 : {
314 438240 : sum = add( sum, pArith->pAlt_freq_models[j][i] );
315 : }
316 52758 : log2_int = norm_s( sum );
317 52758 : tmp32 = L_deposit_h( shl( sum, log2_int ) );
318 52758 : log2_frac = Log2_norm_lc( tmp32 );
319 52758 : log2_int32 = L_shl( sub( sub( 30, log2_int ), 16 ), 15 );
320 52758 : L_tmp2 = L_add( log2_int32, log2_frac ); /* Q15 */
321 490998 : FOR( i = 1; i < pArith->range + 1; i++ )
322 : {
323 438240 : log2_int = norm_s( pArith->pAlt_freq_models[j][i] );
324 438240 : tmp32 = L_deposit_h( shl( pArith->pAlt_freq_models[j][i], log2_int ) );
325 438240 : log2_frac = Log2_norm_lc( tmp32 );
326 438240 : log2_int32 = L_shl( sub( sub( 30, log2_int ), 16 ), 15 );
327 438240 : L_tmp1 = L_add( log2_int32, log2_frac ); /* Q15 */
328 438240 : pArith->saved_dist_arr[j + 1][i - 1] = L_sub( L_tmp1, L_tmp2 );
329 438240 : move32();
330 : }
331 : }
332 : }
333 :
334 34326 : pArith_diff->vals = pFreq_models->diff_vals;
335 34326 : pArith_diff->range = q_levels;
336 34326 : move16();
337 34326 : pArith_diff->num_models = pFreq_models->diff_num_models;
338 34326 : move16();
339 34326 : pArith_diff->dyn_model_bits = ivas_get_bits_to_encode( pArith_diff->num_models - 1 );
340 34326 : move16();
341 34326 : pArith_diff->pFreq_model = pFreq_models->diff_freq_model[0];
342 :
343 34326 : ivas_get_cum_freq_model_fx( pArith_diff->pFreq_model, pArith_diff->range, pArith_diff->cum_freq[0] );
344 :
345 137304 : FOR( i = 0; i < pArith_diff->num_models - 1; i++ )
346 : {
347 102978 : pArith_diff->pAlt_freq_models[i] = pFreq_models->diff_freq_model[i + 1];
348 102978 : ivas_get_cum_freq_model_fx( pArith_diff->pAlt_freq_models[i], pArith_diff->range, pArith_diff->cum_freq[i + 1] );
349 : }
350 :
351 34326 : IF( enc_dec == ENC )
352 : {
353 17586 : sum = 0;
354 17586 : move16();
355 163666 : FOR( i = 1; i < pArith_diff->range + 1; i++ )
356 : {
357 146080 : sum = add( sum, pArith_diff->pFreq_model[i] );
358 : }
359 17586 : log2_int = norm_s( sum );
360 17586 : tmp32 = L_deposit_h( shl( sum, log2_int ) );
361 17586 : log2_frac = Log2_norm_lc( tmp32 );
362 17586 : log2_int32 = L_shl( sub( sub( 30, log2_int ), 16 ), 15 );
363 17586 : L_tmp2 = L_add( log2_int32, log2_frac ); /* Q15 */
364 163666 : FOR( i = 1; i < pArith_diff->range + 1; i++ )
365 : {
366 146080 : log2_int = norm_s( pArith_diff->pFreq_model[i] );
367 146080 : tmp32 = L_deposit_h( shl( pArith_diff->pFreq_model[i], log2_int ) );
368 146080 : log2_frac = Log2_norm_lc( tmp32 );
369 146080 : log2_int32 = L_shl( sub( sub( 30, log2_int ), 16 ), 15 );
370 146080 : L_tmp1 = L_add( log2_int32, log2_frac ); /* Q15 */
371 146080 : pArith_diff->saved_dist_arr[0][i - 1] = L_sub( L_tmp1, L_tmp2 );
372 146080 : move32();
373 : }
374 :
375 70344 : FOR( j = 0; j < pArith_diff->num_models - 1; j++ )
376 : {
377 52758 : sum = 0;
378 52758 : move16();
379 490998 : FOR( i = 1; i < pArith_diff->range + 1; i++ )
380 : {
381 438240 : sum = add( sum, pArith_diff->pAlt_freq_models[j][i] );
382 : }
383 52758 : log2_int = norm_s( sum );
384 52758 : tmp32 = L_deposit_h( shl( sum, log2_int ) );
385 52758 : log2_frac = Log2_norm_lc( tmp32 );
386 52758 : log2_int32 = L_shl( sub( sub( 30, log2_int ), 16 ), 15 );
387 52758 : L_tmp2 = L_add( log2_int32, log2_frac ); /* Q15 */
388 490998 : FOR( i = 1; i < pArith_diff->range + 1; i++ )
389 : {
390 438240 : log2_int = norm_s( pArith_diff->pAlt_freq_models[j][i] );
391 438240 : tmp32 = L_deposit_h( shl( pArith_diff->pAlt_freq_models[j][i], log2_int ) );
392 438240 : log2_frac = Log2_norm_lc( tmp32 );
393 438240 : log2_int32 = L_shl( sub( sub( 30, log2_int ), 16 ), 15 );
394 438240 : L_tmp1 = L_add( log2_int32, log2_frac ); /* Q15 */
395 438240 : pArith_diff->saved_dist_arr[j + 1][i - 1] = L_sub( L_tmp1, L_tmp2 );
396 438240 : move32();
397 : }
398 : }
399 : }
400 :
401 34326 : return;
402 : }
403 :
404 :
405 : /*-----------------------------------------------------------------------------------------*
406 : * Function ivas_spar_arith_coeffs_com_init()
407 : *
408 : * Init for Arithm. coding
409 : *-----------------------------------------------------------------------------------------*/
410 :
411 3814 : void ivas_spar_arith_coeffs_com_init_fx(
412 : ivas_arith_coeffs_t *pArith_coeffs,
413 : ivas_spar_md_com_cfg *pSpar_cfg,
414 : const Word16 table_idx,
415 : const Word16 enc_dec )
416 : {
417 : Word16 i, pred_r_index, drct_r_index, decd_r_index;
418 : Word16 num_quant_points_pred_r, num_quant_points_drct_r, num_quant_points_decd_r;
419 :
420 15256 : FOR( i = 0; i < MAX_QUANT_STRATS; i++ )
421 : {
422 11442 : num_quant_points_pred_r = ivas_spar_br_table_consts[table_idx].q_lvls[i][0]; /* 0: pred_r */
423 11442 : move16();
424 11442 : pred_r_index = ivas_map_num_pred_r_to_idx_fx( num_quant_points_pred_r, ivas_spar_br_table_consts[table_idx].active_w );
425 11442 : ivas_spar_arith_com_init_fx( &pArith_coeffs->pred_arith_re[i], &ivas_arith_pred_r_consts[pred_r_index],
426 11442 : &pArith_coeffs->pred_arith_re_diff[i], pSpar_cfg->quant_strat[i].PR.q_levels[0], enc_dec );
427 :
428 11442 : num_quant_points_drct_r = ivas_spar_br_table_consts[table_idx].q_lvls[i][1]; /* 1: drct_r */
429 11442 : move16();
430 11442 : drct_r_index = ivas_map_num_drct_r_to_idx_fx( num_quant_points_drct_r );
431 11442 : ivas_spar_arith_com_init_fx( &pArith_coeffs->drct_arith_re[i], &ivas_arith_drct_r_consts[drct_r_index],
432 11442 : &pArith_coeffs->drct_arith_re_diff[i], pSpar_cfg->quant_strat[i].C.q_levels[0], enc_dec );
433 :
434 11442 : num_quant_points_decd_r = ivas_spar_br_table_consts[table_idx].q_lvls[i][2]; /* 2: decd_r */
435 11442 : move16();
436 11442 : decd_r_index = ivas_map_num_decd_r_to_idx_fx( num_quant_points_decd_r );
437 11442 : ivas_spar_arith_com_init_fx( &pArith_coeffs->decd_arith_re[i], &ivas_arith_decd_r_consts[decd_r_index],
438 11442 : &pArith_coeffs->decd_arith_re_diff[i], pSpar_cfg->quant_strat[i].P_r.q_levels[0], enc_dec );
439 : }
440 :
441 3814 : return;
442 : }
443 :
444 :
445 : /*-----------------------------------------------------------------------------------------*
446 : * Function ivas_huffman_dec_init_min_max_len()
447 : *
448 : * Find min and max length in codebook and finalize initialization of ivas_huffman_cfg_t.
449 : *-----------------------------------------------------------------------------------------*/
450 :
451 16740 : static void ivas_huffman_dec_init_min_max_len_fx(
452 : ivas_huffman_cfg_t *p_huff_cfg )
453 : {
454 : Word16 i, code_len;
455 : const Word16 *codebook;
456 :
457 16740 : codebook = p_huff_cfg->codebook;
458 :
459 16740 : p_huff_cfg->min_len = p_huff_cfg->sym_len;
460 16740 : move16();
461 16740 : p_huff_cfg->max_len = 0;
462 16740 : move16();
463 :
464 155744 : FOR( i = 0; i < p_huff_cfg->sym_len; i++ )
465 : {
466 139004 : code_len = codebook[1];
467 139004 : move16();
468 139004 : if ( GT_16( p_huff_cfg->min_len, code_len ) )
469 : {
470 28799 : p_huff_cfg->min_len = code_len;
471 28799 : move16();
472 : }
473 139004 : if ( LT_16( p_huff_cfg->max_len, code_len ) )
474 : {
475 12509 : p_huff_cfg->max_len = code_len;
476 12509 : move16();
477 : }
478 139004 : codebook = codebook + 3;
479 : }
480 :
481 16740 : return;
482 : }
483 :
484 :
485 : /*-----------------------------------------------------------------------------------------*
486 : * Function ivas_spar_huff_coeffs_com_init()
487 : *
488 : * Init for Huffman decoding
489 : *-----------------------------------------------------------------------------------------*/
490 :
491 3814 : void ivas_spar_huff_coeffs_com_init_fx(
492 : ivas_huff_coeffs_t *pHuff_coeffs,
493 : ivas_spar_md_com_cfg *pSpar_cfg,
494 : const Word16 table_idx,
495 : const Word16 enc_dec )
496 : {
497 : Word16 i, pred_r_index, drct_r_index, decd_r_index;
498 : Word16 num_quant_points_pred_r, num_quant_points_drct_r, num_quant_points_decd_r;
499 : ivas_huffman_cfg_t *p_huff_cfg;
500 :
501 15256 : FOR( i = 0; i < MAX_QUANT_STRATS; i++ )
502 : {
503 11442 : p_huff_cfg = &pHuff_coeffs->pred_huff_re[i];
504 11442 : num_quant_points_pred_r = ivas_spar_br_table_consts[table_idx].q_lvls[i][0]; /* 0: pred_r */
505 11442 : move16();
506 11442 : pred_r_index = ivas_map_num_pred_r_to_idx_fx( num_quant_points_pred_r, 0 );
507 11442 : p_huff_cfg->codebook = &ivas_huff_pred_r_consts[pred_r_index].code_book[0][0];
508 11442 : IF( EQ_16( enc_dec, DEC ) )
509 : {
510 5580 : p_huff_cfg->sym_len = pSpar_cfg->quant_strat[i].PR.q_levels[0];
511 5580 : move16();
512 5580 : ivas_huffman_dec_init_min_max_len_fx( p_huff_cfg );
513 : }
514 :
515 11442 : p_huff_cfg = &pHuff_coeffs->drct_huff_re[i];
516 11442 : num_quant_points_drct_r = ivas_spar_br_table_consts[table_idx].q_lvls[i][1]; /* 1: drct_r */
517 11442 : move16();
518 11442 : drct_r_index = ivas_map_num_drct_r_to_idx_fx( num_quant_points_drct_r );
519 11442 : p_huff_cfg->codebook = &ivas_huff_drct_r_consts[drct_r_index].code_book[0][0];
520 11442 : IF( EQ_16( enc_dec, DEC ) )
521 : {
522 5580 : p_huff_cfg->sym_len = pSpar_cfg->quant_strat[i].C.q_levels[0];
523 5580 : move16();
524 5580 : ivas_huffman_dec_init_min_max_len_fx( p_huff_cfg );
525 : }
526 :
527 11442 : p_huff_cfg = &pHuff_coeffs->decd_huff_re[i];
528 11442 : num_quant_points_decd_r = ivas_spar_br_table_consts[table_idx].q_lvls[i][2]; /* 2: decd_r */
529 11442 : move16();
530 11442 : decd_r_index = ivas_map_num_decd_r_to_idx_fx( num_quant_points_decd_r );
531 11442 : p_huff_cfg->codebook = &ivas_huff_decd_r_consts[decd_r_index].code_book[0][0];
532 11442 : IF( EQ_16( enc_dec, DEC ) )
533 : {
534 5580 : p_huff_cfg->sym_len = pSpar_cfg->quant_strat[i].P_r.q_levels[0];
535 5580 : move16();
536 5580 : ivas_huffman_dec_init_min_max_len_fx( p_huff_cfg );
537 : }
538 : }
539 :
540 3814 : return;
541 : }
|