Commit 212d0c38 authored by vaclav's avatar vaclav
Browse files
parents 4025f1e9 88e36897
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -3207,6 +3207,9 @@ void ivas_qmetadata_enc_sid_encode(
    BSTR_ENC_HANDLE hMetaData,                                  /* i/o: metadata bitstream handle               */
    IVAS_QMETADATA *q_metadata,                                 /* i/o: metadata handle                         */
    const int16_t masa_sid_descriptor,                          /* i  : description of MASA SID coding structure*/
#ifdef NONBE_FIX_1052_SBA_EXT
    const int16_t nchan_transport, /* i  : number of transport channels                             */
#endif
	const int16_t ivas_format                                   /* i  : ivas format                             */
);

@@ -3515,6 +3518,13 @@ int16_t ivas_sba_get_nchan_metadata(
    const int32_t ivas_total_brate                              /* i  : IVAS total bitrate                      */
);

#ifdef NONBE_FIX_1052_SBA_EXT
/*! r: number of bits in SPAR SID frame */
int16_t ivas_sba_spar_sid_bitlen(
    const int16_t nchan_transport /* i  : number of transport channels            */
);
#endif

void ivas_sba_get_spar_hoa_ch_ind(
    const int16_t num_md_chs,                                   /* i  : number of MD channels                   */
    const int32_t ivas_total_brate,                             /* i  : IVAS total bitrate                      */
@@ -3616,6 +3626,9 @@ ivas_error ivas_dirac_enc(
    const int16_t input_frame,                                  /* i  : input frame length                      */
    const int16_t dtx_vad,                                      /* i  : DTX vad flag                            */
    const IVAS_FORMAT ivas_format,                              /* i  : ivas format                             */
#ifdef NONBE_FIX_1052_SBA_EXT
    const int16_t nchan_transport,                              /* i  : number of transport channels                             */
#endif
	const int16_t hodirac_flag                                  /* i  : hodirac flag                            */
);

@@ -3671,6 +3684,9 @@ void ivas_dirac_dec_read_BS(
    int16_t *nb_bits,                                           /* o  : number of bits read                     */
    const int16_t last_bit_pos,                                 /* i  : last read bitstream position            */
    const int16_t hodirac_flag,                                 /* i  : flag to indicate HO-DirAC mode          */
	#ifdef NONBE_FIX_1052_SBA_EXT
    const int16_t nchan_transport,                              /* i  : number of transport channels                             */
#endif
    int16_t *dirac_to_spar_md_bands                             /* o  : DirAC->SPAR MD bands                    */
);

+23 −0
Original line number Diff line number Diff line
@@ -158,6 +158,29 @@ int16_t ivas_sba_get_nchan(
    return ( nb_channels );
}

#ifdef NONBE_FIX_1052_SBA_EXT
/*-------------------------------------------------------------------*
 * ivas_sba_spar_sid_bitlen()
 *
 * Get number of bits in SPAR SID frame
 *-------------------------------------------------------------------*/

/*! r: number of bits in SPAR SID frame */
int16_t ivas_sba_spar_sid_bitlen(
    const int16_t nchan_transport /* i  : number of transport channels            */
)
{
    int16_t num_bits;

    num_bits = SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND;
    if ( nchan_transport > 1 )
    {
        num_bits -= 2;
    }

    return num_bits;
}
#endif

/*-------------------------------------------------------------------*
 * ivas_sba_get_nchan_metadata()
+4 −5
Original line number Diff line number Diff line
@@ -159,14 +159,13 @@
#define SPLIT_REND_POSE_CORRECTION_UNUSED_BITS

#define FIX_NUM_SUBFRAME_UPDATE

#define FIX_1053_REVERB_RECONFIGURATION                 /* Philips: issue 1053: fix for dynamic switching of acoustic environment */

#define CONF_DISTATT                                    /* Eri: Make distance attenuation configurable */
#define FIX_1082_INSTRUM_FAILED_LC3PLUS                 /* VoiceAge: issue 1082: fix ambiguous syntax in LC3Plus code leading to fails of instrumented builds */

#define FIX_1077_MEMORY_TEST_MISSING                    /* orange: issue 1077 : add missing memory test*/
#define FIX_1081_BINAURAL_SPLIT_PCM_SANITY_CHECK        /* VA: issue 1081: correct error print-out when BINAURAL_SPLIT_PCM is requested */
#define FIX_1052_EXT_OUTPUT                             /* VA: issue 1052: define EXT decoder output configuration for stereo and MC formats */ 


/* #################### End BE switches ################################## */

@@ -176,10 +175,10 @@

#define NONBE_FIX_ISM_XOVER_BR                          /* FhG: issue 1072: select OSBA coding method depending on number of object and bitrate */
#define NONBE_FIX_1028_1DB_TCX_LEVEL_DROP               /* VA: Harmonize the logic setting LP weighting factor between TCX encoder and TCX decoder */

#define NONBE_FIX_SBA_SIGNALING_BITS_B                  /* FhG: issue 1061: option B: signal sba order additionally in OSBA */
#define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT   /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/ 
#define NONBE_FIX_MC_LFE_LPF                            /* Dlb: Adding the LFE LPF filter back for MC content. */

#define NONBE_FIX_1052_SBA_EXT                          /* Dlb: SBA external output support */

/* ##################### End NON-BE switches ########################### */

+2 −2
Original line number Diff line number Diff line
@@ -1148,9 +1148,9 @@ ivas_error ivas_binRenderer_open(
    if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
        hBinRenderer->numPoses = st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses + 1;
        hBinRenderer->numPoses = st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses + 1;
#else
        hBinRenderer->numPoses = st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses;
        hBinRenderer->numPoses = st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses;
#endif
    }
    else
+37 −10
Original line number Diff line number Diff line
@@ -765,6 +765,9 @@ ivas_error ivas_dirac_dec_config(
    int16_t need_parambin;
    int16_t dec_param_estim_old;
    int16_t dec_param_estim_new;
#ifdef SPLIT_REND_WITH_HEAD_ROT
    int16_t num_poses, pos_idx;
#endif

    error = IVAS_ERR_OK;

@@ -775,6 +778,14 @@ ivas_error ivas_dirac_dec_config(
    hodirac_flag = ivas_get_hodirac_flag( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order );
    dec_param_estim_old = ( dec_config_flag == DIRAC_RECONFIGURE ) ? st_ivas->hDirAC->hConfig->dec_param_estim : FALSE;

#ifdef SPLIT_REND_WITH_HEAD_ROT
    num_poses = 1;
    if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        num_poses = st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses;
    }
#endif

    sparfoa_flag = 0;
    if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_FOA && st_ivas->ivas_format == SBA_FORMAT && !hodirac_flag )
    {
@@ -904,7 +915,7 @@ ivas_error ivas_dirac_dec_config(

#ifdef SPLIT_REND_WITH_HEAD_ROT
                /* copy td-decorr flag to split renderer side rendereres */
                for ( int16_t pos_idx = 1; pos_idx < st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses; pos_idx++ )
                for ( pos_idx = 1; pos_idx < num_poses; pos_idx++ )
                {
                    st_ivas->hDiracDecBin[pos_idx]->useTdDecorr = st_ivas->hDiracDecBin[0]->useTdDecorr;
                }
@@ -939,7 +950,7 @@ ivas_error ivas_dirac_dec_config(
                }

#ifdef SPLIT_REND_WITH_HEAD_ROT
                for ( int16_t pos_idx = 0; pos_idx < st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses; pos_idx++ )
                for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ )
                {
                    st_ivas->hDiracDecBin[pos_idx]->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate );
                }
@@ -1002,6 +1013,9 @@ void ivas_dirac_dec_read_BS(
    int16_t *nb_bits,                                     /* o  : number of bits read             */
    const int16_t last_bit_pos,                           /* i  : last read bitstream position    */
    const int16_t hodirac_flag,                           /* i  : flag to indicate HO-DirAC mode  */
#ifdef NONBE_FIX_1052_SBA_EXT
    const int16_t nchan_transport, /* i  : number of transport channels                             */
#endif
    int16_t *dirac_to_spar_md_bands /* o  : DirAC->SPAR MD bands            */
)
{
@@ -1035,7 +1049,12 @@ void ivas_dirac_dec_read_BS(
                }
            }

#ifdef NONBE_FIX_1052_SBA_EXT
            *nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), nchan_transport, NULL, SBA_FORMAT );
