Commit 789b02f1 authored by PLAINSI's avatar PLAINSI
Browse files

Merge branch 'main' into...

Merge branch 'main' into 469-segfault-in-decoding-mc-to-mono-stereo-with-br-switching-and-fer-when-mc_paramupmix_mode-is
parents 1d48da58 33ba50d9
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -226,10 +226,18 @@ int main(
     * Open decoder handle
     *------------------------------------------------------------------------------------------*/

#ifdef FIX_439_OTR_PARAMS
#ifdef NON_DIEGETIC_PAN
    if ( ( error = IVAS_DEC_Open( &hIvasDec, arg.decMode ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_DEC_Open( &hIvasDec, arg.decMode, arg.no_diegetic_pan ) ) != IVAS_ERR_OK )
#endif
#else
#ifdef NON_DIEGETIC_PAN
    if ( ( error = IVAS_DEC_Open( &hIvasDec, arg.decMode, arg.orientation_tracking ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_DEC_Open( &hIvasDec, arg.decMode, arg.orientation_tracking, arg.no_diegetic_pan ) ) != IVAS_ERR_OK )
#endif
#endif
    {
        fprintf( stderr, "Open failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -395,10 +403,18 @@ int main(
     * Configure the decoder
     *------------------------------------------------------------------------------------------*/

#ifdef FIX_439_OTR_PARAMS
#ifdef NON_DIEGETIC_PAN
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.orientation_tracking, arg.renderConfigEnabled ) ) != IVAS_ERR_OK )
#endif
#else
#ifdef NON_DIEGETIC_PAN
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.renderConfigEnabled ) ) != IVAS_ERR_OK )
#endif
#endif
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
+42 −2
Original line number Diff line number Diff line
@@ -135,7 +135,11 @@ typedef struct
    char referenceRotationFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
    char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
    char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
#ifdef FIX_439_OTR_PARAMS
    int8_t orientation_tracking;
#else
    int8_t orientationTracking;
#endif
#ifdef NON_DIEGETIC_PAN
    int16_t nonDiegeticPan;
    float nonDiegeticPanGain;
@@ -732,7 +736,11 @@ int main(
        }
    }

