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 465408 : 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 6802038 : FOR( i = 0; i < length; i++ )
57 : {
58 6336630 : IF( LT_16( pArr[i], min_val ) )
59 : {
60 3200 : pArr[i] = add( sub( max_val, min_val ), add( pArr[i], 1 ) );
61 3200 : move16();
62 : }
63 6336630 : IF( GT_16( pArr[i], max_val ) )
64 : {
65 1534 : pArr[i] = sub( add( min_val, pArr[i] ), add( max_val, 1 ) );
66 1534 : move16();
67 : }
68 : }
69 :
70 465408 : return;
71 : }
72 :
73 :
74 : /*-----------------------------------------------------------------------------------------*
75 : * Function ivas_get_cum_freq_model()
76 : *
77 : * get cumulative frequency model
78 : *-----------------------------------------------------------------------------------------*/
79 :
80 281520 : 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 281520 : pCum_freq_model[length] = 0;
88 281520 : move16();
89 :
90 2620608 : FOR( i = length; i > 0; i-- )
91 : {
92 2339088 : pCum_freq_model[i - 1] = add( pCum_freq_model[i], pFreq_model[i] );
93 2339088 : move16();
94 : }
95 :
96 281520 : 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 23460 : 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 23460 : Word16 pred_r_to_idx = -1;
111 23460 : move16();
112 23460 : IF( active_w_flag == 0 )
113 : {
114 19194 : SWITCH( num_quant_points_pred_r )
115 : {
116 2832 : case 1:
117 2832 : pred_r_to_idx = PRED_Q_1;
118 2832 : move16();
119 2832 : BREAK;
120 1424 : case 7:
121 1424 : pred_r_to_idx = PRED_Q_7;
122 1424 : move16();
123 1424 : BREAK;
124 5924 : case 15:
125 5924 : pred_r_to_idx = PRED_Q_15;
126 5924 : move16();
127 5924 : BREAK;
128 7598 : case 21:
129 7598 : pred_r_to_idx = PRED_Q_21;
130 7598 : move16();
131 7598 : BREAK;
132 1416 : case 31:
133 1416 : pred_r_to_idx = PRED_Q_31;
134 1416 : move16();
135 1416 : BREAK;
136 0 : default:
137 0 : assert( !"Forbidden value for prediction quantization strategy index" );
138 : BREAK;
139 : }
140 : }
141 : ELSE
142 : {
143 4266 : SWITCH( num_quant_points_pred_r )
144 : {
145 1088 : case 7:
146 1088 : pred_r_to_idx = PRED_Q_7_ACTIVE_W;
147 1088 : move16();
148 1088 : BREAK;
149 2844 : case 15:
150 2844 : pred_r_to_idx = PRED_Q_15_ACTIVE_W;
151 2844 : move16();
152 2844 : BREAK;
153 334 : case 21:
154 334 : pred_r_to_idx = PRED_Q_21_ACTIVE_W;
155 334 : move16();
156 334 : BREAK;
157 0 : default:
158 0 : assert( !"Forbidden value for prediction quantization strategy index" );
159 : BREAK;
160 : }
161 : }
162 :
163 23460 : 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 23460 : Word16 ivas_map_num_drct_r_to_idx_fx(
174 : const Word16 num_quant_points_drct_r )
175 : {
176 23460 : Word16 drct_r_to_idx = -1;
177 23460 : move16();
178 23460 : SWITCH( num_quant_points_drct_r )
179 : {
180 11744 : case 1:
181 11744 : drct_r_to_idx = DRCT_Q_1;
182 11744 : move16();
183 11744 : BREAK;
184 7216 : case 7:
185 7216 : drct_r_to_idx = DRCT_Q_7;
186 7216 : move16();
187 7216 : BREAK;
188 2020 : case 9:
189 2020 : drct_r_to_idx = DRCT_Q_9;
190 2020 : move16();
191 2020 : BREAK;
192 2480 : case 11:
193 2480 : drct_r_to_idx = DRCT_Q_11;
194 2480 : move16();
195 2480 : BREAK;
196 0 : default:
197 0 : assert( !"Forbidden value for DRCT quantization strategy index" );
198 : BREAK;
199 : }
200 23460 : 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 23460 : Word16 ivas_map_num_decd_r_to_idx_fx(
211 : const Word16 num_quant_points_decd_r )
212 : {
213 23460 : Word16 decd_r_to_idx = -1;
214 23460 : move16();
215 23460 : SWITCH( num_quant_points_decd_r )
216 : {
217 3212 : case 1:
218 3212 : decd_r_to_idx = DECD_Q_1;
219 3212 : move16();
220 3212 : BREAK;
221 6896 : case 3:
222 6896 : decd_r_to_idx = DECD_Q_3;
223 6896 : move16();
224 6896 : BREAK;
225 7408 : case 5:
226 7408 : decd_r_to_idx = DECD_Q_5;
227 7408 : move16();
228 7408 : BREAK;
229 1908 : case 7:
230 1908 : decd_r_to_idx = DECD_Q_7;
231 1908 : move16();
232 1908 : BREAK;
233 2020 : case 9:
234 2020 : decd_r_to_idx = DECD_Q_9;
235 2020 : move16();
236 2020 : BREAK;
237 2016 : case 11:
238 2016 : decd_r_to_idx = DECD_Q_11;
239 2016 : move16();
240 2016 : BREAK;
241 0 : default:
242 0 : assert( !"Forbidden value for DECD quantization strategy index" );
243 : BREAK;
244 : }
245 :
246 23460 : return decd_r_to_idx;
247 : }
248 :
249 :
250 : /*---------------------------------------------------------------------------------------- - *
251 : * Function ivas_spar_arith_com_init()
252 : *
253 : * arith coder init
254 : *---------------------------------------------------------------------------------------- - */
255 :
256 35190 : 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 35190 : pArith->vals = pFreq_models->vals;
268 35190 : pArith->range = q_levels;
269 35190 : move16();
270 35190 : pArith->num_models = pFreq_models->num_models;
271 35190 : move16();
272 35190 : pArith->dyn_model_bits = ivas_get_bits_to_encode( pArith->num_models - 1 );
273 35190 : move16();
274 35190 : pArith->pFreq_model = pFreq_models->freq_model[0];
275 :
276 35190 : ivas_get_cum_freq_model_fx( pArith->pFreq_model, pArith->range, pArith->cum_freq[0] );
277 :
278 140760 : FOR( i = 0; i < pArith->num_models - 1; i++ )
279 : {
280 105570 : pArith->pAlt_freq_models[i] = pFreq_models->freq_model[i + 1];
281 105570 : ivas_get_cum_freq_model_fx( pArith->pAlt_freq_models[i], pArith->range, pArith->cum_freq[i + 1] );
282 : }
283 :
284 35190 : IF( enc_dec == ENC )
285 : {
286 17595 : sum = 0;
287 17595 : move16();
288 163788 : FOR( i = 1; i < pArith->range + 1; i++ )
289 : {
290 146193 : sum = add( sum, pArith->pFreq_model[i] );
291 : }
292 17595 : log2_int = norm_s( sum );
293 17595 : tmp32 = L_deposit_h( shl( sum, log2_int ) );
294 17595 : log2_frac = Log2_norm_lc( tmp32 );
295 17595 : log2_int32 = L_shl( sub( sub( 30, log2_int ), 16 ), 15 );
296 17595 : L_tmp2 = L_add( log2_int32, log2_frac ); /* Q15 */
297 163788 : FOR( i = 1; i < pArith->range + 1; i++ )
298 : {
299 146193 : log2_int = norm_s( pArith->pFreq_model[i] );
300 146193 : tmp32 = L_deposit_h( shl( pArith->pFreq_model[i], log2_int ) );
301 146193 : log2_frac = Log2_norm_lc( tmp32 );
302 146193 : log2_int32 = L_shl( sub( sub( 30, log2_int ), 16 ), 15 );
303 146193 : L_tmp1 = L_add( log2_int32, log2_frac ); /* Q15 */
304 146193 : pArith->saved_dist_arr[0][i - 1] = L_sub( L_tmp1, L_tmp2 );
305 146193 : move32();
306 : }
307 :
308 70380 : FOR( j = 0; j < pArith->num_models - 1; j++ )
309 : {
310 52785 : sum = 0;
311 52785 : move16();
312 491364 : FOR( i = 1; i < pArith->range + 1; i++ )
313 : {
314 438579 : sum = add( sum, pArith->pAlt_freq_models[j][i] );
315 : }
316 52785 : log2_int = norm_s( sum );
317 52785 : tmp32 = L_deposit_h( shl( sum, log2_int ) );
318 52785 : log2_frac = Log2_norm_lc( tmp32 );
319 52785 : log2_int32 = L_shl( sub( sub( 30, log2_int ), 16 ), 15 );
320 52785 : L_tmp2 = L_add( log2_int32, log2_frac ); /* Q15 */
321 491364 : FOR( i = 1; i < pArith->range + 1; i++ )
322 : {
323 438579 : log2_int = norm_s( pArith->pAlt_freq_models[j][i] );
324 438579 : tmp32 = L_deposit_h( shl( pArith->pAlt_freq_models[j][i], log2_int ) );
325 438579 : log2_frac = Log2_norm_lc( tmp32 );
326 438579 : log2_int32 = L_shl( sub( sub( 30, log2_int ), 16 ), 15 );
327 438579 : L_tmp1 = L_add( log2_int32, log2_frac ); /* Q15 */
328 438579 : pArith->saved_dist_arr[j + 1][i - 1] = L_sub( L_tmp1, L_tmp2 );
329 438579 : move32();
330 : }
331 : }
332 : }
333 :
334 35190 : pArith_diff->vals = pFreq_models->diff_vals;
335 35190 : pArith_diff->range = q_levels;
336 35190 : move16();
337 35190 : pArith_diff->num_models = pFreq_models->diff_num_models;
338 35190 : move16();
339 35190 : pArith_diff->dyn_model_bits = ivas_get_bits_to_encode( pArith_diff->num_models - 1 );
340 35190 : move16();
341 35190 : pArith_diff->pFreq_model = pFreq_models->diff_freq_model[0];
342 :
343 35190 : ivas_get_cum_freq_model_fx( pArith_diff->pFreq_model, pArith_diff->range, pArith_diff->cum_freq[0] );
344 :
345 140760 : FOR( i = 0; i < pArith_diff->num_models - 1; i++ )
346 : {
347 105570 : pArith_diff->pAlt_freq_models[i] = pFreq_models->diff_freq_model[i + 1];
348 105570 : ivas_get_cum_freq_model_fx( pArith_diff->pAlt_freq_models[i], pArith_diff->range, pArith_diff->cum_freq[i + 1] );
349 : }
350 :
351 35190 : IF( enc_dec == ENC )
352 : {
353 17595 : sum = 0;
354 17595 : move16();
355 163788 : FOR( i = 1; i < pArith_diff->range + 1; i++ )
356 : {
357 146193 : sum = add( sum, pArith_diff->pFreq_model[i] );
358 : }
359 17595 : log2_int = norm_s( sum );
360 17595 : tmp32 = L_deposit_h( shl( sum, log2_int ) );
361 17595 : log2_frac = Log2_norm_lc( tmp32 );
362 17595 : log2_int32 = L_shl( sub( sub( 30, log2_int ), 16 ), 15 );
363 17595 : L_tmp2 = L_add( log2_int32, log2_frac ); /* Q15 */
364 163788 : FOR( i = 1; i < pArith_diff->range + 1; i++ )
365 : {
366 146193 : log2_int = norm_s( pArith_diff->pFreq_model[i] );
367 146193 : tmp32 = L_deposit_h( shl( pArith_diff->pFreq_model[i], log2_int ) );
368 146193 : log2_frac = Log2_norm_lc( tmp32 );
369 146193 : log2_int32 = L_shl( sub( sub( 30, log2_int ), 16 ), 15 );
370 146193 : L_tmp1 = L_add( log2_int32, log2_frac ); /* Q15 */
371 146193 : pArith_diff->saved_dist_arr[0][i - 1] = L_sub( L_tmp1, L_tmp2 );
372 146193 : move32();
373 : }
374 :
375 70380 : FOR( j = 0; j < pArith_diff->num_models - 1; j++ )
376 : {
377 52785 : sum = 0;
378 52785 : move16();
379 491364 : FOR( i = 1; i < pArith_diff->range + 1; i++ )
380 : {
381 438579 : sum = add( sum, pArith_diff->pAlt_freq_models[j][i] );
382 : }
383 52785 : log2_int = norm_s( sum );
384 52785 : tmp32 = L_deposit_h( shl( sum, log2_int ) );
385 52785 : log2_frac = Log2_norm_lc( tmp32 );
386 52785 : log2_int32 = L_shl( sub( sub( 30, log2_int ), 16 ), 15 );
387 52785 : L_tmp2 = L_add( log2_int32, log2_frac ); /* Q15 */
388 491364 : FOR( i = 1; i < pArith_diff->range + 1; i++ )
389 : {
390 438579 : log2_int = norm_s( pArith_diff->pAlt_freq_models[j][i] );
391 438579 : tmp32 = L_deposit_h( shl( pArith_diff->pAlt_freq_models[j][i], log2_int ) );
392 438579 : log2_frac = Log2_norm_lc( tmp32 );
393 438579 : log2_int32 = L_shl( sub( sub( 30, log2_int ), 16 ), 15 );
394 438579 : L_tmp1 = L_add( log2_int32, log2_frac ); /* Q15 */
395 438579 : pArith_diff->saved_dist_arr[j + 1][i - 1] = L_sub( L_tmp1, L_tmp2 );
396 438579 : move32();
397 : }
398 : }
399 : }
400 :
401 35190 : return;
402 : }
403 :
404 :
405 : /*-----------------------------------------------------------------------------------------*
406 : * Function ivas_spar_arith_coeffs_com_init()
407 : *
408 : * Init for Arithm. coding
409 : *-----------------------------------------------------------------------------------------*/
410 :
411 3910 : 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 15640 : FOR( i = 0; i < MAX_QUANT_STRATS; i++ )
421 : {
422 11730 : num_quant_points_pred_r = ivas_spar_br_table_consts[table_idx].q_lvls[i][0]; /* 0: pred_r */
423 11730 : move16();
424 11730 : 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 11730 : ivas_spar_arith_com_init_fx( &pArith_coeffs->pred_arith_re[i], &ivas_arith_pred_r_consts[pred_r_index],
426 11730 : &pArith_coeffs->pred_arith_re_diff[i], pSpar_cfg->quant_strat[i].PR.q_levels[0], enc_dec );
427 :
428 11730 : num_quant_points_drct_r = ivas_spar_br_table_consts[table_idx].q_lvls[i][1]; /* 1: drct_r */
429 11730 : move16();
430 11730 : drct_r_index = ivas_map_num_drct_r_to_idx_fx( num_quant_points_drct_r );
431 11730 : ivas_spar_arith_com_init_fx( &pArith_coeffs->drct_arith_re[i], &ivas_arith_drct_r_consts[drct_r_index],
432 11730 : &pArith_coeffs->drct_arith_re_diff[i], pSpar_cfg->quant_strat[i].C.q_levels[0], enc_dec );
433 :
434 11730 : num_quant_points_decd_r = ivas_spar_br_table_consts[table_idx].q_lvls[i][2]; /* 2: decd_r */
435 11730 : move16();
436 11730 : decd_r_index = ivas_map_num_decd_r_to_idx_fx( num_quant_points_decd_r );
437 11730 : ivas_spar_arith_com_init_fx( &pArith_coeffs->decd_arith_re[i], &ivas_arith_decd_r_consts[decd_r_index],
438 11730 : &pArith_coeffs->decd_arith_re_diff[i], pSpar_cfg->quant_strat[i].P_r.q_levels[0], enc_dec );
439 : }
440 :
441 3910 : 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 17595 : 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 17595 : codebook = p_huff_cfg->codebook;
458 :
459 17595 : p_huff_cfg->min_len = p_huff_cfg->sym_len;
460 17595 : move16();
461 17595 : p_huff_cfg->max_len = 0;
462 17595 : move16();
463 :
464 163788 : FOR( i = 0; i < p_huff_cfg->sym_len; i++ )
465 : {
466 146193 : code_len = codebook[1];
467 146193 : move16();
468 146193 : if ( GT_16( p_huff_cfg->min_len, code_len ) )
469 : {
470 30266 : p_huff_cfg->min_len = code_len;
471 30266 : move16();
472 : }
473 146193 : if ( LT_16( p_huff_cfg->max_len, code_len ) )
474 : {
475 13148 : p_huff_cfg->max_len = code_len;
476 13148 : move16();
477 : }
478 146193 : codebook = codebook + 3;
479 : }
480 :
481 17595 : return;
482 : }
483 :
484 :
485 : /*-----------------------------------------------------------------------------------------*
486 : * Function ivas_spar_huff_coeffs_com_init()
487 : *
488 : * Init for Huffman decoding
489 : *-----------------------------------------------------------------------------------------*/
490 :
491 3910 : 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 15640 : FOR( i = 0; i < MAX_QUANT_STRATS; i++ )
502 : {
503 11730 : p_huff_cfg = &pHuff_coeffs->pred_huff_re[i];
504 11730 : num_quant_points_pred_r = ivas_spar_br_table_consts[table_idx].q_lvls[i][0]; /* 0: pred_r */
505 11730 : move16();
506 11730 : pred_r_index = ivas_map_num_pred_r_to_idx_fx( num_quant_points_pred_r, 0 );
507 11730 : p_huff_cfg->codebook = &ivas_huff_pred_r_consts[pred_r_index].code_book[0][0];
508 11730 : IF( EQ_16( enc_dec, DEC ) )
509 : {
510 5865 : p_huff_cfg->sym_len = pSpar_cfg->quant_strat[i].PR.q_levels[0];
511 5865 : move16();
512 5865 : ivas_huffman_dec_init_min_max_len_fx( p_huff_cfg );
513 : }
514 :
515 11730 : p_huff_cfg = &pHuff_coeffs->drct_huff_re[i];
516 11730 : num_quant_points_drct_r = ivas_spar_br_table_consts[table_idx].q_lvls[i][1]; /* 1: drct_r */
517 11730 : move16();
518 11730 : drct_r_index = ivas_map_num_drct_r_to_idx_fx( num_quant_points_drct_r );
519 11730 : p_huff_cfg->codebook = &ivas_huff_drct_r_consts[drct_r_index].code_book[0][0];
520 11730 : IF( EQ_16( enc_dec, DEC ) )
521 : {
522 5865 : p_huff_cfg->sym_len = pSpar_cfg->quant_strat[i].C.q_levels[0];
523 5865 : move16();
524 5865 : ivas_huffman_dec_init_min_max_len_fx( p_huff_cfg );
525 : }
526 :
527 11730 : p_huff_cfg = &pHuff_coeffs->decd_huff_re[i];
528 11730 : num_quant_points_decd_r = ivas_spar_br_table_consts[table_idx].q_lvls[i][2]; /* 2: decd_r */
529 11730 : move16();
530 11730 : decd_r_index = ivas_map_num_decd_r_to_idx_fx( num_quant_points_decd_r );
531 11730 : p_huff_cfg->codebook = &ivas_huff_decd_r_consts[decd_r_index].code_book[0][0];
532 11730 : IF( EQ_16( enc_dec, DEC ) )
533 : {
534 5865 : p_huff_cfg->sym_len = pSpar_cfg->quant_strat[i].P_r.q_levels[0];
535 5865 : move16();
536 5865 : ivas_huffman_dec_init_min_max_len_fx( p_huff_cfg );
537 : }
538 : }
539 :
540 3910 : return;
541 : }
|