Commit 2e2a08ed authored by Jouni Paulus's avatar Jouni Paulus
Browse files

extend FIX_417_TD_DECORR_BRATE_SW to simplify the operations in McMASA bitrate...

extend FIX_417_TD_DECORR_BRATE_SW to simplify the operations in McMASA bitrate switching: instead of full dirac close and re-init, only reconfigure td-decorr when necessary.
parent 50f5e6e7
Loading
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -131,6 +131,16 @@ ivas_error ivas_mcmasa_dec_reconfig(
        }
        else
        {
#ifdef FIX_417_TD_DECORR_BRATE_SW
            /* if necessary, close/open td-decorrs */
            if ( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin->hTdDecorr ), &( st_ivas->hDiracDecBin->useTdDecorr ) ) ) != IVAS_ERR_OK )
            {
                return error;
            }

            /* regularization factor is bitrate-dependent */
            st_ivas->hDiracDecBin->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate );
#else
            /* the decision for useTdDecorr is done in ivas_dirac_dec_init_binaural_data(). here, comparing against the same condition. */
            if ( st_ivas->hDiracDecBin->useTdDecorr != ( ivas_total_brate < IVAS_48k && st_ivas->nchan_transport == 1 ) )
            {
@@ -141,6 +151,7 @@ ivas_error ivas_mcmasa_dec_reconfig(
                    return error;
                }
            }
#endif
        }
    }

+3 −0
Original line number Diff line number Diff line
@@ -574,6 +574,9 @@ typedef struct dirac_output_synthesis_cov_state_structure

} DIRAC_OUTPUT_SYNTHESIS_COV_STATE;

#ifdef FIX_417_TD_DECORR_BRATE_SW
float configure_reqularization_factor( const IVAS_FORMAT ivas_format, const int32_t ivas_brate );
#endif

/* MASA stereo transport signal type detection structure */
typedef struct
+6 −2
Original line number Diff line number Diff line
@@ -94,8 +94,9 @@ static void matrixMul( float Are[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Ai

static void matrixTransp2Mul( float Are[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Aim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Bre[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Bim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float outRe[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float outIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS] );

#ifndef FIX_417_TD_DECORR_BRATE_SW
static float configure_reqularization_factor( const IVAS_FORMAT ivas_format, const int32_t ivas_brate );

#endif

/*-------------------------------------------------------------------------
 * ivas_dirac_dec_init_binaural_data()
@@ -2026,7 +2027,10 @@ static void hrtfShGetHrtf(
 *------------------------------------------------------------------------*/

/*! r: Configured reqularization factor value to be set. */
static float configure_reqularization_factor(
#ifndef FIX_417_TD_DECORR_BRATE_SW
static
#endif
float configure_reqularization_factor(
    const IVAS_FORMAT ivas_format, /* i: IVAS codec format in use */
    const int32_t ivas_brate )     /* i: Current IVAS bitrate     */
{