Commit e3510c80 authored by premathasara's avatar premathasara
Browse files

Merge branch '185-crash-in-sba-encoder-for-24-4-kbps-hoa3-input-with-longer-testvector' into 'main'

[non-BE] Fix #185: Crash in sba encoder for 24.4 kbps hoa3 input with longer testvector

See merge request !286
parents 0d52c934 c41f67fd
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -372,7 +372,11 @@ ivas_error ivas_dirac_sba_config(
        else if ( sba_total_brate <= IVAS_24k4 )
        {
            hQMetaData->bits_frame_nominal = ACELP_16k40 / FRAMES_PER_SEC;
#ifdef FIX_185_REDUCE_MD_BITS
            hQMetaData->metadata_max_bits = 103;
#else
            hQMetaData->metadata_max_bits = 106;
#endif
        }
        else if ( sba_total_brate <= IVAS_32k )
        {
+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@
#define FIX_158_DIRAC_MEM                               /* Issue 158: Reduce memory consumption in the hDirac_mem handle */
#define BRATE_SWITCHING_FRAMEWORK                       /* Bitrate switching changes related to the general framework  */
#define BRATE_SWITCHING_RENDERING                       /* Bitrate switching changes related to the renderers */

#define FIX_185_REDUCE_MD_BITS                          /* Issue 185: Crash in SBA encoder for 24.4 kbps HOA3 input with longer testvector */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+4 −0
Original line number Diff line number Diff line
@@ -308,7 +308,11 @@ void ivas_agc_read_bits(
            if ( per_ch_bit[i] == 1 )
            {
                pState->gain_data[i].absGainExpCurr = get_next_indice( st0, (int16_t) pState->agc_com.betaE );
#ifdef FIX_185_REDUCE_MD_BITS
                pState->gain_data[i].gainException = false;
#else
                pState->gain_data[i].gainException = get_next_indice( st0, 1 );
#endif
            }
            else
            {
+2 −0
Original line number Diff line number Diff line
@@ -512,7 +512,9 @@ void ivas_agc_enc_process(
            if ( per_ch_bit[i] == 1 )
            {
                push_next_indice( hMetaData, (uint16_t) pState->gain_data[i].absGainExpCurr, (int16_t) pState->agc_com.betaE );
#ifndef FIX_185_REDUCE_MD_BITS
                push_next_indice( hMetaData, (uint16_t) pState->gain_data[i].gainException, 1 );
#endif
                assert( pState->gain_data[i].gainException == FALSE );
            }
        }