Commit cfb84da5 authored by multrus's avatar multrus
Browse files

[cleanup] accept NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION

parent a04a8650
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -5321,7 +5321,6 @@ void ivas_mc2sba(
    const float gain_lfe                                        /* i  : gain for LFE, 0=ignore LFE                      */
);

#ifdef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
void ivas_param_mc_mc2sba_cldfb(
    IVAS_OUTPUT_SETUP hTransSetup,                                                /* i  : transported MC Format                                       */
    float *hoa_encoder,                                                           /* i  : HOA3 encoder for the transported MC format                  */
@@ -5331,7 +5330,6 @@ void ivas_param_mc_mc2sba_cldfb(
    const int16_t nBands,                                                         /* i  : number of synth CLDFB bands                                 */
    const float gain_lfe                                                          /* i  : gain applied to LFE                                        */
);
#endif

void ivas_ism2sba(
    float *buffer_td[],                                         /* i/o: TD signal buffers                               */
+0 −1
Original line number Diff line number Diff line
@@ -176,7 +176,6 @@


#define NONBE_FIX_787_PARAM_UPMIX_LEVEL                       /* Dlb: issue 787: fix level of Mono/Stereo for ParamUpmix mode */
#define NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION              /* Dlb : issue 727 : headrotation in MC paramupmix mode*/
#define NONBE_FIX_779_ISM_FREE_REVERB_HANDLE                  /* VA: issue 779: fix Crash in ISM rate switching with BINAURAL_ROOM_REVERB */

#define NONBE_FIX_722_MEMORY_LEAK_IN_PARAMUPMIX               /* Dlb : issue 722: memory leak fix in MC param upmix mode with BR switching*/
+0 −79
Original line number Diff line number Diff line
@@ -97,9 +97,6 @@ static void ivas_param_mc_dec_compute_interpolator( const uint16_t bAttackPresen
static void param_mc_set_num_synth_bands( const int32_t output_Fs, PARAM_MC_DEC_HANDLE hParamMC );

static ivas_error param_mc_get_diff_proto_info( const float *proto_mtx, const uint16_t nchan_transport, const uint16_t nchan_out_cov, PARAM_MC_DIFF_PROTO_INFO *p_diff_proto_info );
#ifndef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
static void ivas_param_mc_mc2sba_cldfb( IVAS_OUTPUT_SETUP hTransSetup, float *hoa_encoder, const int16_t slot_idx, float Cldfb_RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], const int16_t nBands, const float gain_lfe );
#endif

static void ivas_param_mc_get_param_band_mapping( const int16_t n_target_bands, const int16_t *target_band_grouping, const int16_t n_source_bands, const int16_t *source_band_grouping, PARAM_MC_PARAMETER_BAND_MAPPING *parameter_band_mapping );

@@ -2982,82 +2979,6 @@ static ivas_error param_mc_get_diff_proto_info(
    return IVAS_ERR_OK;
}

#ifndef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
/*-------------------------------------------------------------------------*
 * ivas_param_mc_mc2sba_cldfb()
 *
 * MC signals transformed into SBA in CLDFB domain
 * used for binaural rendering with head rotation
 *-------------------------------------------------------------------------*/

static void ivas_param_mc_mc2sba_cldfb(
    IVAS_OUTPUT_SETUP hTransSetup,                                                /* i  : transported MC Format                                       */
    float *hoa_encoder,                                                           /* i  : HOA3 encoder for the transported MC format                  */
    const int16_t slot_idx,                                                       /* i  : current slot in the subframe                                */
    float Cldfb_RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o: Contains the MC signals (on input) and the HOA3 (on output) */
    float Cldfb_ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o: Contains the MC signals (on input) and the HOA3 (on output) */
    const int16_t nBands,                                                         /* i  : number of synth CLDFB bands                                 */
    const float gain_lfe                                                          /* i  : gain applied to LFE                                        */
)
{
    int16_t idx_ch, idx_band;
    int16_t idx_lfe, idx_in, idx_out;
    float Cldfb_RealBuffer_tmp[MAX_INTERN_CHANNELS][CLDFB_NO_CHANNELS_MAX];
    float Cldfb_ImagBuffer_tmp[MAX_INTERN_CHANNELS][CLDFB_NO_CHANNELS_MAX];
    float *gains;
    int16_t sba_num_chans;

    /* Init*/
    sba_num_chans = MAX_INTERN_CHANNELS;

    for ( idx_ch = 0; idx_ch < sba_num_chans; idx_ch++ )
    {
        set_zero( Cldfb_RealBuffer_tmp[idx_ch], CLDFB_NO_CHANNELS_MAX );
        set_zero( Cldfb_ImagBuffer_tmp[idx_ch], CLDFB_NO_CHANNELS_MAX );
    }

    idx_lfe = 0;
    idx_in = 0;
    for ( idx_ch = 0; idx_ch < hTransSetup.nchan_out_woLFE + hTransSetup.num_lfe; idx_ch++ )
    {
        if ( ( hTransSetup.num_lfe > 0 ) && ( idx_ch == hTransSetup.index_lfe[idx_lfe] ) )
        {
            if ( gain_lfe > 0.f )
            {
                /* Add LFE to Omni Channel i.e. W (Just first Band) */
                Cldfb_RealBuffer_tmp[0][0] += gain_lfe * Cldfb_RealBuffer[idx_ch][slot_idx][0];
                Cldfb_ImagBuffer_tmp[0][0] += gain_lfe * Cldfb_ImagBuffer[idx_ch][slot_idx][0];
            }
            if ( idx_lfe < ( hTransSetup.num_lfe - 1 ) )
            {
                idx_lfe++;
            }
        }
        else
        {
            gains = hoa_encoder + idx_in * sba_num_chans;
            for ( idx_out = 0; idx_out < sba_num_chans; idx_out++ )
            {
                for ( idx_band = 0; idx_band < nBands; idx_band++ )
                {
                    Cldfb_RealBuffer_tmp[idx_out][idx_band] += ( *gains ) * Cldfb_RealBuffer[idx_ch][slot_idx][idx_band];
                    Cldfb_ImagBuffer_tmp[idx_out][idx_band] += ( *gains ) * Cldfb_ImagBuffer[idx_ch][slot_idx][idx_band];
                }
                gains++;
            }
            idx_in++;
        }
    }

    for ( idx_ch = 0; idx_ch < sba_num_chans; idx_ch++ )
    {
        mvr2r( Cldfb_RealBuffer_tmp[idx_ch], Cldfb_RealBuffer[idx_ch][slot_idx], nBands );
        mvr2r( Cldfb_ImagBuffer_tmp[idx_ch], Cldfb_ImagBuffer[idx_ch][slot_idx], nBands );
    }

    return;
}
#endif

/*-------------------------------------------------------------------------*
 * ivas_param_mc_bs_decode_parameter_values()
+0 −56
Original line number Diff line number Diff line
@@ -194,23 +194,12 @@ void ivas_mc_paramupmix_dec(
    int16_t noparamupmix_delay;
    AUDIO_CONFIG output_config;
    int16_t subframeIdx, idx_in, index_slot, maxBand;
#ifdef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
    float Cldfb_RealBuffer_subfr[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
    float Cldfb_ImagBuffer_subfr[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifndef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
    float Cldfb_RealBuffer_subfr[MC_PARAMUPMIX_MAX_INPUT_CHANS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
    float Cldfb_ImagBuffer_subfr[MC_PARAMUPMIX_MAX_INPUT_CHANS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
    int16_t idx_lfe;
#endif
    float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
    float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
#else
#ifndef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
    float Cldfb_RealBuffer_subfr[3 + MC_PARAMUPMIX_MAX_TRANSPORT_CHANS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
    float Cldfb_ImagBuffer_subfr[3 + MC_PARAMUPMIX_MAX_TRANSPORT_CHANS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
#endif
    float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
    float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
#endif
@@ -332,7 +321,6 @@ void ivas_mc_paramupmix_dec(
                    idx_in += 2;
                }

#ifdef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
                if ( st_ivas->hCombinedOrientationData && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV )
                {
                    for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ )
@@ -340,25 +328,11 @@ void ivas_mc_paramupmix_dec(
                        ivas_param_mc_mc2sba_cldfb( st_ivas->hTransSetup, hMCParamUpmix->hoa_encoder, slot_idx, Cldfb_RealBuffer_subfr, Cldfb_ImagBuffer_subfr, maxBand, GAIN_LFE );
                    }
                }
#endif

#ifdef SPLIT_REND_WITH_HEAD_ROT
                /*LFE handling for split rendering cases*/
                if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
                {
#ifndef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
                    /*LFE is already handled in ivas_param_mc_mc2sba_cldfb()*/
                    for ( idx_lfe = 0; idx_lfe < st_ivas->hIntSetup.num_lfe; idx_lfe++ )
                    {
                        ch = st_ivas->hIntSetup.index_lfe[idx_lfe];
                        /* slot loop for gathering the input data */
                        for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ )
                        {
                            cldfbAnalysis_ts( &( output_f[ch][maxBand * index_slot] ), Cldfb_RealBuffer_subfr[idx_in][slot_idx], Cldfb_ImagBuffer_subfr[idx_in][slot_idx], maxBand, st_ivas->cldfbAnaDec[idx_in] );
                        }
                        idx_in++;
                    }
#endif

#ifdef SPLIT_REND_WITH_HEAD_ROT
                    if ( st_ivas->hSplitBinRend.hCldfbDataOut != NULL )
@@ -396,16 +370,6 @@ void ivas_mc_paramupmix_dec(
                if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
                {
                    int16_t pos_idx;
#ifndef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
                    for ( slot_idx = 0; slot_idx < JBM_CLDFB_SLOTS_IN_SUBFRAME; slot_idx++ )
                    {
                        if ( st_ivas->hIntSetup.num_lfe > 0 )
                        {
                            v_multc( Cldfb_RealBuffer_subfr[st_ivas->hIntSetup.nchan_out_woLFE][slot_idx], GAIN_LFE, Cldfb_RealBuffer_subfr[st_ivas->hIntSetup.nchan_out_woLFE][slot_idx], maxBand );
                            v_multc( Cldfb_ImagBuffer_subfr[st_ivas->hIntSetup.nchan_out_woLFE][slot_idx], GAIN_LFE, Cldfb_ImagBuffer_subfr[st_ivas->hIntSetup.nchan_out_woLFE][slot_idx], maxBand );
                        }
                    }
#endif

                    for ( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ )
                    {
@@ -413,20 +377,6 @@ void ivas_mc_paramupmix_dec(
                        {
                            for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ )
                            {
#ifndef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
                                if ( st_ivas->hIntSetup.num_lfe > 0 )
                                {
                                    v_add( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx],
                                           Cldfb_RealBuffer_subfr[st_ivas->hIntSetup.nchan_out_woLFE][slot_idx],
                                           Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx],
                                           maxBand );

                                    v_add( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx],
                                           Cldfb_ImagBuffer_subfr[st_ivas->hIntSetup.nchan_out_woLFE][slot_idx],
                                           Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx],
                                           maxBand );
                                }
#endif
                                mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][( subframeIdx * JBM_CLDFB_SLOTS_IN_SUBFRAME ) + slot_idx], maxBand );
                                mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][( subframeIdx * JBM_CLDFB_SLOTS_IN_SUBFRAME ) + slot_idx], maxBand );
                            }
