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/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -243,6 +243,7 @@ #define FIX_675_WB_OMASA /* Nokia: Fix for issue 675 solving the crash in OMASA for WB input */ #define FIX_683_JBM_CLEANUP /* FhG: Fix for issue 683, add clean up for ISM and MASA file writers */ #define FIX_689_USAN_QSPHERICAL /* Nokia: Fix usan error from issue 689 */ #define FIX_680_ACELP_TABLE_OMASA /* Nokia: Fix for issue 680 preventing overindexing of PulseConfTable */ /* ################## End BE DEVELOPMENT switches ######################### */ Loading 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/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -243,6 +243,7 @@ #define FIX_675_WB_OMASA /* Nokia: Fix for issue 675 solving the crash in OMASA for WB input */ #define FIX_683_JBM_CLEANUP /* FhG: Fix for issue 683, add clean up for ISM and MASA file writers */ #define FIX_689_USAN_QSPHERICAL /* Nokia: Fix usan error from issue 689 */ #define FIX_680_ACELP_TABLE_OMASA /* Nokia: Fix for issue 680 preventing overindexing of PulseConfTable */ /* ################## End BE DEVELOPMENT switches ######################### */ Loading