diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 8870a16a389de9ea609ad61d03ff1f40ef4e2074..3a37fc2318796191020cc8a260493ac783dc6b42 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -3156,13 +3156,13 @@ static int16_t ivas_decode_masaism_metadata( /* Read MASA-to-total energy ratios */ #ifdef IVAS_FLOAT_FIXED - Word16 q = 18; + Word16 q = 25; ivas_omasa_decode_masa_to_total_fx( bit_stream, next_bit_pos, hMasaIsmData->masa_to_total_energy_ratio_fx, nbands, nblocks, &q ); - FOR( int k = 0; k < nblocks; k++ ) + FOR( int k = 0; k < (nblocks != 1 ? nblocks : MAX_PARAM_SPATIAL_SUBFRAMES); k++ ) { - FOR( int j = 0; j < nbands; j++ ) + FOR( int j = 0; j < (nbands != 1 ? nbands : MASA_FREQUENCY_BANDS); j++ ) { hMasaIsmData->masa_to_total_energy_ratio[k][j] = (float) hMasaIsmData->masa_to_total_energy_ratio_fx[k][j] / (float) ( 1 << q ); } diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index 23c701e6aff901ecdfd4b2d0581de73d53f7c52d..dc627ef74ad71945c7e4bfb3d7f4130c653d2dfc 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -7915,16 +7915,16 @@ static void read_stream_dct_coeffs_omasa_fx( } /* deindex */ - q_dct_data_fx[0] = L_shl( Mpy_32_16_1( step, q_idx[0] ), 2 ); // q = 18 + q_dct_data_fx[0] = L_shl( Mpy_32_16_1( step, shl( q_idx[0], 7) ), 2 ); // q = 25 FOR( i = 1; i < len_stream; i++ ) { IF( ( q_idx[i] % 2 ) == 0 ) { - q_dct_data_fx[i] = L_shl( Mpy_32_16_1( step, negate( shr( q_idx[i], 1 ) ) ), 2 ); + q_dct_data_fx[i] = L_shl( Mpy_32_16_1( step, negate( shl( q_idx[i], 6 ) ) ), 2 ); } ELSE { - q_dct_data_fx[i] = L_shl( Mpy_32_16_1( step, shr( q_idx[i] + 1, 1 ) ), 2 ); + q_dct_data_fx[i] = L_shl( Mpy_32_16_1( step, shl( q_idx[i] + 1, 6 ) ), 2 ); } } @@ -8046,8 +8046,8 @@ void ivas_omasa_decode_masa_to_total_fx( { Word16 i, j, k; Word16 q_idx[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; - Word32 q_dct_data_fx[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS], // q = 18 - dct_data_tmp_fx[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; // q = 18 + Word32 q_dct_data_fx[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS], // q = 25 + dct_data_tmp_fx[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; // q = 25 Word16 n_streams, len_stream; /* Setup coding parameters */ @@ -8101,7 +8101,7 @@ void ivas_omasa_decode_masa_to_total_fx( { FOR( j = 0; j < nbands; j++ ) { - masa_to_total_energy_ratio_fx[i][j] = L_max( 0, L_shl( q_dct_data_fx[k], *q - 18 ) ); + masa_to_total_energy_ratio_fx[i][j] = L_max( 0, L_shl( q_dct_data_fx[k], *q - 25 ) ); masa_to_total_energy_ratio_fx[i][j] = L_min( 1 << *q, masa_to_total_energy_ratio_fx[i][j] ); k++; }