Commit 825c19fa authored by SCHUGM's avatar SCHUGM
Browse files

changing paramupmix rendering to binaural to downmix from 7.1.4. JBM not

working yet
parent 3702d9f6
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -216,6 +216,8 @@

#define MASA_AND_OBJECTS                                /* Nokia: Combination of MASA and objects */

#define PARAMUPMIX_BINAURAL_UPDATES                     /* Dlb : issue 652, MC ParamUpmix Binaural Updates */ 



/* ################## End BE DEVELOPMENT switches ######################### */
+11 −0
Original line number Diff line number Diff line
@@ -2609,8 +2609,19 @@ void ivas_init_dec_get_num_cldfb_instances(
    }

    if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO )
    {
#ifdef PARAMUPMIX_BINAURAL_UPDATES
        if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC )
        {
            *numCldfbAnalyses = max( MC_PARAMUPMIX_MIN_CLDFB+3, *numCldfbAnalyses );
        }
        else
        {
            *numCldfbAnalyses = max( MC_PARAMUPMIX_MIN_CLDFB, *numCldfbAnalyses );
        }
#else
        *numCldfbAnalyses = max( MC_PARAMUPMIX_MIN_CLDFB, *numCldfbAnalyses );
#endif
        *numCldfbSyntheses = max( MC_PARAMUPMIX_MIN_CLDFB, *numCldfbSyntheses );
    }

+94 −1
Original line number Diff line number Diff line
@@ -181,9 +181,26 @@ void ivas_mc_paramupmix_dec(
    float *pPcm_temp[MC_PARAMUPMIX_COMBINATIONS * 2];         /* decorrelated and undecorrelated*/
    int16_t noparamupmix_delay;
    AUDIO_CONFIG output_config;
#ifdef PARAMUPMIX_BINAURAL_UPDATES
    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];
    int16_t subframeIdx, idx_in, index_slot, maxBand;
