Commit d3358cd1 authored by Marek Szczerba's avatar Marek Szczerba
Browse files

Merge branch 'main' into...

Merge branch 'main' into 1861-basop-assert-in-binaural_room_reverb-decoding-with-render-config-and-head-rotation
parents 91332abd 04c6120f
Loading
Loading
Loading
Loading
Loading
+30 −18
Original line number Diff line number Diff line
@@ -2501,7 +2501,7 @@ Word16 ivas_sba_get_nchan_metadata_fx(
);

#ifdef NONBE_FIX_1052_SBA_EXT
/*! r: number of bits in SPAR SID frame */
/*! r: number of bits in SBQ SID frame */
Word16 ivas_sba_spar_sid_bitlen_fx(
    const Word16 nchan_transport /* i  : number of transport channels            */
);
@@ -3500,7 +3500,9 @@ ivas_error ivas_qmetadata_enc_encode_hr_384_512_fx(
    BSTR_ENC_HANDLE hMetaData,  /* i/o: metadata bitstream handle */
    IVAS_QMETADATA *hQMetaData, /* i/o: metadata handle           */
    const Word16 bits_sph_idx,
    const Word16 bits_sp_coh );
    const Word16 bits_sp_coh 
);

void ivas_merge_masa_metadata_fx(
    MASA_ENCODER_HANDLE hMasa,           /* i/o: MASA enc handle. source for MASA metadata and combined metadata will be here */
    OMASA_SPATIAL_META_HANDLE hOMasaMeta /* i  : ISM-object metadata to be merged with the MASA metadata                      */
@@ -3522,12 +3524,14 @@ void ivas_param_mc_enc_fx(
    Word32 *data_f_fx[],       /* i/o: input/transport MC data                     Q11 */
    const Word16 input_frame   /* i  : input frame length                                   */
);

void ivas_merge_masa_transports_fx(
    Word32 data_in_f1_fx[][L_FRAME48k], // Qx
    Word32 *data_in_f2_fx[],            // Qx
    Word32 *data_out_f_fx[],            // Qx
    const Word16 input_frame,
    const Word16 num_transport_channels );
    const Word16 num_transport_channels 
);