@@ -677,9 +627,7 @@ ivas_error ivas_mc_paramupmix_dec_open(
#endif
    }

#ifdef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
    hMCParamUpmix->hoa_encoder = NULL;
#endif

    /*-----------------------------------------------------------------*
     * set input parameters
@@ -701,7 +649,6 @@ ivas_error ivas_mc_paramupmix_dec_open(
        set_zero( hMCParamUpmix->pcm_delay[i], NS2SA( output_Fs, IVAS_FB_DEC_DELAY_NS ) );
    }

#ifdef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
    /* Head or external rotation */
    if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) )
    {
@@ -711,7 +658,6 @@ ivas_error ivas_mc_paramupmix_dec_open(
        }
        compute_hoa_encoder_mtx( st_ivas->hTransSetup.ls_azimuth, st_ivas->hTransSetup.ls_elevation, hMCParamUpmix->hoa_encoder, st_ivas->hTransSetup.nchan_out_woLFE, HEAD_ROTATION_HOA_ORDER );
    }
#endif

    /* allocate transport channels*/
    hMCParamUpmix->free_param_interpolator = 0;
@@ -789,13 +735,11 @@ void ivas_mc_paramupmix_dec_close(
            free( ( *hMCParamUpmix )->param_interpolator );
        }
    }
#ifdef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
    if ( ( *hMCParamUpmix )->hoa_encoder != NULL )
    {
        free( ( *hMCParamUpmix )->hoa_encoder );
        ( *hMCParamUpmix )->hoa_encoder = NULL;
    }
#endif
    free( *hMCParamUpmix );

    *hMCParamUpmix = NULL;
+0 −12
Original line number Diff line number Diff line
@@ -262,12 +262,6 @@ void ivas_renderer_select(
                            /* force HOA3 domain for rotation*/
                            *internal_config = IVAS_AUDIO_CONFIG_HOA3;
                        }
#ifndef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
                        if ( ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && ( *renderer_type == RENDERER_BINAURAL_FASTCONV ) )
                        {
                            *internal_config = IVAS_AUDIO_CONFIG_7_1_4;
                        }
#endif
                    }
                }
                else
@@ -289,12 +283,6 @@ void ivas_renderer_select(
                    {
                        *renderer_type = RENDERER_BINAURAL_FASTCONV_ROOM;
                    }
#endif
#ifndef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
                    if ( ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && ( *renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) )
                    {
                        *internal_config = IVAS_AUDIO_CONFIG_5_1_2;
                    }
#endif
                }
            }
Loading