Commit 0ab6da1c authored by Vidhya V P's avatar Vidhya V P
Browse files

Made modifications for SBA bitrate switching

[x] Added reconfiguration changes for switching bitrates with same
transport channels
[x] Changes under the switch SBA_BR_SWITCHING_2
parent f5e913a8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -923,6 +923,10 @@ typedef enum
{
    DIRAC_OPEN,                                 /* initialize to default value              */
    DIRAC_RECONFIGURE                           /* HOA3                                     */
#ifdef SBA_BR_SWITCHING_2
    ,
    DIRAC_RECONFIGURE_MODE
#endif
} DIRAC_CONFIG_FLAG;


+13 −2
Original line number Diff line number Diff line
@@ -112,8 +112,19 @@ ivas_error ivas_sba_enc_reinit(
#endif
#ifdef SBA_BR_SWITCHING
int16_t get_sba_reinit_flag(
    int32_t ivas_total_bitrate,                                /* i: current bitrate                  */
    int32_t last_ivas_total_brate                              /* i: previous bitrate                  */
    int32_t ivas_total_bitrate,                                /* i  : Current bitrate  */
    int32_t last_ivas_total_brate                              /* i  : Previous bitrate  */
#ifdef SBA_BR_SWITCHING_2
    , int16_t sba_order
#endif
);
#endif
#ifdef SBA_BR_SWITCHING_2
ivas_error ivas_spar_md_enc_init
(
    ivas_spar_md_enc_state_t *hMdEnc,                         /* o  : MD encoder handle        */
    const ENCODER_CONFIG_HANDLE hEncoderConfig,               /* i  : configuration structure  */
    const int16_t sba_order                                   /* i  : Ambisonic (SBA) order    */
);
#endif
ivas_error ivas_sba_enc_reconfigure( 
+24 −1
Original line number Diff line number Diff line
@@ -82,14 +82,37 @@ SBA_MODE ivas_sba_mode_select(
int16_t get_sba_reinit_flag(
    int32_t ivas_total_bitrate,   /* i  : Current bitrate  */
    int32_t last_ivas_total_brate /* i  : Previous bitrate  */
#ifdef SBA_BR_SWITCHING_2
    ,
    int16_t sba_order
#endif
)
{
    int16_t sba_reinit_flag;

    sba_reinit_flag = 0;
#ifdef SBA_BR_SWITCHING_2
    if ( ivas_total_bitrate != last_ivas_total_brate && ( ivas_total_bitrate > IVAS_SID_5k2 ) )
#else
    if ( ivas_total_bitrate != last_ivas_total_brate && ( last_ivas_total_brate > IVAS_SID_5k2 ) && ( ivas_total_bitrate > IVAS_SID_5k2 ) )
#endif
    {
#ifdef SBA_BR_SWITCHING_2
        int16_t sba_analysis_order, nchan_transport_old, nchan_transport_new;
        SBA_MODE last_sba_mode, current_sba_mode;
        sba_analysis_order = ivas_sba_get_analysis_order( last_ivas_total_brate, sba_order );
        nchan_transport_old = ivas_get_sba_num_TCs( last_ivas_total_brate, min( sba_analysis_order, IVAS_MAX_SBA_ORDER ) );
        last_sba_mode = ivas_sba_mode_select( last_ivas_total_brate );
        current_sba_mode = ivas_sba_mode_select( ivas_total_bitrate );
        sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_bitrate, sba_order );
        nchan_transport_new = ivas_get_sba_num_TCs( ivas_total_bitrate, min( sba_analysis_order, IVAS_MAX_SBA_ORDER ) );
        if ( ( current_sba_mode != last_sba_mode ) || ( nchan_transport_new != nchan_transport_old ) )
        {
#endif
            sba_reinit_flag = 1;
#ifdef SBA_BR_SWITCHING_2
        }
#endif
    }

    return sba_reinit_flag;
+1 −0
Original line number Diff line number Diff line
@@ -151,6 +151,7 @@
#define FIX_EFAP_MATH                                   /* fix for EFAP: remove angle quantization and a bug in polygon lookup causing incorrect gains. minor tweak for ALLRAD. non-BE for modes using EFAP */
#define FIX_124_DONT_ALLOC_PLCINFO_IN_IVAS              /* Issue 124: do not allocate unused plc struct in IVAS modes which is only used in EVS mono */
#define FIX_MCT_PLC_RECOVERY                            /* Issue 184: scale the old synthesis part correctly in the first good frame after lost frames in MCT modes - to be activated after previous switch is merged */
#define SBA_BR_SWITCHING_2                              /* Issue 114: Changes for sba bit rate switching with reconfigurations*/
#define SBA_BR_SWITCHING                                /* Issue 114: Changes for sba bit rate switching*/
#define FIX_AGC_WINFUNC_MEMORY                          /* Issue 62: lower agc_com.winFunc memory consumption */
#define REMOVE_SID_HARM_LEFTOVERS                       /* Issue 192: remove leftovers from the SID bitrate harmonization */
+3 −0
Original line number Diff line number Diff line
@@ -563,6 +563,9 @@ ivas_error ivas_dec(
    if ( !st_ivas->bfi ) /* do not update if first frame(s) are lost or NO_DATA */
    {
        st_ivas->hDecoderConfig->last_ivas_total_brate = ivas_total_brate;
#ifdef SBA_BR_SWITCHING_2
        st_ivas->last_active_ivas_total_brate = ( ivas_total_brate <= IVAS_SID_5k2 ) ? st_ivas->last_active_ivas_total_brate : ivas_total_brate;
#endif
    }

    if ( st_ivas->ini_frame < MAX_FRAME_COUNTER && !( st_ivas->bfi && st_ivas->ini_frame == 0 ) ) /* keep "st_ivas->ini_frame = 0" until first good received frame */
Loading