#ifdef SPLIT_REND_WITH_HEAD_ROT
    float Cldfb_RealBuffer_Binaural[1][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
    float Cldfb_ImagBuffer_Binaural[1][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
#else
    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
     /*  boxes = { 0 1 2 3 [4 6] [5 7] [8 10] [9 11] }; */
     int16_t chidx1[MC_PARAMUPMIX_COMBINATIONS] = {0, 1, 4, 5};
     int16_t chidx2[MC_PARAMUPMIX_COMBINATIONS] = {2, 3, 6, 7};
#else
#ifdef JBM_PARAMUPMIX
    float *p_output[MAX_OUTPUT_CHANNELS];
#endif
#endif

    hMCParamUpmix = st_ivas->hMCParamUpmix;
    assert( hMCParamUpmix );

@@ -200,6 +217,7 @@ void ivas_mc_paramupmix_dec(
    {
        first_empty_channel = 8; /* Don't upmix */
    }
#ifndef PARAMUPMIX_BINAURAL_UPDATES
#ifdef JBM_PARAMUPMIX
    else if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM )
    {
@@ -212,6 +230,7 @@ void ivas_mc_paramupmix_dec(
        }
        ivas_binaural_cldfb( st_ivas, p_output );
    }
#endif
#endif
    else
    {
@@ -269,7 +288,78 @@ void ivas_mc_paramupmix_dec(
            mvr2r( hMCParamUpmix->betas[ch], hMCParamUpmix->beta_prev[ch], IVAS_MAX_NUM_BANDS );
        }

        /*  boxes = { 0 1 2 3 [4 6] [5 7] [8 10] [9 11] }; */
#ifdef PARAMUPMIX_BINAURAL_UPDATES
        if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM )
        {
            maxBand = (int16_t) ( ( CLDFB_NO_CHANNELS_MAX * st_ivas->hDecoderConfig->output_Fs ) / 48000 );
            /* fastconv binaural rendering and CLDFB synthesis */
            for ( subframeIdx = 0; subframeIdx < ( CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES ); subframeIdx++ )
            {
                index_slot = subframeIdx * MAX_PARAM_SPATIAL_SUBFRAMES;
                /* cldfb analysis of non-coupled, non-LFE channels */
                idx_in = 0;
                for ( ch = 0; ch < first_empty_channel-2*MC_PARAMUPMIX_COMBINATIONS; ch++ )
                {
                    if ( st_ivas->hIntSetup.index_lfe[0] != ch )
                    {
                        pPcm_temp[ch] = output_f[ch]; 
                        /* slot loop for gathering the input data */
                        for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ )
                        {
                            cldfbAnalysis_ts( &( pPcm_temp[ch][hMCParamUpmix->num_freq_bands * (index_slot+slot_idx)] ), Cldfb_RealBuffer_subfr[idx_in][slot_idx], Cldfb_ImagBuffer_subfr[idx_in][slot_idx], hMCParamUpmix->num_freq_bands, st_ivas->cldfbAnaDec[2*MC_PARAMUPMIX_COMBINATIONS+idx_in] );
                        }
                        idx_in++;
                    }
                }
                for (ch=0; ch<MAX_PARAM_SPATIAL_SUBFRAMES; ch++)
                {
                    for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ )
                    {
                        mvr2r(Cldfb_RealBuffer[chidx1[ch]][index_slot+slot_idx], Cldfb_RealBuffer_subfr[idx_in][slot_idx], CLDFB_NO_CHANNELS_MAX);
                        mvr2r(Cldfb_ImagBuffer[chidx1[ch]][index_slot+slot_idx], Cldfb_ImagBuffer_subfr[idx_in][slot_idx], CLDFB_NO_CHANNELS_MAX);
                        mvr2r(Cldfb_RealBuffer[chidx2[ch]][index_slot+slot_idx], Cldfb_RealBuffer_subfr[idx_in+1][slot_idx], CLDFB_NO_CHANNELS_MAX);
                        mvr2r(Cldfb_ImagBuffer[chidx2[ch]][index_slot+slot_idx], Cldfb_ImagBuffer_subfr[idx_in+1][slot_idx], CLDFB_NO_CHANNELS_MAX);
                    }
                    idx_in += 2;
                }
                /* Implement binaural rendering */
                ivas_binRenderer( st_ivas->hBinRenderer,
#ifdef SPLIT_REND_WITH_HEAD_ROT
                                  &st_ivas->splitBinRend.splitrend.multiBinPoseData,
#endif
                                  st_ivas->hCombinedOrientationData,
                                  subframeIdx, JBM_CLDFB_SLOTS_IN_SUBFRAME,
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
                                  NULL,
#endif
                                  Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural,
                                  Cldfb_RealBuffer_subfr,
                                  Cldfb_ImagBuffer_subfr );

                /* Implement CLDFB synthesis */
                for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
                {
                    float *RealBuffer[MAX_PARAM_SPATIAL_SUBFRAMES];
                    float *ImagBuffer[MAX_PARAM_SPATIAL_SUBFRAMES];

                    for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ )
                    {
#ifdef SPLIT_REND_WITH_HEAD_ROT
                        RealBuffer[slot_idx] = Cldfb_RealBuffer_Binaural[0][ch][slot_idx];
                        ImagBuffer[slot_idx] = Cldfb_ImagBuffer_Binaural[0][ch][slot_idx];
#else
                        RealBuffer[slot_idx] = Cldfb_RealBuffer_Binaural[ch][slot_idx];
                        ImagBuffer[slot_idx] = Cldfb_ImagBuffer_Binaural[ch][slot_idx];
#endif
                    }

                    cldfbSynthesis( RealBuffer, ImagBuffer, &( output_f[ch][index_slot * maxBand] ), maxBand * MAX_PARAM_SPATIAL_SUBFRAMES, st_ivas->cldfbSynDec[ch] );
                }
            }
        }
        else
        {
#endif
        pPcm_temp[0] = output_f[4];
        pPcm_temp[1] = output_f[6];
        pPcm_temp[2] = output_f[5];
@@ -303,6 +393,9 @@ void ivas_mc_paramupmix_dec(
            mvr2r( hMCParamUpmix->pcm_delay[ch], output_f[ch], noparamupmix_delay );
            mvr2r( tmp_buf, hMCParamUpmix->pcm_delay[ch], noparamupmix_delay );
        }
#ifdef PARAMUPMIX_BINAURAL_UPDATES
        }
#endif
    }

    for ( ch = first_empty_channel; ch < MAX_OUTPUT_CHANNELS; ch++ )
+2 −0
Original line number Diff line number Diff line
@@ -290,11 +290,13 @@ void ivas_renderer_select(
                            /* force HOA3 domain for rotation*/
                            *internal_config = AUDIO_CONFIG_HOA3;
                        }
#ifndef PARAMUPMIX_BINAURAL_UPDATES
#ifdef JBM_PARAMUPMIX
                        if ( ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && ( *renderer_type == RENDERER_BINAURAL_FASTCONV ) )
                        {
                            *internal_config = AUDIO_CONFIG_5_1_2;
                        }
#endif
#endif
                    }
                }