#else
            *nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), 0, NULL, SBA_FORMAT );
#endif

            for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ )
            {
                hQMetaData->q_direction[0].band_data[orig_dirac_bands - 1].azimuth[i] = hQMetaData->q_direction[0].band_data[1].azimuth[0];
@@ -1083,7 +1102,11 @@ void ivas_dirac_dec_read_BS(
        next_bit_pos_orig = st->next_bit_pos;

        /* subtract mode signaling bits, since bitstream was moved after mode reading */
#ifdef NONBE_FIX_1052_SBA_EXT
        st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS - SBA_PLANAR_BITS - SBA_ORDER_BITS );
#else
        st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS );
#endif
        /* 1 bit flag for signaling metadata to read */
        b = st->bit_stream[( st->next_bit_pos )--];
        ( *nb_bits )++;
@@ -1103,7 +1126,11 @@ void ivas_dirac_dec_read_BS(
            }
        }

#ifdef NONBE_FIX_1052_SBA_EXT
        *nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), nchan_transport, NULL, SBA_FORMAT );
#else
        *nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), 0, NULL, SBA_FORMAT );
#endif
        for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ )
        {
            hQMetaData->q_direction[0].band_data[orig_dirac_bands - 1].azimuth[i] = hQMetaData->q_direction[0].band_data[1].azimuth[0];
@@ -2338,17 +2365,17 @@ void ivas_dirac_dec_render_sf(
#ifdef SPLIT_REND_WITH_HEAD_ROT
        if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
        {
            if ( st_ivas->hSplitBinRend.hCldfbDataOut != NULL )
            if ( st_ivas->hSplitBinRend->hCldfbDataOut != NULL )
            {
                for ( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ )
                {
                    for ( ch = 0; ch < st_ivas->hBinRenderer->nInChannels; ch++ )
                    {
                        mvr2r( Cldfb_RealBuffer[ch][slot_idx], st_ivas->hSplitBinRend.hCldfbDataOut->Cldfb_RealBuffer[ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
                        mvr2r( Cldfb_ImagBuffer[ch][slot_idx], st_ivas->hSplitBinRend.hCldfbDataOut->Cldfb_ImagBuffer[ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
                        mvr2r( Cldfb_RealBuffer[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_RealBuffer[ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
                        mvr2r( Cldfb_ImagBuffer[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_ImagBuffer[ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
                    }
                }
                st_ivas->hSplitBinRend.hCldfbDataOut->config = st_ivas->hIntSetup.output_config;
                st_ivas->hSplitBinRend->hCldfbDataOut->config = st_ivas->hIntSetup.output_config;
            }
        }
#endif
@@ -2356,7 +2383,7 @@ void ivas_dirac_dec_render_sf(
        /* Perform binaural rendering */
        ivas_binRenderer( st_ivas->hBinRenderer,
#ifdef SPLIT_REND_WITH_HEAD_ROT
                          &st_ivas->hSplitBinRend.splitrend.multiBinPoseData,
                          ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData,
#endif

                          st_ivas->hCombinedOrientationData,
@@ -2375,8 +2402,8 @@ void ivas_dirac_dec_render_sf(
                {
                    for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ )
                    {
                        mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
                        mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
                        mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
                        mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
                    }
                }
            }
Loading