#ifdef FIX_439_OTR_PARAMS
    if ( ( error = IVAS_REND_SetOrientationTrackingMode( hIvasRend, args.orientation_tracking ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_REND_SetOrientationTrackingMode( hIvasRend, args.orientationTracking ) ) != IVAS_ERR_OK )
#endif
    {
        return error;
    }
@@ -1424,30 +1432,54 @@ static bool parseDiegeticPan(

static bool parseOrientationTracking(
    char *value,
    int8_t *tracking_type )
#ifdef FIX_439_OTR_PARAMS
    int8_t *orientation_tracking
#else
    int8_t *tracking_type
#endif
)
{

    to_upper( value );

    if ( strcmp( value, "NONE" ) == 0 )
    {
#ifdef FIX_439_OTR_PARAMS
        *orientation_tracking = HEAD_ORIENT_TRK_NONE;
#else
        *tracking_type = IVAS_ORIENT_TRK_NONE;
#endif
    }
    else if ( strcmp( value, "REF" ) == 0 )
    {
#ifdef FIX_439_OTR_PARAMS
        *orientation_tracking = HEAD_ORIENT_TRK_REF;
#else
        *tracking_type = IVAS_ORIENT_TRK_REF;
#endif
    }
    else if ( strcmp( value, "AVG" ) == 0 )
    {
#ifdef FIX_439_OTR_PARAMS
        *orientation_tracking = HEAD_ORIENT_TRK_AVG;
#else
        *tracking_type = IVAS_ORIENT_TRK_AVG;
#endif
    }
    else if ( strcmp( value, "REF_VEC" ) == 0 )
    {
#ifdef FIX_439_OTR_PARAMS
        *orientation_tracking = HEAD_ORIENT_TRK_REF_VEC;
#else
        *tracking_type = IVAS_ORIENT_TRK_REF_VEC;
#endif
    }
    else if ( strcmp( value, "REF_VEC_LEV" ) == 0 )
    {
#ifdef FIX_439_OTR_PARAMS
        *orientation_tracking = HEAD_ORIENT_TRK_REF_VEC_LEV;
#else
        *tracking_type = IVAS_ORIENT_TRK_REF_VEC_LEV;
#endif
    }
    else
    {
@@ -1671,7 +1703,11 @@ static CmdlnArgs defaultArgs(
    clearString( args.customHrtfFilePath );
    clearString( args.renderConfigFilePath );

#ifdef FIX_439_OTR_PARAMS
    args.orientation_tracking = HEAD_ORIENT_TRK_NONE;
#else
    args.orientationTracking = IVAS_ORIENT_TRK_NONE;
#endif
#ifdef NON_DIEGETIC_PAN
    args.nonDiegeticPan = 0;
    args.nonDiegeticPanGain = 0.f;
@@ -1784,7 +1820,11 @@ static void parseOption(
            break;
        case CmdLnOptionId_orientationTracking:
            assert( numOptionValues == 1 );
#ifdef FIX_439_OTR_PARAMS
            if ( !parseOrientationTracking( optionValues[0], &args->orientation_tracking ) )
#else
            if ( !parseOrientationTracking( optionValues[0], &args->orientationTracking ) )
#endif
            {
                fprintf( stderr, "Unknown option for orientation tracking: %s\n", optionValues[0] );
                exit( -1 );
+10 −0
Original line number Diff line number Diff line
@@ -96,6 +96,16 @@ typedef struct
    float x, y, z;
} IVAS_VECTOR3;

#ifdef FIX_439_OTR_PARAMS
typedef enum
{
    HEAD_ORIENT_TRK_NONE,
    HEAD_ORIENT_TRK_REF,
    HEAD_ORIENT_TRK_AVG,
    HEAD_ORIENT_TRK_REF_VEC,
    HEAD_ORIENT_TRK_REF_VEC_LEV
} HEAD_ORIENT_TRK_T;
#endif

typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE;
typedef struct ivas_masa_decoder_ext_out_meta_struct *MASA_DECODER_EXT_OUT_META_HANDLE;
+5 −1
Original line number Diff line number Diff line
@@ -885,6 +885,9 @@ enum fea_names
#define MDCT_ST_PLC_FADEOUT_MIN_NOISE_NRG       0.001f
#define MDCT_ST_PLC_FADEOUT_MAX_CONC_FRAME      2 * FRAMES_PER_SEC
#define MDCT_ST_PLC_FADEOUT_TO_ZERO_LEN         20
#ifdef FIX_MDCT_ST_PLC_FADEOUT_DELAY
#define MDCT_ST_PLC_FADEOUT_DELAY_4_LSP_FADE    3
#endif

typedef enum {
    EQUAL_CORES,
@@ -1639,6 +1642,7 @@ typedef enum
} SFX_OpMode_t;


#ifndef FIX_439_OTR_PARAMS
/*----------------------------------------------------------------------------------*
 * Orientation tracking constants
 *----------------------------------------------------------------------------------*/
@@ -1659,7 +1663,7 @@ typedef enum
    OTR_TRACKING_REF_VEC = IVAS_ORIENT_TRK_REF_VEC, /* track orientation relative to external reference vector */
    OTR_TRACKING_REF_VEC_LEV = IVAS_ORIENT_TRK_REF_VEC_LEV  /* track orientation relative to level component of external reference vector */
} OTR_TRACKING_T;

#endif

/*----------------------------------------------------------------------------------*
 * Reverberator constants
+12 −0
Original line number Diff line number Diff line
@@ -1322,6 +1322,10 @@ void stereo_dft_dec(
    const int16_t cross_fade_start_offset,                      /* i  : SPAR mixer delay compensation       */
    const int32_t output_Fs,                                    /* i  : Fs for delay calculation            */
    const int16_t nchan_transport                               /* i  : number of transpor channels         */
#ifdef FIX_STEREO_474
    ,
    const int16_t num_md_sub_frames                             /* i:  number of MD subframes              */
#endif
);

void stereo_dft_res_ecu(
@@ -1555,6 +1559,10 @@ int16_t read_BS_adapt_GR_sg(
void stereo_dft_hybrid_ITD_flag(
    STEREO_DFT_CONFIG_DATA_HANDLE hConfig,                      /* o  : DFT stereo configuration                */
    const int32_t input_Fs                                      /* i  : CPE element sampling rate               */
#ifdef HYBRID_ITD_MAX
    ,
    const int16_t hybrid_itd_max                                /* i  : flag for hybrid ITD for very large ITDs */
#endif
);

void stereo_dft_enc_compute_itd(
@@ -3561,6 +3569,10 @@ void ivas_sba_dirac_stereo_smooth_parameters(
    ivas_spar_md_dec_state_t *hMdDec,                           /* i/o: SPAR MD handle for upmixing             */
    const int16_t cross_fade_start_offset,                      /* i  : SPAR mixer delay compensation           */
    const int32_t output_Fs                                     /* i  : Fs for delay calculation                */
#ifdef FIX_STEREO_474
    ,
    const int16_t num_md_sub_frames                             /* i : number of subframes in mixing matrix  */
#endif
);

void ivas_sba2mc_cldfb(
Loading