Commit 97258494 authored by multrus's avatar multrus
Browse files

[cleanup] accept NONBE_FIX_1052_SBA_EXT

parent 55056314
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -3207,9 +3207,7 @@ 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                             */
);

@@ -3518,12 +3516,10 @@ 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                   */
@@ -3626,9 +3622,7 @@ 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                            */
);

@@ -3684,9 +3678,7 @@ 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                    */
);

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

#ifdef NONBE_FIX_1052_SBA_EXT
/*-------------------------------------------------------------------*
 * ivas_sba_spar_sid_bitlen()
 *
@@ -180,7 +179,6 @@ int16_t ivas_sba_spar_sid_bitlen(

    return num_bits;
}
#endif

/*-------------------------------------------------------------------*
 * ivas_sba_get_nchan_metadata()
+0 −1
Original line number Diff line number Diff line
@@ -180,7 +180,6 @@
/* all switches in this category should start with "NONBE_" */

#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_1052_SBA_EXT                          /* Dlb: SBA external output support */
#define NONBE_FIX_1069_SVD_TUNING                       /* FhG: issue 1069: tune SVD constants */
#define NONBE_FIX_1087_OOB_SBA_DTX_RS                   /* VA: issue 1087: Extend the length of the buffer for MCT decoding to avoid out-of-bound writing in SBA SID bitrate switching decoding */
#define NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS            /* FhG: fix for #1091, fix limit calculation for the regularized inverse of Kx to avoid bursts in very low signals */
+0 −14
Original line number Diff line number Diff line
@@ -1012,9 +1012,7 @@ 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            */
)
{
@@ -1048,11 +1046,7 @@ 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++ )
            {
@@ -1101,11 +1095,7 @@ 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 )++;
@@ -1125,11 +1115,7 @@ 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];
+0 −10
Original line number Diff line number Diff line
@@ -54,12 +54,9 @@ static ivas_error ivas_read_format( Decoder_Struct *st_ivas, int16_t *num_bits_r

static ivas_error doSanityChecks_IVAS( Decoder_Struct *st_ivas );

#ifdef NONBE_FIX_1052_SBA_EXT
static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_order );
#endif


#ifdef NONBE_FIX_1052_SBA_EXT
static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_order )
{
    AUDIO_CONFIG output_config;
@@ -80,7 +77,6 @@ static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_ord
    }
    return output_config;
}
#endif

/*-------------------------------------------------------------------*
 * ivas_dec_setup()
@@ -168,13 +164,11 @@ ivas_error ivas_dec_setup(
            /* read Ambisonic (SBA) order */
            st_ivas->sba_order = st_ivas->bit_stream[num_bits_read + 1];
            st_ivas->sba_order += 2 * st_ivas->bit_stream[num_bits_read];
#ifdef NONBE_FIX_1052_SBA_EXT
            if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
            {
                st_ivas->hDecoderConfig->output_config = ivas_set_output_config_from_sba_order( st_ivas->sba_order );
                st_ivas->hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->hDecoderConfig->output_config );
            }
#endif

            num_bits_read += SBA_ORDER_BITS;
            if ( st_ivas->ini_frame > 0 && ivas_total_brate != st_ivas->last_active_ivas_total_brate && ivas_total_brate > IVAS_SID_5k2 )
@@ -451,13 +445,11 @@ ivas_error ivas_dec_setup(
                break;
        }

#ifdef NONBE_FIX_1052_SBA_EXT
        if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
        {
            st_ivas->hDecoderConfig->output_config = ivas_set_output_config_from_sba_order( st_ivas->sba_order );
            st_ivas->hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->hDecoderConfig->output_config );
        }
#endif

        if ( st_ivas->ini_frame > 0 && st_ivas->ivas_format == SBA_FORMAT )
        {
@@ -721,7 +713,6 @@ static ivas_error ivas_read_format(

        if ( st_ivas->ivas_format == SBA_FORMAT )
        {
#ifdef NONBE_FIX_1052_SBA_EXT
            /* read Ambisonic (SBA) planar flag */
            st_ivas->sba_planar = st_ivas->bit_stream[*num_bits_read];
            *num_bits_read += SBA_PLANAR_BITS;
@@ -730,7 +721,6 @@ static ivas_error ivas_read_format(
            st_ivas->sba_order = st_ivas->bit_stream[*num_bits_read + 1];
            st_ivas->sba_order += 2 * st_ivas->bit_stream[*num_bits_read];
            *num_bits_read += SBA_ORDER_BITS;
#endif
            if ( st_ivas->sba_analysis_order == 0 )
            {
                st_ivas->sba_analysis_order = SBA_FOA_ORDER;
Loading