Commit 678d22c5 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

Merge branch 'main' of ssh://forge.3gpp.org:29419/sa4/audio/ivas-basop into...

Merge branch 'main' of ssh://forge.3gpp.org:29419/sa4/audio/ivas-basop into 2228-be_fix_1391_coverage_spar_dyn__channel-never-activated-in-basop-main
parents 3a3c2c99 929cd9ed
Loading
Loading
Loading
Loading
Loading
+0 −31
Original line number Diff line number Diff line
@@ -76,9 +76,7 @@
#define IVAS_MAX16B_FX  32767
#define IVAS_MIN16B_FX  ( -32768 )

#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS
#define OMASA_TDREND_MATCHING_GAIN_DB ( -2.0f )
#endif

#if !defined( DEBUGGING ) && !defined( WMOPS )
static
@@ -665,7 +663,6 @@ static void setupWithSingleFormatInput(
        positionProvider->numObjects = args.inConfig.numAudioObjects;
        for ( int16_t i = 0; i < positionProvider->numObjects; ++i )
        {
#ifdef FIX_1376_MISSING_ISM_METADATA
            /* Check if path to metadata file was given */
            if ( isEmptyString( args.inMetadataFilePaths[i] ) )
            {
@@ -674,18 +671,11 @@ static void setupWithSingleFormatInput(
            }

            /* It is allowed on CLI to have no metadata for an ISM input - skip opening if string contains "NULL" */
#else
            /* It is allowed on CLI to have no metadata for an ISM input - skip opening if string is empty or contains "NULL" */
#endif
            char charBuf[FILENAME_MAX];
            strncpy( charBuf, args.inMetadataFilePaths[i], min( FILENAME_MAX, RENDERER_MAX_CLI_ARG_LENGTH ) - 1 );
            charBuf[min( FILENAME_MAX, RENDERER_MAX_CLI_ARG_LENGTH ) - 1] = '\0';
            to_upper( charBuf );
#ifdef FIX_1376_MISSING_ISM_METADATA
            if ( strncmp( charBuf, "NULL", 4 ) == 0 )
#else
            if ( isEmptyString( args.inMetadataFilePaths[i] ) || strncmp( charBuf, "NULL", 4 ) == 0 )
#endif
            {
                continue;
            }
@@ -1304,30 +1294,22 @@ int main(
        }
    }

#ifndef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS
    /* Set the total number of objects */
#endif
    if ( args.inConfig.numAudioObjects > 0 )
    {
#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS
        /* Set the total number of objects */
#endif
        if ( ( error = IVAS_REND_SetTotalNumberOfObjects( hIvasRend, args.inConfig.numAudioObjects ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError in IVAS_REND_SetTotalNumberOfObjects(): %s\n", ivas_error_to_string( error ) );
            goto cleanup;
        }

#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS
        /* Set the metadata delay for objects */
#endif
        IF( ( error = IVAS_REND_SetIsmMetadataDelay( hIvasRend, args.syncMdDelay ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError in IVAS_REND_SetIsmMetadataDelay(): %s\n", ivas_error_to_string( error ) );
            goto cleanup;
        }

#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS

        /* For OMASA input and BINAURAL output, apply a gain to objects to match the loudness with MASA part */
        if ( args.inConfig.numMasaBuses > 0 && args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL )
@@ -1337,7 +1319,6 @@ int main(
                args.inConfig.audioObjects[i].gain_dB += OMASA_TDREND_MATCHING_GAIN_DB;
            }
        }
#endif
    }

    IVAS_REND_LfePanMtx lfePanMatrix;
@@ -1373,7 +1354,6 @@ int main(
    {
        masaIds[i] = 0u;
    }
#ifdef NONBE_1377_REND_DIRATT_CONF
#ifdef FIX_1377_HANDLE_ERROR_CODE
    if ( ( error = IVAS_REND_SetObjectIDs( hIvasRend ) ) != IVAS_ERR_OK )
    {
@@ -1382,7 +1362,6 @@ int main(
    }
#else
    IVAS_REND_SetObjectIDs( hIvasRend );
#endif
#endif

    for ( i = 0; i < args.inConfig.numMultiChannelBuses; ++i )
@@ -3893,20 +3872,10 @@ static void parseCombinedFormatInput(
        inConfig->numAmbisonicsBuses = 1;
        inConfig->ambisonicsBuses[0].audioConfig = audioConfig;
        inConfig->ambisonicsBuses[0].inputChannelIndex = inConfig->numAudioObjects;
#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS
        inConfig->ambisonicsBuses[0].gain_dB = 0.f;
#else
        inConfig->ambisonicsBuses[0].gain_dB = -6.f;
#endif
        *configString += 4;

        /* Modify input gain for objects too */
#ifndef NONBE_1352_HARMONIZE_OSBA_LOUDNESS
        for ( int16_t i = 0; i < inConfig->numAudioObjects; ++i )
        {
            inConfig->audioObjects[i].gain_dB = -6.f;
        }
#endif
    }
    else if ( audioConfig == IVAS_AUDIO_CONFIG_MASA1 || audioConfig == IVAS_AUDIO_CONFIG_MASA2 )
    {
+0 −2
Original line number Diff line number Diff line
@@ -668,9 +668,7 @@ enum
#define ACELP_TCX_TRANS_NS                  1250000                             /* Duration of the ACELP->TCX overlap - 1.25 ms */
#define L_FRAME_MAX                         L_FRAME48k                          /* Max 20ms frame size @48kHz              */
#define L_FRAME_PLUS                        1200                                /* Max frame size (long TCX frame)            */
#ifdef FIX_1320_STACK_CPE_DECODER
#define L_FRAME_PLUS_INTERNAL               800                                 /* Max frame size (long TCX frame) at maximum internal sampling rate */
#endif
#define L_MDCT_OVLP_MAX                     NS2SA( 48000, ACELP_LOOK_NS )       /* = Max mdct overlap */
#define N_TCX10_MAX                         480                                 /* Max size of TCX10 MDCT spectrum */
#define BITS_TEC                            1                                   /* number of bits for TEC */
+0 −5
Original line number Diff line number Diff line
@@ -192,13 +192,8 @@ typedef enum
#define JBM_CLDFB_SLOTS_IN_SUBFRAME_LOG2        2                           /* To be used for shift operation instead of division */
#define MAX_JBM_CLDFB_TIMESLOTS                 32
#define DEFAULT_JBM_CLDFB_TIMESLOTS             16
#ifdef JBM_MEMORY_OPT
#define MAX_JBM_L_FRAME48k                      ( IVAS_MAX_FRAME_SIZE * 2 ) /* 1920:  max. time-scaled frame buffer length (per channel) in samples */
#define MAX_JBM_L_FRAME_NS                      40000000L                   /* 40 ms: time-scaled frame size in ns, proportional to MAX_JBM_L_FRAME48k  */
#else
#define MAX_JBM_L_FRAME48k                      1920
#define MAX_JBM_L_FRAME_NS                      40000000L
#endif
#define MAX_SPAR_INTERNAL_CHANNELS              IVAS_SPAR_MAX_CH
#define MAX_CLDFB_DIGEST_CHANNELS               3                           /* == maximum of ParamISM TCs and ParamMC TCs */

+0 −4
Original line number Diff line number Diff line
@@ -128,9 +128,7 @@ typedef enum
    IVAS_ERR_BITSTREAM_READER_INVALID_FORMAT,
    IVAS_ERR_NO_FILE_OPEN,
    IVAS_ERR_SAMPLING_RATE_UNKNOWN,
#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK
    IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT,
#endif

    /*----------------------------------------*
     *    renderer (lib_rend only)            *
@@ -278,10 +276,8 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
            return "Invalid input format";
        case IVAS_ERR_INVALID_INDEX:
            return "Invalid index";
#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK
        case IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT:
            return "Euler angles were detected in the input but only Quaternions are supported";
#endif
        default:
            break;
    }
+0 −29
Original line number Diff line number Diff line
@@ -1044,12 +1044,7 @@ void ivas_omasa_separate_object_render_jbm_fx(
    const UWord16 nSamplesRendered,                             /* i  : number of samples rendered              */
    Word32 input_fx_in[][L_FRAME48k],                           /* i  : separated object signal                 */
    Word32 *output_fx[],                                        /* o  : rendered time signal                    */
#ifdef FIX_1330_JBM_MEMORY
    const Word16 subframes_rendered                             /* i  : number of subframes rendered            */
#else
    const Word16 subframes_rendered,                            /* i  : number of subframes rendered            */
    const Word16 slots_rendered                                 /* i  : number of CLDFB slots rendered          */
#endif
);

void get_panning_gain_fx(
@@ -2079,7 +2074,6 @@ UWord32 ivas_syn_output_fx(
    Word16 *synth_out                                           /* o  : integer 16 bits synthesis signal            */
);

#ifdef JBM_MEMORY_OPT
void ivas_buffer_interleaved_to_deinterleaved_fx(
    Word32 *audio,                                              /* i/o: audio buffer                                */
    const Word16 n_channels,                                    /* i  : number of channels                          */
@@ -2094,7 +2088,6 @@ void ivas_buffer_deinterleaved_to_interleaved_fx(
    Word32 *audio_out                                           /* o  : interleaved audio buffer                    */
);

#endif
void stereo_tcx_core_dec_fx(
    Decoder_State *st,                                          /* i/o: decoder state structure                     */
    const FRAME_MODE frameMode,                                 /* i  : Decoder frame mode                          */
@@ -2309,13 +2302,8 @@ void ivas_dirac_dec_render_sf_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                      */
    Word32 *output_fx[],                                        /* i/o: synthesized core-coder transport channels/DirAC output  */
    const Word16 nchan_transport,                               /* i  : number of transport channels                */
#ifdef FIX_1319_STACK_SBA_DECODER
    Word32 *pppQMfFrame_ts_re_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX],
    Word32 *pppQMfFrame_ts_im_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX]
#else
    Word32 *pppQMfFrame_ts_re_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX],
    Word32 *pppQMfFrame_ts_im_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX] 
#endif
);

void ivas_dirac_dec_render_fx(
@@ -4005,28 +3993,15 @@ void inverseMS_fx(
    const Word32 norm_fac                                       /* i  : normalization factor                     Q31*/
);

#ifndef JBM_MEMORY_OPT
void ivas_syn_output_f_fx(
    Word32 *synth[],                                            /* i/o: Word32 synthesis signal                     */
    const Word16 output_frame,                                  /* i  : output frame length (one channel)           */
    const Word16 n_channels,                                    /* i  : number of output channels                   */
    Word32 *synth_out                                           /* o  : integer 16 bits synthesis signal            */
);
#endif
ivas_error ivas_init_encoder_fx(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder structure                      */
);

ivas_error ivas_output_buff_dec_fx(
    Word32 *p_output_fx[],                                      /* i/o: output audio buffers                        */
#ifdef FIX_1330_JBM_MEMORY
    const Word16 nchan_out_buff,                                /* i  : number of output channels                   */
    const Word16 Opt_tsm,                                       /* i  : TSM option flag                             */
    DECODER_TC_BUFFER_HANDLE hTcBuffer                          /* i  : TSM buffer handle                           */
#else
    const Word16 nchan_out_buff_old,                            /* i  : previous frame number of output channels    */
    const Word16 nchan_out_buff                                 /* i  : number of output channels                   */
    #endif
);

ivas_error ivas_dec_get_format_fx(
@@ -6191,10 +6166,6 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                      */
    const Word16 nSamplesForRendering,                          /* i  : number of TC samples available for rendering                */
    Word16 *nSamplesResidual                                    /* o  : number of samples not fitting into the renderer grid and buffer for the next call*/
#ifndef JBM_MEMORY_OPT
    ,
    Word32 *data_fx                                             /* i/o: transport channels/output synthesis signal                  */
#endif
);

void ivas_dec_prepare_renderer_fx(
Loading