Loading lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ #define FIX_625_IDX_OOB /* FhG: Fix index out-of-bounds UBSAN error (issue 625) */ #define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ #define FIX_WB_OMASA /* Nokia: fixes OMASA for WB input */ /* ################## End BE DEVELOPMENT switches ######################### */ Loading lib_enc/ivas_masa_enc.c +49 −4 Original line number Diff line number Diff line Loading @@ -3522,15 +3522,23 @@ static void ivas_encode_masaism_metadata( int16_t tmp, rotate; int16_t n_ism_tmp, i; OMASA_ENCODER_DATA_HANDLE hOmasaData = hMasa->data.hOmasaData; #ifdef FIX_WB_OMASA int16_t nbands_work; #endif /* use the values from hQMetaData */ numCodingBands = (uint8_t) hQMetaData->q_direction->cfg.nbands; numSf = (int8_t) hQMetaData->q_direction->cfg.nblocks; #ifdef FIX_WB_OMASA nbands_work = min( numCodingBands, omasa_nbands ); if ( numCodingBands == 1 ) #else if ( numCodingBands != omasa_nbands ) #endif { #ifndef FIX_WB_OMASA assert( numCodingBands == 1 ); #endif for ( sf = 0; sf < numSf; sf++ ) { if ( sum_f( hOmasaData->energy_ism[sf], omasa_nbands ) == 0.0f ) Loading Loading @@ -3570,11 +3578,20 @@ static void ivas_encode_masaism_metadata( } } } #ifdef FIX_WB_OMASA else if (numSf == 1) #else else if ( numSf != omasa_nblocks ) #endif { #ifndef FIX_WB_OMASA assert( numSf == 1 ); #endif #ifdef FIX_WB_OMASA for ( band = 0; band < nbands_work; band++ ) #else for ( band = 0; band < numCodingBands; band++ ) #endif { energy_ism = 0.0f; /* ISM energy for current subband */ for ( obj = 0; obj < nchan_ism; obj++ ) Loading Loading @@ -3614,12 +3631,28 @@ static void ivas_encode_masaism_metadata( hQMetaData->masa_to_total_energy_ratio[0][band] = eneBand / ( eneBand + energy_ism + EPSILON ); } } #ifdef FIX_WB_OMASA for ( band = nbands_work; band < numCodingBands; band++ ) { hQMetaData->masa_to_total_energy_ratio[0][band] = 1.0f; for ( obj = 0; obj < nchan_ism; obj++ ) { hOmasaData->energy_ratio_ism[0][band][obj] = hOmasaData->energy_ratio_ism[0][nbands_work-1][obj]; } } #endif } else { for ( sf = 0; sf < numSf; sf++ ) { #ifdef FIX_WB_OMASA for ( band = 0; band < nbands_work; band++ ) #else for ( band = 0; band < numCodingBands; band++ ) #endif { if ( hOmasaData->energy_ism[sf][band] == 0.0f ) { Loading @@ -3638,6 +3671,18 @@ static void ivas_encode_masaism_metadata( hQMetaData->masa_to_total_energy_ratio[sf][band] = eneBand / ( eneBand + hOmasaData->energy_ism[sf][band] + EPSILON ); } } #ifdef FIX_WB_OMASA for ( band = nbands_work; band < numCodingBands; band++ ) { hQMetaData->masa_to_total_energy_ratio[sf][band] = 1.0f; for ( obj = 0; obj < nchan_ism; obj++ ) { hOmasaData->energy_ratio_ism[sf][band][obj] = hOmasaData->energy_ratio_ism[sf][nbands_work-1][obj]; } } #endif } } Loading @@ -3664,7 +3709,6 @@ static void ivas_encode_masaism_metadata( /* Quantize ISM ratios */ quantize_ratio_ism_vector( ratio_ism[band], ratio_ism_idx[band], nchan_ism, hQMetaData->masa_to_total_energy_ratio[sf][band], idx_separated_object ); if ( n_ism_tmp == numCodingBands && ratio_ism_idx[band][idx_separated_object] != 0 && hQMetaData->masa_to_total_energy_ratio[sf][band] < MASA2TOTAL_THR ) { i = 0; Loading @@ -3691,6 +3735,7 @@ static void ivas_encode_masaism_metadata( { /* rotate components */ rotate = 1; for ( band = 0; band < numCodingBands; band++ ) { if ( hQMetaData->masa_to_total_energy_ratio[sf][band] < MASA2TOTAL_THR ) Loading lib_enc/ivas_qmetadata_enc.c +2 −1 Original line number Diff line number Diff line Loading @@ -6405,7 +6405,8 @@ void ivas_omasa_encode_masa_to_total( BSTR_ENC_HANDLE hMetaData, const int16_t low_bitrate_mode, const int16_t nbands, const int16_t nblocks ) const int16_t nblocks ) { int16_t i, j, k; float data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; Loading Loading
lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ #define FIX_625_IDX_OOB /* FhG: Fix index out-of-bounds UBSAN error (issue 625) */ #define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ #define FIX_WB_OMASA /* Nokia: fixes OMASA for WB input */ /* ################## End BE DEVELOPMENT switches ######################### */ Loading
lib_enc/ivas_masa_enc.c +49 −4 Original line number Diff line number Diff line Loading @@ -3522,15 +3522,23 @@ static void ivas_encode_masaism_metadata( int16_t tmp, rotate; int16_t n_ism_tmp, i; OMASA_ENCODER_DATA_HANDLE hOmasaData = hMasa->data.hOmasaData; #ifdef FIX_WB_OMASA int16_t nbands_work; #endif /* use the values from hQMetaData */ numCodingBands = (uint8_t) hQMetaData->q_direction->cfg.nbands; numSf = (int8_t) hQMetaData->q_direction->cfg.nblocks; #ifdef FIX_WB_OMASA nbands_work = min( numCodingBands, omasa_nbands ); if ( numCodingBands == 1 ) #else if ( numCodingBands != omasa_nbands ) #endif { #ifndef FIX_WB_OMASA assert( numCodingBands == 1 ); #endif for ( sf = 0; sf < numSf; sf++ ) { if ( sum_f( hOmasaData->energy_ism[sf], omasa_nbands ) == 0.0f ) Loading Loading @@ -3570,11 +3578,20 @@ static void ivas_encode_masaism_metadata( } } } #ifdef FIX_WB_OMASA else if (numSf == 1) #else else if ( numSf != omasa_nblocks ) #endif { #ifndef FIX_WB_OMASA assert( numSf == 1 ); #endif #ifdef FIX_WB_OMASA for ( band = 0; band < nbands_work; band++ ) #else for ( band = 0; band < numCodingBands; band++ ) #endif { energy_ism = 0.0f; /* ISM energy for current subband */ for ( obj = 0; obj < nchan_ism; obj++ ) Loading Loading @@ -3614,12 +3631,28 @@ static void ivas_encode_masaism_metadata( hQMetaData->masa_to_total_energy_ratio[0][band] = eneBand / ( eneBand + energy_ism + EPSILON ); } } #ifdef FIX_WB_OMASA for ( band = nbands_work; band < numCodingBands; band++ ) { hQMetaData->masa_to_total_energy_ratio[0][band] = 1.0f; for ( obj = 0; obj < nchan_ism; obj++ ) { hOmasaData->energy_ratio_ism[0][band][obj] = hOmasaData->energy_ratio_ism[0][nbands_work-1][obj]; } } #endif } else { for ( sf = 0; sf < numSf; sf++ ) { #ifdef FIX_WB_OMASA for ( band = 0; band < nbands_work; band++ ) #else for ( band = 0; band < numCodingBands; band++ ) #endif { if ( hOmasaData->energy_ism[sf][band] == 0.0f ) { Loading @@ -3638,6 +3671,18 @@ static void ivas_encode_masaism_metadata( hQMetaData->masa_to_total_energy_ratio[sf][band] = eneBand / ( eneBand + hOmasaData->energy_ism[sf][band] + EPSILON ); } } #ifdef FIX_WB_OMASA for ( band = nbands_work; band < numCodingBands; band++ ) { hQMetaData->masa_to_total_energy_ratio[sf][band] = 1.0f; for ( obj = 0; obj < nchan_ism; obj++ ) { hOmasaData->energy_ratio_ism[sf][band][obj] = hOmasaData->energy_ratio_ism[sf][nbands_work-1][obj]; } } #endif } } Loading @@ -3664,7 +3709,6 @@ static void ivas_encode_masaism_metadata( /* Quantize ISM ratios */ quantize_ratio_ism_vector( ratio_ism[band], ratio_ism_idx[band], nchan_ism, hQMetaData->masa_to_total_energy_ratio[sf][band], idx_separated_object ); if ( n_ism_tmp == numCodingBands && ratio_ism_idx[band][idx_separated_object] != 0 && hQMetaData->masa_to_total_energy_ratio[sf][band] < MASA2TOTAL_THR ) { i = 0; Loading @@ -3691,6 +3735,7 @@ static void ivas_encode_masaism_metadata( { /* rotate components */ rotate = 1; for ( band = 0; band < numCodingBands; band++ ) { if ( hQMetaData->masa_to_total_energy_ratio[sf][band] < MASA2TOTAL_THR ) Loading
lib_enc/ivas_qmetadata_enc.c +2 −1 Original line number Diff line number Diff line Loading @@ -6405,7 +6405,8 @@ void ivas_omasa_encode_masa_to_total( BSTR_ENC_HANDLE hMetaData, const int16_t low_bitrate_mode, const int16_t nbands, const int16_t nblocks ) const int16_t nblocks ) { int16_t i, j, k; float data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; Loading