Commit f17c254f authored by Mohammadreza Naghibzadeh's avatar Mohammadreza Naghibzadeh
Browse files

Merge remote-tracking branch 'origin/main' into 1793-fix-decoder-mc-to-mono-output-scaling

parents 1ad638fd 34259621
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -605,7 +605,7 @@ int main(
            fprintf( stderr, "\nError in reading Custom loudspeaker file %s: %s\n\n", arg.customLsSetupFilename, CustomLoudspeakerLayout_getError( lsCustomError ) );
            goto cleanup;
        }
        for ( int i = 0; i < IVAS_MAX_OUTPUT_CHANNELS; i++ )
        for ( int16_t i = 0; i < IVAS_MAX_LS_CHANNELS; i++ )
        {
            hLsCustomData.azimuth_fx[i] = (Word32) ( hLsCustomData.azimuth[i] * ( 1u << 22 ) );
            hLsCustomData.elevation_fx[i] = (Word32) ( hLsCustomData.elevation[i] * ( 1u << 22 ) );
+15 −15
Original line number Diff line number Diff line
@@ -760,8 +760,8 @@ int main(
    RotFileReader *headRotReader = NULL;
    RotFileReader *externalOrientationFileReader = NULL;
    RotFileReader *referenceRotReader = NULL;
    IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[IVAS_MAX_INPUT_CHANNELS];
    IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[IVAS_MAX_INPUT_CHANNELS];
    IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[RENDERER_MAX_INPUT_CHANNELS];
    IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[RENDERER_MAX_INPUT_CHANNELS];
    int16_t cldfb_in_flag, CLDFBframeSize_smpls;
    SplitRendBFIFileReader *splitRendBFIReader = NULL;
    Vector3PairFileReader *referenceVectorReader = NULL;
@@ -1242,8 +1242,8 @@ int main(
    /* Set up output custom layout configuration */
    if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM )
    {
        floatToFixed_arrL_app( args.outConfig.outSetupCustom.azimuth, args.outConfig.outSetupCustom.azimuth_fx, Q22, IVAS_MAX_OUTPUT_CHANNELS );
        floatToFixed_arrL_app( args.outConfig.outSetupCustom.elevation, args.outConfig.outSetupCustom.elevation_fx, Q22, IVAS_MAX_OUTPUT_CHANNELS );
        floatToFixed_arrL_app( args.outConfig.outSetupCustom.azimuth, args.outConfig.outSetupCustom.azimuth_fx, Q22, RENDERER_MAX_OUTPUT_CHANNELS );
        floatToFixed_arrL_app( args.outConfig.outSetupCustom.elevation, args.outConfig.outSetupCustom.elevation_fx, Q22, RENDERER_MAX_OUTPUT_CHANNELS );
        if ( ( error = IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( hIvasRend, args.outConfig.outSetupCustom ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError in IVAS_REND_ConfigureCustomOutputLoudspeakerLayout(): %s\n", ivas_error_to_string( error ) );
@@ -1341,8 +1341,8 @@ int main(

        if ( args.inConfig.multiChannelBuses[i].audioConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM )
        {
            floatToFixed_arrL_app( args.inConfig.inSetupCustom.azimuth, args.inConfig.inSetupCustom.azimuth_fx, Q22, IVAS_MAX_OUTPUT_CHANNELS );
            floatToFixed_arrL_app( args.inConfig.inSetupCustom.elevation, args.inConfig.inSetupCustom.elevation_fx, Q22, IVAS_MAX_OUTPUT_CHANNELS );
            floatToFixed_arrL_app( args.inConfig.inSetupCustom.azimuth, args.inConfig.inSetupCustom.azimuth_fx, Q22, RENDERER_MAX_OUTPUT_CHANNELS );
            floatToFixed_arrL_app( args.inConfig.inSetupCustom.elevation, args.inConfig.inSetupCustom.elevation_fx, Q22, RENDERER_MAX_OUTPUT_CHANNELS );
            if ( ( error = IVAS_REND_ConfigureCustomInputLoudspeakerLayout( hIvasRend, mcIds[i], args.inConfig.inSetupCustom ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError in IVAS_REND_ConfigureCustomInputLoudspeakerLayout(): %s\n", ivas_error_to_string( error ) );
@@ -1359,7 +1359,7 @@ int main(
                args.lfePanningEnabled = false;
            }

            FOR( Word16 k = 0; k < IVAS_MAX_OUTPUT_CHANNELS; k++ )
            FOR( Word16 k = 0; k < RENDERER_MAX_OUTPUT_CHANNELS; k++ )
            {
                ( *lfePanMatrix_fx )[k] = (Word32) ( ( *lfePanMatrix )[k] * ( 1u << 31 ) );
            }
@@ -1394,7 +1394,7 @@ int main(
                        goto cleanup;
                    }

                    FOR( Word16 k = 0; k < IVAS_MAX_OUTPUT_CHANNELS; k++ )
                    FOR( Word16 k = 0; k < RENDERER_MAX_OUTPUT_CHANNELS; k++ )
                    {
                        ( *lfePanMatrix_fx )[k] = (Word32) ( ( *lfePanMatrix )[k] * ( 1u << 31 ) );
                    }
@@ -4058,7 +4058,7 @@ static ivas_error parseLfePanMtxFile(
       any subsequent issue in file reading will gracefully exit the function */
    for ( lfe_in = 0; lfe_in < RENDERER_MAX_INPUT_LFE_CHANNELS; lfe_in++ )
    {
        for ( i = 0; i < IVAS_MAX_OUTPUT_CHANNELS; i++ )
        for ( i = 0; i < RENDERER_MAX_OUTPUT_CHANNELS; i++ )
        {
            ( *lfePanMtx )[lfe_in][i] = 0.0f;
        }
@@ -4086,7 +4086,7 @@ static ivas_error parseLfePanMtxFile(
            {
                continue;
            }
            if ( ch_out > IVAS_MAX_OUTPUT_CHANNELS )
            if ( ch_out > RENDERER_MAX_OUTPUT_CHANNELS )
            {
                break;
            }
@@ -4128,13 +4128,13 @@ static void convertInputBuffer_fx(
    IF( cldfb_in_flag )
    {
        Word16 slotIdx, numCldfbBands, numFloatPcmSamples;
        Word32 fIn[IVAS_MAX_OUTPUT_CHANNELS][IVAS_MAX_FRAME_SIZE];
        Word32 fIn[RENDERER_MAX_OUTPUT_CHANNELS][IVAS_MAX_FRAME_SIZE];

        numFloatPcmSamples = numFloatSamplesPerChannel >> 1;
        numCldfbBands = numFloatPcmSamples / IVAS_CLDFB_NO_COL_MAX;

        /* CLDFB Analysis*/
        assert( numIntSamplesPerChannel <= IVAS_MAX_OUTPUT_CHANNELS * IVAS_MAX_FRAME_SIZE );
        assert( numIntSamplesPerChannel <= RENDERER_MAX_OUTPUT_CHANNELS * IVAS_MAX_FRAME_SIZE );
        FOR( smpl = 0; smpl < numFloatPcmSamples; ++smpl )
        {
            FOR( chnl = 0; chnl < numChannels; ++chnl )
@@ -4212,9 +4212,9 @@ static void convertOutputBuffer_fx(
    IF( cldfb_in_flag )
    {
        Word16 slotIdx, numCldfbBands, numPcmSamples, b, temp_out_q = 0;
        Word32 fIn[IVAS_MAX_OUTPUT_CHANNELS][IVAS_MAX_FRAME_SIZE];
        Word32 re[IVAS_MAX_OUTPUT_CHANNELS][IVAS_CLDFB_NO_COL_MAX][IVAS_CLDFB_NO_CHANNELS_MAX];
        Word32 im[IVAS_MAX_OUTPUT_CHANNELS][IVAS_CLDFB_NO_COL_MAX][IVAS_CLDFB_NO_CHANNELS_MAX];
        Word32 fIn[RENDERER_MAX_OUTPUT_CHANNELS][IVAS_MAX_FRAME_SIZE];
        Word32 re[RENDERER_MAX_OUTPUT_CHANNELS][IVAS_CLDFB_NO_COL_MAX][IVAS_CLDFB_NO_CHANNELS_MAX];
        Word32 im[RENDERER_MAX_OUTPUT_CHANNELS][IVAS_CLDFB_NO_COL_MAX][IVAS_CLDFB_NO_CHANNELS_MAX];

        numPcmSamples = numSamplesPerChannel >> 1;
        numCldfbBands = numPcmSamples / IVAS_CLDFB_NO_COL_MAX;
+6 −7
Original line number Diff line number Diff line
@@ -52,8 +52,7 @@
#define IVAS_MAX_BITS_PER_FRAME ( 512000 / IVAS_NUM_FRAMES_PER_SEC )                 /* maximum bits per frame; corresponds to maximum bitrate of 512 kbps */

#define IVAS_MAX_NUM_OBJECTS       4
#define IVAS_MAX_INPUT_CHANNELS    16
#define IVAS_MAX_OUTPUT_CHANNELS   16 /* Note: there is an exception for OSBA and EXT otuput where it can be 20 (HOA3 + 4 ISM channels) */
#define IVAS_MAX_LS_CHANNELS       16
#define IVAS_CLDFB_NO_COL_MAX      16
#define IVAS_CLDFB_NO_CHANNELS_MAX 60

@@ -206,12 +205,12 @@ typedef struct ivas_LS_setup_custom IVAS_LSSETUP_CUSTOM_STRUCT;
typedef struct _IVAS_LS_CUSTOM_LAYOUT
{
    Word16 num_spk;
    float azimuth[IVAS_MAX_OUTPUT_CHANNELS];
    float elevation[IVAS_MAX_OUTPUT_CHANNELS];
    Word32 azimuth_fx[IVAS_MAX_OUTPUT_CHANNELS];   // Q22
    Word32 elevation_fx[IVAS_MAX_OUTPUT_CHANNELS]; // Q22
    float azimuth[IVAS_MAX_LS_CHANNELS];
    float elevation[IVAS_MAX_LS_CHANNELS];
    Word32 azimuth_fx[IVAS_MAX_LS_CHANNELS];   // Q22
    Word32 elevation_fx[IVAS_MAX_LS_CHANNELS]; // Q22
    Word16 num_lfe;
    Word16 lfe_idx[IVAS_MAX_OUTPUT_CHANNELS];
    Word16 lfe_idx[IVAS_MAX_LS_CHANNELS];

} IVAS_CUSTOM_LS_DATA;

+5 −5
Original line number Diff line number Diff line
@@ -146,12 +146,12 @@ typedef enum
 * IVAS general constants
 *----------------------------------------------------------------------------------*/

#define MAX_INPUT_CHANNELS                      16                          /* Maximum number of input channels (HOA 3rd order), == IVAS_MAX_INPUT_CHANNELS */
#define MAX_INPUT_CHANNELS                      16                          /* Maximum number of input channels (HOA 3rd order or IVAS_MAX_LS_CHANNELS) without separate objects in combined formats */
#define MAX_TRANSPORT_CHANNELS                  12                          /* Maximum number of transport channels */
#define MAX_INTERN_CHANNELS                     16                          /* Maximum number of intern channels (HOA 3rd order) */
#define HEAD_ROTATION_HOA_ORDER                 3                           /* HOA 3rd order */
#define MAX_CICP_CHANNELS                       16                          /* max channels for loudspeaker layouts (16 for custom layouts)*/
#define MAX_OUTPUT_CHANNELS                     16                          /* Maximum number of output channels (HOA 3rd order) without separate objects in combined formats */
#define MAX_LS_CHANNELS                         16                          /* max channels for loudspeaker layouts (16 for custom layouts), == IVAS_MAX_LS_CHANNELS */
#define MAX_OUTPUT_CHANNELS                     16                          /* Maximum number of output channels (HOA 3rd order or IVAS_MAX_LS_CHANNELS) without separate objects in combined formats */
#define MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN     2                           /* Maximum number of output channels with non diegetic panning */

#define BINAURAL_CHANNELS                       2                           /* number of channels for binaural output configuration */
@@ -1563,7 +1563,7 @@ typedef enum
 * TD Binaural Object renderer
 *----------------------------------------------------------------------------------*/

#define MAX_NUM_TDREND_CHANNELS                 MAX_CICP_CHANNELS           /* max. number of channels in TD renderer (objects or loudspeaker channels) */
#define MAX_NUM_TDREND_CHANNELS                 MAX_LS_CHANNELS             /* max. number of channels in TD renderer (objects or loudspeaker channels) */

#define SFX_SPAT_BIN_MAX_NO_OF_OUTPUT_SAMPLES   288                         /* 288 = 6 msec @ 48 kHz.                                           */
#define HRTF_MODEL_N_SECTIONS                   3                           /* No. sections used in approximate evaluation of model             */
@@ -1672,7 +1672,7 @@ typedef enum

#define IVAS_MAX_FB_MIXER_OUT_CH                IVAS_SPAR_MAX_CH
#define IVAS_MAX_SPAR_FB_MIXER_IN_CH            IVAS_SPAR_MAX_CH
#define IVAS_MAX_FB_MIXER_IN_CH                 MAX_CICP_CHANNELS
#define IVAS_MAX_FB_MIXER_IN_CH                 MAX_LS_CHANNELS

#define MAX_NUM_BANDS_DIFF_NON48K               3

+3 −3
Original line number Diff line number Diff line
@@ -1282,9 +1282,9 @@ void ivas_ls_setup_conversion_process_mdct_fx(
void ivas_lssetupconversion_process_param_mc_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: LS setup conversion renderer handle */
    const Word16 num_timeslots,
    Word32 Cldfb_RealBuffer_InOut[MAX_CICP_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i/o: LS signals                                         */
    Word32 Cldfb_ImagBuffer_InOut[MAX_CICP_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i/o: LS signals                                         */
    Word16 channel_active[MAX_CICP_CHANNELS]                                                                  /* i  : bitmap indicating which output channels are active */
    Word32 Cldfb_RealBuffer_InOut[MAX_LS_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i/o: LS signals                                         */
    Word32 Cldfb_ImagBuffer_InOut[MAX_LS_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i/o: LS signals                                         */
    Word16 channel_active[MAX_LS_CHANNELS]                                                                  /* i  : bitmap indicating which output channels are active */
);

void convert_coeffs_to_higher_res_fx(
Loading