void ivas_param_mc_enc_close_fx(
    PARAM_MC_ENC_HANDLE *hParamMC, /* i/o: Parametric MC encoder handle                        */
@@ -3626,11 +3630,18 @@ ivas_error ivas_masa_encode_fx(
void ivas_write_format_sid_fx(
    const IVAS_FORMAT ivas_format,                      /* i  : IVAS format                             */
    const Word16 element_mode,                          /* i  : element bitrate                         */
#ifdef NONBE_FIX_1052_SBA_EXT_FIX
    BSTR_ENC_HANDLE hBstr,                              /* i/o: encoder bitstream handle                */
    const Word16 sba_order,                             /* i  : Ambisonic (SBA) order                   */
    const Word16 sba_planar                             /* i  : SBA planar flag                         */
#else
BSTR_ENC_HANDLE hBstr          /* i/o: encoder bitstream handle                */
#endif
);

void ivas_write_format_fx( /* i/o: IVAS encoder structure					*/
                           Encoder_Struct *st_ivas );
void ivas_write_format_fx( 
    Encoder_Struct *st_ivas                             /* i/o: IVAS encoder structure					*/
);

ivas_error create_sce_enc_fx(
    Encoder_Struct *st_ivas,                            /* i/o: IVAS encoder structure      */
@@ -5851,7 +5862,8 @@ ivas_error ivas_dirac_enc_fx(
    const Word16 nchan_transport,  /* i  : number of transport channels            */
#endif
    const Word16 hodirac_flag,     /* i  : hodirac flag                            */
    const Word16 shift );
    const Word16 shift 
);

ivas_error ivas_spar_md_enc_init_fx(
    ivas_spar_md_enc_state_t *hMdEnc,           /* o  : MD encoder handle        */
+3 −2
Original line number Diff line number Diff line
@@ -171,10 +171,10 @@ Word16 ivas_sba_get_nchan_fx(
/*-------------------------------------------------------------------*
 * ivas_sba_spar_sid_bitlen_fx()
 *
 * Get number of bits in SPAR SID frame
 * Get number of bits in SBA SID frame
 *-------------------------------------------------------------------*/

/*! r: number of bits in SPAR SID frame */
/*! r: number of bits in SBA SID frame */
Word16 ivas_sba_spar_sid_bitlen_fx(
    const Word16 nchan_transport /* i  : number of transport channels            */
)
@@ -191,6 +191,7 @@ Word16 ivas_sba_spar_sid_bitlen_fx(
}
#endif


/*-------------------------------------------------------------------*
 * ivas_sba_get_nchan_metadata()
 *
+1 −1
Original line number Diff line number Diff line
@@ -122,7 +122,6 @@
#define NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR            /* Nok: issue 1074 fixing number of objects signaling in OMASA low rate */
#define FIX_1222_OMASA_DEC_CHANNEL_BUFFERS              /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */
#define NONBE_FIX_1130_DIV_ZERO_LEV_DUR                 /* VA: issue 1130: avoid div by zero in L-D by thresholding R[0] to a min value of 100.0 */

#define FIX_1111_TDM_LSP_BUFFER                         /* VA: issue 1111: remove unused buffer `tdm_lspQ_PCh[]' */
#define NONBE_1325_TD_STEREO_QUANT_LSF_SEC              /* Nokia: issue 1325: fix for usage of active_cnt variable in TD stereo LSFQ */
#define NONBE_1329_FIX_OSBA_CRASH                       /* FhG: issue 1329: prevent assert when bit budget is low*/
@@ -130,6 +129,7 @@
#define FIX_1138_SBA_EXT_ERROR_PRINTOUT                 /* VA: issue 1138: Fix SBA EXT output call of audioCfg2channels() */
#define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART             /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */
#define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR            /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */
#define NONBE_FIX_1052_SBA_EXT_FIX                      /* VA: SBA external output support fix - do not overwrite "output_config" parameter */

/* #################### End BASOP porting switches ############################ */

+3 −12
Original line number Diff line number Diff line
@@ -1292,6 +1292,7 @@ void ivas_dirac_dec_read_BS_fx(
                    set32_fx( hQMetaData->q_direction[0].band_data[b].elevation_fx, 0, MAX_PARAM_SPATIAL_SUBFRAMES );
                }
            }

#ifdef NONBE_FIX_1052_SBA_EXT
            *nb_bits = add( *nb_bits, ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), nchan_transport, NULL, SBA_FORMAT ) );
            move16();
@@ -1393,6 +1394,7 @@ void ivas_dirac_dec_read_BS_fx(
        *nb_bits = add( *nb_bits, ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), 0, NULL, SBA_FORMAT ) );
        move16();
