Loading lib_com/ivas_rom_com_fx.c +2 −2 Original line number Diff line number Diff line Loading @@ -4409,12 +4409,12 @@ const Word32 azimuth_cb_fx[8] = { 0, -754974720, -377487360, 377487360, -188743680, 188743680, -566231040, 566231040 }; // Q22 /* Q22 */ const Word32 delta_theta_masa_fx[NO_SPHERICAL_GRIDS - 2] = { 188743680, 188743680, 150994944, 106954752, 83886080, 62914560, 45214596, 28101836, 20971520 }; // Q31 /* Q31 */ const Word32 delta_theta_masa_inv_fx[NO_SPHERICAL_GRIDS - 2] = { 47721859, 47721859, 59652324, 84215045, 107374182, 143165577, 199209986, 320519947, 429496730 }; Loading lib_com/mslvq_com_fx.c +125 −83 Original line number Diff line number Diff line Loading @@ -215,7 +215,27 @@ static void make_offset_scale_fx( return; } #ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES /* To do: make_offset_scale functions needs to be unified */ static void make_offset_scale( const Word32 tab_no_cv[], const Word8 *no_ld, const Word16 no_scl, UWord32 *offset_scale ) { Word16 i; offset_scale[0] = 1; move32(); FOR( i = 1; i <= no_scl; i++ ) { offset_scale[i] = UL_addNsD( offset_scale[i - 1], tab_no_cv[(Word16) no_ld[i - 1]] ); move32(); } return; } #else static void make_offset_scale( const UWord32 tab_no_cv[], const Word8 *no_ld, Loading @@ -234,7 +254,7 @@ static void make_offset_scale( return; } #endif void init_offset_fx( Word32 offset_scale1[][MAX_NO_SCALES + 1], /* o : lattice truncation index offset for the first LSF subvector - safety net structures*/ Loading Loading @@ -335,8 +355,10 @@ Word16 decode_indexes_fx( /* Safety check for bit errors (common) */ FOR (i = 0; i < 3; i++) { IF (index[i] < 0 ) { FOR( i = 0; i < 3; i++ ) { IF( index[i] < 0 ) { set16_fx( x_lvq, 0, shl( LATTICE_DIM, 1 ) ); scales_mslvq[0] = 0; move16(); Loading Loading @@ -413,7 +435,8 @@ Word16 decode_indexes_fx( } /* Second subvector (common structure, offset logic differs) */ IF (index2 == 0) { IF( index2 == 0 ) { FOR( i = LATTICE_DIM; i < shl( LATTICE_DIM, 1 ); i++ ) { x_lvq[i] = 0; Loading @@ -438,14 +461,19 @@ Word16 decode_indexes_fx( /* Find leader (common) */ i = 1; move16(); IF (use_ivas_mode) { WHILE (GE_32(index2, (Word32)table_no_cv[i])) { IF( use_ivas_mode ) { WHILE( GE_32( index2, (Word32) table_no_cv_fx[i] ) ) { i++; } decode_comb_fx((Word32)(index2 - table_no_cv[i - 1]), &x_lvq[LATTICE_DIM], i - 1); decode_comb_fx( (Word32) ( index2 - table_no_cv_fx[i - 1] ), &x_lvq[LATTICE_DIM], i - 1 ); scales_mslvq[1] = p_scales[mode_glb * len_scales + MAX_NO_SCALES + idx_scale]; } ELSE { WHILE (GE_32(index2, table_no_cv_fx[i])) { } ELSE { WHILE( GE_32( index2, table_no_cv_fx[i] ) ) { i = add( i, 1 ); } im1 = sub( i, 1 ); Loading Loading @@ -913,7 +941,8 @@ Word16 deindex_lvq_ivas_fx( ber_flag = decode_indexes_fx( index, no_bits, p_scales, NULL, NULL, NULL, x_lvq, mode_glb, scales_mslvq, 1, 1 - sf_flag); /* use_ivas_mode=1 */ /* x_lvq is here Q1 */ 1, 1 - sf_flag ); /* use_ivas_mode=1 */ /* x_lvq is here Q1 */ #else ber_flag = decode_indexes_ivas_fx( index, no_bits, p_scales, 1 - sf_flag, x_lvq, mode_glb, scales_mslvq ); /* x_lvq is here Q1 */ #endif Loading Loading @@ -1519,8 +1548,9 @@ void create_offset( { tmp += DELTA_LEADER; } make_offset_scale( table_no_cv, leaders_short[tmp], MAX_NO_SCALES, offset_scale1 ); make_offset_scale( table_no_cv, leaders_short[no_lead_idx[mode][1]], MAX_NO_SCALES, offset_scale2 ); make_offset_scale( table_no_cv_fx, leaders_short[tmp], MAX_NO_SCALES, offset_scale1 ); make_offset_scale( table_no_cv_fx, leaders_short[no_lead_idx[mode][1]], MAX_NO_SCALES, offset_scale2 ); } else { Loading @@ -1537,8 +1567,8 @@ void create_offset( tmp1 = DELTA_LEADER; } make_offset_scale( table_no_cv, leaders_short[tmp], MAX_NO_SCALES, offset_scale1 ); make_offset_scale( table_no_cv, leaders_short[tmp1], MAX_NO_SCALES, offset_scale2 ); make_offset_scale( table_no_cv_fx, leaders_short[tmp], MAX_NO_SCALES, offset_scale1 ); make_offset_scale( table_no_cv_fx, leaders_short[tmp1], MAX_NO_SCALES, offset_scale2 ); } return; Loading Loading @@ -1632,7 +1662,11 @@ void deindex_lvq_SHB_fx( move32(); FOR( i = 0; i < MAX_NO_SCALES; i++ ) { #ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES offsets[i + 1] = UL_addNsD( table_no_cv_fx[p_no_lead[i]], offsets[i] ); #else offsets[i + 1] = UL_addNsD( table_no_cv[p_no_lead[i]], offsets[i] ); #endif move32(); } Loading @@ -1650,13 +1684,21 @@ void deindex_lvq_SHB_fx( /* find idx_leader */ i = 1; move16(); #ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES WHILE( GT_32( index, table_no_cv_fx[i] ) ) #else WHILE( GT_32( index, table_no_cv[i] ) ) #endif { i = add( i, 1 ); } i = sub( i, 1 ); #ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES decode_comb_fx( (Word32) ( L_sub( L_sub( index, table_no_cv_fx[i] ), 1 ) ), out, i ); #else decode_comb_fx( (Word32) ( L_sub( L_sub( index, table_no_cv[i] ), 1 ) ), out, i ); #endif scale = p_scales[idx_scale]; move16(); Loading lib_com/rom_com.h +2 −1 Original line number Diff line number Diff line Loading @@ -428,8 +428,9 @@ extern const Word16 pl_HQ_fx[]; // Q1 extern const Word16 pi0[]; // Q0 // extern const Word16 pi0_fx[]; #ifndef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES extern const UWord32 table_no_cv[]; // Q0 #endif extern const Word32 table_no_cv_fx[]; // Q0 extern const Word16 pl_par[]; // Q0 Loading lib_com/rom_com_fx.c +2 −0 Original line number Diff line number Diff line Loading @@ -12595,6 +12595,7 @@ const Word16 C_VQ_fx[LATTICE_DIM + 1][LATTICE_DIM + 1] = {1,8,28,56,70,56,28,8,1} }; // Q0 #ifndef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES const UWord32 table_no_cv[] = //Q0 { 0, 112, 240, 1360, 1376, 2400, 4192, 5536, 9120, 9376, 18336, 18448, 25616, 26640, 33808, 40528, 40752, Loading @@ -12602,6 +12603,7 @@ const UWord32 table_no_cv[] = //Q0 238928, 274768, 274784, 275808, 311648, 333152, 340320, 367200, 410208, 423648, 423760, 425104, 425232, 446736, 500496, 522000, 0 }; //Q0 #endif const Word32 table_no_cv_fx[] = { 0, 112, 240, 1360, 1376, 2400, 4192, 5536, 9120, 9376, 18336, 18448, 25616, 26640, 33808, 40528, 40752, 49712, 56880, 83760, 84208, 88688, 95856, 117360, 124528, 142448, 153200, 155888, 159472, 195312, 198896, 199920, 235760, 236880, 238928, 274768, 274784, 275808, 311648, 333152, 340320, 367200, 410208, 423648,423760, 425104, 425232, 446736, 500496, 522000 lib_enc/mslvq_enc_fx.c +8 −0 Original line number Diff line number Diff line Loading @@ -1321,13 +1321,21 @@ UWord32 index_lvq_SHB_fx( move32(); FOR( i = 0; i < idx_scale; i++ ) { #ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES index = index + table_no_cv_fx[p_no_lead[i]]; #else index = index + table_no_cv[p_no_lead[i]]; #endif move32(); } IF( idx_lead > 0 ) { #ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES index = index + table_no_cv_fx[idx_lead]; #else index = index + table_no_cv[idx_lead]; #endif move32(); } Loading Loading
lib_com/ivas_rom_com_fx.c +2 −2 Original line number Diff line number Diff line Loading @@ -4409,12 +4409,12 @@ const Word32 azimuth_cb_fx[8] = { 0, -754974720, -377487360, 377487360, -188743680, 188743680, -566231040, 566231040 }; // Q22 /* Q22 */ const Word32 delta_theta_masa_fx[NO_SPHERICAL_GRIDS - 2] = { 188743680, 188743680, 150994944, 106954752, 83886080, 62914560, 45214596, 28101836, 20971520 }; // Q31 /* Q31 */ const Word32 delta_theta_masa_inv_fx[NO_SPHERICAL_GRIDS - 2] = { 47721859, 47721859, 59652324, 84215045, 107374182, 143165577, 199209986, 320519947, 429496730 }; Loading
lib_com/mslvq_com_fx.c +125 −83 Original line number Diff line number Diff line Loading @@ -215,7 +215,27 @@ static void make_offset_scale_fx( return; } #ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES /* To do: make_offset_scale functions needs to be unified */ static void make_offset_scale( const Word32 tab_no_cv[], const Word8 *no_ld, const Word16 no_scl, UWord32 *offset_scale ) { Word16 i; offset_scale[0] = 1; move32(); FOR( i = 1; i <= no_scl; i++ ) { offset_scale[i] = UL_addNsD( offset_scale[i - 1], tab_no_cv[(Word16) no_ld[i - 1]] ); move32(); } return; } #else static void make_offset_scale( const UWord32 tab_no_cv[], const Word8 *no_ld, Loading @@ -234,7 +254,7 @@ static void make_offset_scale( return; } #endif void init_offset_fx( Word32 offset_scale1[][MAX_NO_SCALES + 1], /* o : lattice truncation index offset for the first LSF subvector - safety net structures*/ Loading Loading @@ -335,8 +355,10 @@ Word16 decode_indexes_fx( /* Safety check for bit errors (common) */ FOR (i = 0; i < 3; i++) { IF (index[i] < 0 ) { FOR( i = 0; i < 3; i++ ) { IF( index[i] < 0 ) { set16_fx( x_lvq, 0, shl( LATTICE_DIM, 1 ) ); scales_mslvq[0] = 0; move16(); Loading Loading @@ -413,7 +435,8 @@ Word16 decode_indexes_fx( } /* Second subvector (common structure, offset logic differs) */ IF (index2 == 0) { IF( index2 == 0 ) { FOR( i = LATTICE_DIM; i < shl( LATTICE_DIM, 1 ); i++ ) { x_lvq[i] = 0; Loading @@ -438,14 +461,19 @@ Word16 decode_indexes_fx( /* Find leader (common) */ i = 1; move16(); IF (use_ivas_mode) { WHILE (GE_32(index2, (Word32)table_no_cv[i])) { IF( use_ivas_mode ) { WHILE( GE_32( index2, (Word32) table_no_cv_fx[i] ) ) { i++; } decode_comb_fx((Word32)(index2 - table_no_cv[i - 1]), &x_lvq[LATTICE_DIM], i - 1); decode_comb_fx( (Word32) ( index2 - table_no_cv_fx[i - 1] ), &x_lvq[LATTICE_DIM], i - 1 ); scales_mslvq[1] = p_scales[mode_glb * len_scales + MAX_NO_SCALES + idx_scale]; } ELSE { WHILE (GE_32(index2, table_no_cv_fx[i])) { } ELSE { WHILE( GE_32( index2, table_no_cv_fx[i] ) ) { i = add( i, 1 ); } im1 = sub( i, 1 ); Loading Loading @@ -913,7 +941,8 @@ Word16 deindex_lvq_ivas_fx( ber_flag = decode_indexes_fx( index, no_bits, p_scales, NULL, NULL, NULL, x_lvq, mode_glb, scales_mslvq, 1, 1 - sf_flag); /* use_ivas_mode=1 */ /* x_lvq is here Q1 */ 1, 1 - sf_flag ); /* use_ivas_mode=1 */ /* x_lvq is here Q1 */ #else ber_flag = decode_indexes_ivas_fx( index, no_bits, p_scales, 1 - sf_flag, x_lvq, mode_glb, scales_mslvq ); /* x_lvq is here Q1 */ #endif Loading Loading @@ -1519,8 +1548,9 @@ void create_offset( { tmp += DELTA_LEADER; } make_offset_scale( table_no_cv, leaders_short[tmp], MAX_NO_SCALES, offset_scale1 ); make_offset_scale( table_no_cv, leaders_short[no_lead_idx[mode][1]], MAX_NO_SCALES, offset_scale2 ); make_offset_scale( table_no_cv_fx, leaders_short[tmp], MAX_NO_SCALES, offset_scale1 ); make_offset_scale( table_no_cv_fx, leaders_short[no_lead_idx[mode][1]], MAX_NO_SCALES, offset_scale2 ); } else { Loading @@ -1537,8 +1567,8 @@ void create_offset( tmp1 = DELTA_LEADER; } make_offset_scale( table_no_cv, leaders_short[tmp], MAX_NO_SCALES, offset_scale1 ); make_offset_scale( table_no_cv, leaders_short[tmp1], MAX_NO_SCALES, offset_scale2 ); make_offset_scale( table_no_cv_fx, leaders_short[tmp], MAX_NO_SCALES, offset_scale1 ); make_offset_scale( table_no_cv_fx, leaders_short[tmp1], MAX_NO_SCALES, offset_scale2 ); } return; Loading Loading @@ -1632,7 +1662,11 @@ void deindex_lvq_SHB_fx( move32(); FOR( i = 0; i < MAX_NO_SCALES; i++ ) { #ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES offsets[i + 1] = UL_addNsD( table_no_cv_fx[p_no_lead[i]], offsets[i] ); #else offsets[i + 1] = UL_addNsD( table_no_cv[p_no_lead[i]], offsets[i] ); #endif move32(); } Loading @@ -1650,13 +1684,21 @@ void deindex_lvq_SHB_fx( /* find idx_leader */ i = 1; move16(); #ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES WHILE( GT_32( index, table_no_cv_fx[i] ) ) #else WHILE( GT_32( index, table_no_cv[i] ) ) #endif { i = add( i, 1 ); } i = sub( i, 1 ); #ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES decode_comb_fx( (Word32) ( L_sub( L_sub( index, table_no_cv_fx[i] ), 1 ) ), out, i ); #else decode_comb_fx( (Word32) ( L_sub( L_sub( index, table_no_cv[i] ), 1 ) ), out, i ); #endif scale = p_scales[idx_scale]; move16(); Loading
lib_com/rom_com.h +2 −1 Original line number Diff line number Diff line Loading @@ -428,8 +428,9 @@ extern const Word16 pl_HQ_fx[]; // Q1 extern const Word16 pi0[]; // Q0 // extern const Word16 pi0_fx[]; #ifndef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES extern const UWord32 table_no_cv[]; // Q0 #endif extern const Word32 table_no_cv_fx[]; // Q0 extern const Word16 pl_par[]; // Q0 Loading
lib_com/rom_com_fx.c +2 −0 Original line number Diff line number Diff line Loading @@ -12595,6 +12595,7 @@ const Word16 C_VQ_fx[LATTICE_DIM + 1][LATTICE_DIM + 1] = {1,8,28,56,70,56,28,8,1} }; // Q0 #ifndef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES const UWord32 table_no_cv[] = //Q0 { 0, 112, 240, 1360, 1376, 2400, 4192, 5536, 9120, 9376, 18336, 18448, 25616, 26640, 33808, 40528, 40752, Loading @@ -12602,6 +12603,7 @@ const UWord32 table_no_cv[] = //Q0 238928, 274768, 274784, 275808, 311648, 333152, 340320, 367200, 410208, 423648, 423760, 425104, 425232, 446736, 500496, 522000, 0 }; //Q0 #endif const Word32 table_no_cv_fx[] = { 0, 112, 240, 1360, 1376, 2400, 4192, 5536, 9120, 9376, 18336, 18448, 25616, 26640, 33808, 40528, 40752, 49712, 56880, 83760, 84208, 88688, 95856, 117360, 124528, 142448, 153200, 155888, 159472, 195312, 198896, 199920, 235760, 236880, 238928, 274768, 274784, 275808, 311648, 333152, 340320, 367200, 410208, 423648,423760, 425104, 425232, 446736, 500496, 522000
lib_enc/mslvq_enc_fx.c +8 −0 Original line number Diff line number Diff line Loading @@ -1321,13 +1321,21 @@ UWord32 index_lvq_SHB_fx( move32(); FOR( i = 0; i < idx_scale; i++ ) { #ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES index = index + table_no_cv_fx[p_no_lead[i]]; #else index = index + table_no_cv[p_no_lead[i]]; #endif move32(); } IF( idx_lead > 0 ) { #ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES index = index + table_no_cv_fx[idx_lead]; #else index = index + table_no_cv[idx_lead]; #endif move32(); } Loading