Loading apps/decoder.c +7 −0 Original line number Diff line number Diff line Loading @@ -2891,6 +2891,13 @@ cleanup: #ifdef SUPPORT_JBM_TRACEFILE JbmTraceFileWriter_close( &jbmTraceWriter ); #endif #ifdef FIX_683_JBM_CLEANUP MasaFileWriter_close( &masaWriter ); for ( int16_t i = 0; i < IVAS_MAX_NUM_OBJECTS; i++ ) { IsmFileWriter_close( &ismWriters[i] ); } #endif if ( decodingFailed && error == IVAS_ERR_OK ) { Loading lib_com/bits_alloc.c +44 −17 Original line number Diff line number Diff line Loading @@ -394,6 +394,9 @@ static ivas_error acelp_FCB_allocator( int16_t nBits_tmp; int16_t *p_fixed_cdk_index; ivas_error error; #ifdef FIX_680_ACELP_TABLE_OMASA int16_t max_n; #endif error = IVAS_ERR_OK; Loading Loading @@ -424,13 +427,31 @@ static ivas_error acelp_FCB_allocator( } /* distribute the bit-budget equally between subframes */ #ifdef FIX_680_ACELP_TABLE_OMASA if ( L_subfr > L_SUBFR ) /* access fast_FCB_bits_2sfr */ { max_n = 6; } else { max_n = ACELP_FIXED_CDK_NB; } for ( cdbk = 0; cdbk < max_n; cdbk++ ) { if ( fcb_table( cdbk, L_subfr ) * nb_subfr > *nBits ) { break; } } cdbk--; #else cdbk = 0; while ( fcb_table( cdbk, L_subfr ) * nb_subfr <= *nBits ) { cdbk++; } cdbk--; #endif #ifdef DEBUGGING if ( cdbk < 0 && coder_type != TRANSITION ) { Loading @@ -455,6 +476,10 @@ static ivas_error acelp_FCB_allocator( *nBits -= nBits_tmp * nb_subfr; /* try to increase the FCB bit-budget of the first subframe(s) */ #ifdef FIX_680_ACELP_TABLE_OMASA if ( cdbk < ACELP_FIXED_CDK_NB - 1 ) { #endif step = fcb_table( cdbk + 1, L_subfr ) - nBits_tmp; while ( *nBits >= step ) { Loading @@ -477,7 +502,9 @@ static ivas_error acelp_FCB_allocator( *nBits -= step; } } #ifdef FIX_680_ACELP_TABLE_OMASA } #endif /* TRANSITION coding: allocate highest FCBQ bit-budget to the subframe with the glottal-shape codebook */ if ( tc_subfr >= L_SUBFR ) { Loading lib_com/ivas_cnst.h +2 −2 Original line number Diff line number Diff line Loading @@ -119,8 +119,8 @@ typedef enum AUDIO_CONFIG_ISM2, /* ISM2 */ AUDIO_CONFIG_ISM3, /* ISM3 */ AUDIO_CONFIG_ISM4, /* ISM4 */ AUDIO_CONFIG_MASA1, /* MASA1 */ // TODO: seems not to be used AUDIO_CONFIG_MASA2, /* MASA2 */ // TODO: seems not to be used AUDIO_CONFIG_MASA1, /* MASA1 */ AUDIO_CONFIG_MASA2, /* MASA2 */ AUDIO_CONFIG_EXTERNAL /* external renderer */ } AUDIO_CONFIG; Loading lib_com/ivas_masa_com.c +8 −0 Original line number Diff line number Diff line Loading @@ -897,6 +897,10 @@ void reconstruct_ism_ratios( void ivas_omasa_modify_masa_energy_ratios( IVAS_QMETADATA_HANDLE hQMetaData /* i/o: q_metadata handle */ #ifdef FIX_672_NOKIA_TODO , float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_MAXIMUM_CODING_SUBBANDS] #endif ) { int16_t i, m, d, b; Loading @@ -916,7 +920,11 @@ void ivas_omasa_modify_masa_energy_ratios( { for ( d = 0; d < hQMetaData->no_directions; d++ ) { #ifdef FIX_672_NOKIA_TODO hQMetaData->q_direction[d].band_data[b].energy_ratio[m] = hQMetaData->q_direction[d].band_data[b].energy_ratio[m] * masa_to_total_energy_ratio[i][b]; #else hQMetaData->q_direction[d].band_data[b].energy_ratio[m] = hQMetaData->q_direction[d].band_data[b].energy_ratio[m] * hQMetaData->masa_to_total_energy_ratio[i][b]; #endif } } } Loading lib_com/ivas_prot.h +8 −0 Original line number Diff line number Diff line Loading @@ -5991,7 +5991,11 @@ void ivas_omasa_set_edited_objects( ); #endif void ivas_omasa_encode_masa_to_total( #ifdef FIX_672_NOKIA_TODO float masa_to_total_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], #else IVAS_QMETADATA_HANDLE hQMetaData, #endif BSTR_ENC_HANDLE hMetaData, const int16_t low_bitrate_mode, const int16_t nbands, Loading @@ -6008,6 +6012,10 @@ void ivas_omasa_decode_masa_to_total( void ivas_omasa_modify_masa_energy_ratios( IVAS_QMETADATA_HANDLE hQMetaData /* i/o: q_metadata handle */ #ifdef FIX_672_NOKIA_TODO , float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_MAXIMUM_CODING_SUBBANDS] #endif ); #endif Loading Loading
apps/decoder.c +7 −0 Original line number Diff line number Diff line Loading @@ -2891,6 +2891,13 @@ cleanup: #ifdef SUPPORT_JBM_TRACEFILE JbmTraceFileWriter_close( &jbmTraceWriter ); #endif #ifdef FIX_683_JBM_CLEANUP MasaFileWriter_close( &masaWriter ); for ( int16_t i = 0; i < IVAS_MAX_NUM_OBJECTS; i++ ) { IsmFileWriter_close( &ismWriters[i] ); } #endif if ( decodingFailed && error == IVAS_ERR_OK ) { Loading
lib_com/bits_alloc.c +44 −17 Original line number Diff line number Diff line Loading @@ -394,6 +394,9 @@ static ivas_error acelp_FCB_allocator( int16_t nBits_tmp; int16_t *p_fixed_cdk_index; ivas_error error; #ifdef FIX_680_ACELP_TABLE_OMASA int16_t max_n; #endif error = IVAS_ERR_OK; Loading Loading @@ -424,13 +427,31 @@ static ivas_error acelp_FCB_allocator( } /* distribute the bit-budget equally between subframes */ #ifdef FIX_680_ACELP_TABLE_OMASA if ( L_subfr > L_SUBFR ) /* access fast_FCB_bits_2sfr */ { max_n = 6; } else { max_n = ACELP_FIXED_CDK_NB; } for ( cdbk = 0; cdbk < max_n; cdbk++ ) { if ( fcb_table( cdbk, L_subfr ) * nb_subfr > *nBits ) { break; } } cdbk--; #else cdbk = 0; while ( fcb_table( cdbk, L_subfr ) * nb_subfr <= *nBits ) { cdbk++; } cdbk--; #endif #ifdef DEBUGGING if ( cdbk < 0 && coder_type != TRANSITION ) { Loading @@ -455,6 +476,10 @@ static ivas_error acelp_FCB_allocator( *nBits -= nBits_tmp * nb_subfr; /* try to increase the FCB bit-budget of the first subframe(s) */ #ifdef FIX_680_ACELP_TABLE_OMASA if ( cdbk < ACELP_FIXED_CDK_NB - 1 ) { #endif step = fcb_table( cdbk + 1, L_subfr ) - nBits_tmp; while ( *nBits >= step ) { Loading @@ -477,7 +502,9 @@ static ivas_error acelp_FCB_allocator( *nBits -= step; } } #ifdef FIX_680_ACELP_TABLE_OMASA } #endif /* TRANSITION coding: allocate highest FCBQ bit-budget to the subframe with the glottal-shape codebook */ if ( tc_subfr >= L_SUBFR ) { Loading
lib_com/ivas_cnst.h +2 −2 Original line number Diff line number Diff line Loading @@ -119,8 +119,8 @@ typedef enum AUDIO_CONFIG_ISM2, /* ISM2 */ AUDIO_CONFIG_ISM3, /* ISM3 */ AUDIO_CONFIG_ISM4, /* ISM4 */ AUDIO_CONFIG_MASA1, /* MASA1 */ // TODO: seems not to be used AUDIO_CONFIG_MASA2, /* MASA2 */ // TODO: seems not to be used AUDIO_CONFIG_MASA1, /* MASA1 */ AUDIO_CONFIG_MASA2, /* MASA2 */ AUDIO_CONFIG_EXTERNAL /* external renderer */ } AUDIO_CONFIG; Loading
lib_com/ivas_masa_com.c +8 −0 Original line number Diff line number Diff line Loading @@ -897,6 +897,10 @@ void reconstruct_ism_ratios( void ivas_omasa_modify_masa_energy_ratios( IVAS_QMETADATA_HANDLE hQMetaData /* i/o: q_metadata handle */ #ifdef FIX_672_NOKIA_TODO , float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_MAXIMUM_CODING_SUBBANDS] #endif ) { int16_t i, m, d, b; Loading @@ -916,7 +920,11 @@ void ivas_omasa_modify_masa_energy_ratios( { for ( d = 0; d < hQMetaData->no_directions; d++ ) { #ifdef FIX_672_NOKIA_TODO hQMetaData->q_direction[d].band_data[b].energy_ratio[m] = hQMetaData->q_direction[d].band_data[b].energy_ratio[m] * masa_to_total_energy_ratio[i][b]; #else hQMetaData->q_direction[d].band_data[b].energy_ratio[m] = hQMetaData->q_direction[d].band_data[b].energy_ratio[m] * hQMetaData->masa_to_total_energy_ratio[i][b]; #endif } } } Loading
lib_com/ivas_prot.h +8 −0 Original line number Diff line number Diff line Loading @@ -5991,7 +5991,11 @@ void ivas_omasa_set_edited_objects( ); #endif void ivas_omasa_encode_masa_to_total( #ifdef FIX_672_NOKIA_TODO float masa_to_total_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], #else IVAS_QMETADATA_HANDLE hQMetaData, #endif BSTR_ENC_HANDLE hMetaData, const int16_t low_bitrate_mode, const int16_t nbands, Loading @@ -6008,6 +6012,10 @@ void ivas_omasa_decode_masa_to_total( void ivas_omasa_modify_masa_energy_ratios( IVAS_QMETADATA_HANDLE hQMetaData /* i/o: q_metadata handle */ #ifdef FIX_672_NOKIA_TODO , float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_MAXIMUM_CODING_SUBBANDS] #endif ); #endif Loading