#endif

        FOR( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ )
        {
            hQMetaData->q_direction[0].band_data[orig_dirac_bands - 1].azimuth_fx[i] = hQMetaData->q_direction[0].band_data[1].azimuth_fx[0];
@@ -2269,16 +2271,6 @@ void ivas_dirac_dec_render_sf_fx(
    move16();
    move16();


    FOR( i = 0; i < MAX_OUTPUT_CHANNELS; i++ )
    {
        FOR( Word16 j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ )
        {
            set32_fx( Cldfb_RealBuffer_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX );
            set32_fx( Cldfb_ImagBuffer_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX );
        }
    }

    /* local copies of azi, ele, diffuseness */
    Word16 azimuth[CLDFB_NO_CHANNELS_MAX];
    Word16 elevation[CLDFB_NO_CHANNELS_MAX];
@@ -2325,7 +2317,6 @@ void ivas_dirac_dec_render_sf_fx(
    push_wmops( "ivas_dirac_dec_render" );

    /* Initialize aux buffers */

    FOR( i = 0; i < MAX_OUTPUT_CHANNELS; i++ )
    {
        FOR( Word16 j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ )
+30 −2
Original line number Diff line number Diff line
@@ -408,6 +408,7 @@ ivas_error ivas_dec_setup(
            move16();
            st_ivas->sba_order = add( st_ivas->sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) );
            move16();
#ifndef NONBE_FIX_1052_SBA_EXT_FIX
#ifdef NONBE_FIX_1052_SBA_EXT
            IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) )
            {
@@ -419,8 +420,9 @@ ivas_error ivas_dec_setup(
                st_ivas->hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->hDecoderConfig->output_config );
            }
#endif

#endif
            num_bits_read = add( num_bits_read, SBA_ORDER_BITS );

            test();
            test();
            IF( st_ivas->ini_frame > 0 && NE_32( ivas_total_brate, st_ivas->last_active_ivas_total_brate ) && GT_32( ivas_total_brate, IVAS_SID_5k2 ) )
@@ -733,6 +735,7 @@ ivas_error ivas_dec_setup(
                BREAK;
        }

#ifndef NONBE_FIX_1052_SBA_EXT_FIX
#ifdef NONBE_FIX_1052_SBA_EXT
        IF( EQ_32( st_ivas->ivas_format, SBA_FORMAT ) && EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) )
        {
@@ -744,7 +747,7 @@ ivas_error ivas_dec_setup(
            st_ivas->hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->hDecoderConfig->output_config );
        }
#endif

#endif
        test();
        IF( st_ivas->ini_frame > 0 && EQ_32( st_ivas->ivas_format, SBA_FORMAT ) )
        {
@@ -1098,6 +1101,7 @@ static ivas_error ivas_read_format(
            *num_bits_read = add( *num_bits_read, SBA_ORDER_BITS );
            move16();
#endif

            if ( st_ivas->sba_analysis_order == 0 )
            {
                st_ivas->sba_analysis_order = SBA_FOA_ORDER;
@@ -1195,11 +1199,13 @@ void copy_decoder_config(
    return;
}


/*-------------------------------------------------------------------*
 * ivas_init_decoder_front()
 *
 * Set decoder parameters to initial values
 *-------------------------------------------------------------------*/

ivas_error ivas_init_decoder_front(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder structure        */
)
@@ -1216,6 +1222,10 @@ ivas_error ivas_init_decoder_front(
    move16();
    st_ivas->nCPE = 0;
    move16();
#ifdef NONBE_FIX_1052_SBA_EXT_FIX
    st_ivas->nchan_ism = 0;
    move16();
#endif
    st_ivas->nCPE_old = 0;
    move16();
    st_ivas->nchan_transport = -1;
@@ -1379,10 +1389,13 @@ ivas_error ivas_init_decoder_fx(
    move32();
    st_ivas->last_active_ivas_total_brate = ivas_total_brate;
    move32();

    /*-----------------------------------------------------------------*
     * Set number of output channels for EXTERNAL output config.
     *-----------------------------------------------------------------*/

    test();
    test();
    IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) )
    {
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
@@ -1397,7 +1410,11 @@ ivas_error ivas_init_decoder_fx(
        {
            hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->transport_config );
        }
#ifdef NONBE_FIX_1052_SBA_EXT_FIX
        ELSE IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) || EQ_32( st_ivas->ivas_format, SBA_FORMAT ) )
#else
        ELSE IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) )
#endif
#else
        IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) )
#endif
@@ -1437,6 +1454,8 @@ ivas_error ivas_init_decoder_fx(
    st_ivas->intern_config = output_config;
    move32();

    test();
    test();
#ifdef FIX_1052_EXT_OUTPUT
    IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) && EQ_32( st_ivas->ivas_format, MC_FORMAT ) )
    {
@@ -1445,7 +1464,11 @@ ivas_error ivas_init_decoder_fx(
        move32();
    }
#ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER
#ifdef NONBE_FIX_1052_SBA_EXT_FIX
    ELSE IF( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && ( st_ivas->ivas_format == SBA_ISM_FORMAT || st_ivas->ivas_format == SBA_FORMAT ) )
#else
    ELSE IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) && EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) )
#endif
    {
        st_ivas->intern_config = ivas_set_audio_config_from_sba_order( st_ivas->sba_order );
        ivas_output_init( &( st_ivas->hOutSetup ), st_ivas->intern_config );
@@ -1741,7 +1764,12 @@ ivas_error ivas_init_decoder_fx(

        test();
        test();
#ifdef NONBE_FIX_1052_SBA_EXT_FIX
        test();
        IF( NE_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_FOA ) && NE_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_STEREO ) && NE_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_MONO ) && !( EQ_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) && EQ_32( st_ivas->intern_config, IVAS_AUDIO_CONFIG_FOA ) ) )
#else
        IF( NE_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_FOA ) && NE_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_STEREO ) && NE_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_MONO ) )
#endif
        {
            IF( NE_32( ( error = ivas_dirac_dec_config_fx( st_ivas, DIRAC_OPEN ) ), IVAS_ERR_OK ) )
            {
Loading