Skip to content
Commits on Source (138)
...@@ -1486,6 +1486,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1486,6 +1486,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: Too low number of ISM channels specified!\n\n" ); fprintf( stderr, "Error: Too low number of ISM channels specified!\n\n" );
usage_enc(); usage_enc();
return false;
} }
else else
{ {
...@@ -1497,6 +1498,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1497,6 +1498,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: Too high number of ISM channels!\n\n" ); fprintf( stderr, "Error: Too high number of ISM channels!\n\n" );
usage_enc(); usage_enc();
return false;
} }
} }
} }
...@@ -1504,6 +1506,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1504,6 +1506,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: Number of ISM channels not specified!\n\n" ); fprintf( stderr, "Error: Number of ISM channels not specified!\n\n" );
usage_enc(); usage_enc();
return false;
} }
if ( i < argc - 4 ) if ( i < argc - 4 )
{ {
...@@ -1523,7 +1526,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1523,7 +1526,7 @@ static bool parseCmdlIVAS_enc(
default: default:
fprintf( stderr, "Error: MASA channels must be 1 or 2.\n\n" ); fprintf( stderr, "Error: MASA channels must be 1 or 2.\n\n" );
usage_enc(); usage_enc();
break; return false;
} }
} }
...@@ -1548,6 +1551,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1548,6 +1551,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: not enough arguments\n\n" ); fprintf( stderr, "Error: not enough arguments\n\n" );
usage_enc(); usage_enc();
return false;
} }
} }
...@@ -1560,6 +1564,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1560,6 +1564,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: not enough MASA arguments\n\n" ); fprintf( stderr, "Error: not enough MASA arguments\n\n" );
usage_enc(); usage_enc();
return false;
} }
} }
else if ( strcmp( to_upper( argv[i] ), "-ISM_SBA" ) == 0 ) else if ( strcmp( to_upper( argv[i] ), "-ISM_SBA" ) == 0 )
...@@ -1578,6 +1583,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1578,6 +1583,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: Too low number of ISM channels specified!\n\n" ); fprintf( stderr, "Error: Too low number of ISM channels specified!\n\n" );
usage_enc(); usage_enc();
return false;
} }
else else
{ {
...@@ -1589,6 +1595,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1589,6 +1595,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: Too high number of ISM channels!\n\n" ); fprintf( stderr, "Error: Too high number of ISM channels!\n\n" );
usage_enc(); usage_enc();
return false;
} }
} }
} }
...@@ -1596,6 +1603,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1596,6 +1603,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: Number of ISM channels not specified!\n\n" ); fprintf( stderr, "Error: Number of ISM channels not specified!\n\n" );
usage_enc(); usage_enc();
return false;
} }
if ( i < argc - 4 ) if ( i < argc - 4 )
...@@ -1647,6 +1655,7 @@ static bool parseCmdlIVAS_enc( ...@@ -1647,6 +1655,7 @@ static bool parseCmdlIVAS_enc(
{ {
fprintf( stderr, "Error: not enough arguments\n\n" ); fprintf( stderr, "Error: not enough arguments\n\n" );
usage_enc(); usage_enc();
return false;
} }
} }
} }
......
...@@ -1167,7 +1167,18 @@ int main( ...@@ -1167,7 +1167,18 @@ int main(
fprintf( stderr, "\nFailed to read renderer configuration from file %s\n", args.renderConfigFilePath ); fprintf( stderr, "\nFailed to read renderer configuration from file %s\n", args.renderConfigFilePath );
goto cleanup; goto cleanup;
} }
#ifdef NONBE_FIX_1337_MISSING_DIRECTIVITY_DISTATT_EXTREND
if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, args.directivityPatternId, renderConfig.directivity_fx ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", args.directivityPatternId[0], args.directivityPatternId[1], args.directivityPatternId[2], args.directivityPatternId[3] );
goto cleanup;
}
if ( ( error = RenderConfigReader_getDistanceAttenuation( renderConfigReader, renderConfig.distAtt_fx ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Failed to get Distance Attenuation \n\n" );
goto cleanup;
}
#endif
if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
{ {
#ifdef FIX_1053_REVERB_RECONFIGURATION #ifdef FIX_1053_REVERB_RECONFIGURATION
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
#define NUM_SAMPLES_320 (320) #define NUM_SAMPLES_320 (320)
#define NUM_SAMPLES_160 (160) #define NUM_SAMPLES_160 (160)
#define L_SUBFRAME_48k (240) #define L_SUBFRAME_48k (240)
#define L_SUBFRAME_32k (180) #define L_SUBFRAME_32k (160)
#define L_SUBFRAME_16k (80) #define L_SUBFRAME_16k (80)
#define L_SUBFRAME_8k (40) #define L_SUBFRAME_8k (40)
#define Q31_BY_NUM_SAMPLES_960 ( 2239294 ) /* 1/959 in Q31 */ #define Q31_BY_NUM_SAMPLES_960 ( 2239294 ) /* 1/959 in Q31 */
......
...@@ -317,11 +317,6 @@ typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG ...@@ -317,11 +317,6 @@ typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG
{ {
Word16 override; Word16 override;
Word16 nBands; /* Number of frequency bands for which reverb properties are provided, integer, range [2..256] */ Word16 nBands; /* Number of frequency bands for which reverb properties are provided, integer, range [2..256] */
float pFc_input[IVAS_CLDFB_NO_CHANNELS_MAX]; /* Center frequencies for which following values are provided: */
float pAcoustic_rt60[IVAS_CLDFB_NO_CHANNELS_MAX]; /* - The room's T60 per center frequency */
float pAcoustic_dsr[IVAS_CLDFB_NO_CHANNELS_MAX]; /* - The room's Diffuse to Source Ratio per center frequency */
float acousticPreDelay; /* Time elapsed between input signal and late reverberation start, float, range [0.001..10] */
float inputPreDelay; /* Offset in seconds from where DSR is computed in the RIR (0 = at source), float, range [0.001..10] */
Word32 pFc_input_fx[IVAS_CLDFB_NO_CHANNELS_MAX]; /*Q16 Center frequencies for which following values are provided: */ Word32 pFc_input_fx[IVAS_CLDFB_NO_CHANNELS_MAX]; /*Q16 Center frequencies for which following values are provided: */
Word32 pAcoustic_rt60_fx[IVAS_CLDFB_NO_CHANNELS_MAX]; /*Q26 - The room's T60 per center frequency */ Word32 pAcoustic_rt60_fx[IVAS_CLDFB_NO_CHANNELS_MAX]; /*Q26 - The room's T60 per center frequency */
Word32 pAcoustic_dsr_fx[IVAS_CLDFB_NO_CHANNELS_MAX]; /*Q30 - The room's Diffuse to Source Ratio per center frequency */ Word32 pAcoustic_dsr_fx[IVAS_CLDFB_NO_CHANNELS_MAX]; /*Q30 - The room's Diffuse to Source Ratio per center frequency */
......
...@@ -154,6 +154,7 @@ typedef enum ...@@ -154,6 +154,7 @@ typedef enum
#else #else
RENDERER_OSBA_LS RENDERER_OSBA_LS
#endif #endif
} RENDERER_TYPE; } RENDERER_TYPE;
#define MAX_FREQUENCY_BANDS 64 #define MAX_FREQUENCY_BANDS 64
...@@ -215,7 +216,9 @@ typedef enum ...@@ -215,7 +216,9 @@ typedef enum
typedef enum typedef enum
{ {
#ifndef FIX_1101_CLEANING_JBM_CALL
TC_BUFFER_MODE_NONE = 0, TC_BUFFER_MODE_NONE = 0,
#endif
TC_BUFFER_MODE_RENDERER, TC_BUFFER_MODE_RENDERER,
TC_BUFFER_MODE_BUFFER TC_BUFFER_MODE_BUFFER
} TC_BUFFER_MODE; } TC_BUFFER_MODE;
...@@ -270,7 +273,11 @@ typedef enum ...@@ -270,7 +273,11 @@ typedef enum
#define SID_MDCT_STEREO 0x1 /* 1| 0| 0 */ #define SID_MDCT_STEREO 0x1 /* 1| 0| 0 */
#define SID_ISM 0x2 /* 0| 1| 0 */ #define SID_ISM 0x2 /* 0| 1| 0 */
#define SID_MASA_1TC 0x3 /* 1| 1| 0 */ #define SID_MASA_1TC 0x3 /* 1| 1| 0 */
#ifdef FIX_1209_SID_SIGNALING
/*reserved*/ /*0x4*/ /* 0| 0| 1 */
#else
#define SID_MULTICHANNEL 0x4 /* 0| 0| 1 */ #define SID_MULTICHANNEL 0x4 /* 0| 0| 1 */
#endif
#define SID_SBA_1TC 0x5 /* 1| 0| 1 */ #define SID_SBA_1TC 0x5 /* 1| 0| 1 */
#define SID_SBA_2TC 0x6 /* 0| 1| 1 */ #define SID_SBA_2TC 0x6 /* 0| 1| 1 */
#define SID_MASA_2TC 0x7 /* 1| 1| 1 */ #define SID_MASA_2TC 0x7 /* 1| 1| 1 */
......
...@@ -165,19 +165,23 @@ void ivas_omasa_combine_separate_ism_with_masa_fx( ...@@ -165,19 +165,23 @@ void ivas_omasa_combine_separate_ism_with_masa_fx(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */
Word32 *output[], /* o : output synthesis signal */ Word32 *output[], /* o : output synthesis signal */
Word16 *output_q, /* i/o: output Q value */ Word16 *output_q, /* i/o: output Q value */
const int16_t nchan_ism, /* i : number of ISMs */ const Word16 nchan_ism, /* i : number of ISMs */
const int16_t output_frame /* i : output frame length per channel */ const Word16 output_frame /* i : output frame length per channel */
); );
#ifdef FIX_1161_REDUCE_OMASA_HEAP
ivas_error ivas_omasa_objects_delay_open_fx(
#else
ivas_error ivas_omasa_render_objects_from_mix_open_fx( ivas_error ivas_omasa_render_objects_from_mix_open_fx(
#endif
Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */
); );
void ivas_omasa_render_objects_from_mix_fx( void ivas_omasa_render_objects_from_mix_fx(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */
Word32 *output[], /* o : output synthesis signal */ Word32 *output[], /* o : output synthesis signal */
const int16_t nchan_ism, /* i : number of ISMs */ const Word16 nchan_ism, /* i : number of ISMs */
const int16_t output_frame, /* i : output frame length per channel */ const Word16 output_frame, /* i : output frame length per channel */
Word16 *output_q /* i/o: output Q value */ Word16 *output_q /* i/o: output Q value */
); );
...@@ -191,6 +195,7 @@ ivas_error ivas_omasa_ism_metadata_dec_fx( ...@@ -191,6 +195,7 @@ ivas_error ivas_omasa_ism_metadata_dec_fx(
const Word16 dirac_bs_md_write_idx, /* i : DirAC bitstream write index */ const Word16 dirac_bs_md_write_idx, /* i : DirAC bitstream write index */
Word16 nb_bits_metadata[] /* o : number of ISM metadata bits */ Word16 nb_bits_metadata[] /* o : number of ISM metadata bits */
); );
ivas_error ivas_omasa_dec_config_fx( ivas_error ivas_omasa_dec_config_fx(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
UWord16 *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */ UWord16 *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */
...@@ -3162,8 +3167,8 @@ void stereo_tcx_core_enc( ...@@ -3162,8 +3167,8 @@ void stereo_tcx_core_enc(
Word16 pitch_buf_fx[NB_SUBFR16k], /* o : pitch for each subframe, Q6 */ Word16 pitch_buf_fx[NB_SUBFR16k], /* o : pitch for each subframe, Q6 */
const Word16 last_element_mode, /* i : last element mode, Q0 */ const Word16 last_element_mode, /* i : last element mode, Q0 */
const Word16 vad_hover_flag, /* i : VAD hangover flag, Q0 */ const Word16 vad_hover_flag, /* i : VAD hangover flag, Q0 */
Word16 Q_new ); Word16 Q_new
);
Word16 transient_analysis_ivas_fx( Word16 transient_analysis_ivas_fx(
TRAN_DET_HANDLE hTranDet, /* i : handle transient detection */ TRAN_DET_HANDLE hTranDet, /* i : handle transient detection */
...@@ -3289,20 +3294,24 @@ void ivas_fb_mixer_get_windowed_fr_fx( ...@@ -3289,20 +3294,24 @@ void ivas_fb_mixer_get_windowed_fr_fx(
const Word16 length, /* i : number of new samples in time slot */ const Word16 length, /* i : number of new samples in time slot */
const Word16 mdft_len, /* i : MDFT frame length */ const Word16 mdft_len, /* i : MDFT frame length */
const Word16 nchan_fb_in, /* i : number of analysis channels */ const Word16 nchan_fb_in, /* i : number of analysis channels */
Word16 gb ); Word16 gb
);
void ivas_omasa_set_config_fx( void ivas_omasa_set_config_fx(
OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */
MASA_ENCODER_HANDLE hMasa, /* i : MASA encoder handle */ MASA_ENCODER_HANDLE hMasa, /* i : MASA encoder handle */
const Word32 input_Fs, /* i : Input sample rate */ const Word32 input_Fs, /* i : Input sample rate */
const ISM_MODE ism_mode /* i : ISM mode */ const ISM_MODE ism_mode /* i : ISM mode */
); );
Word16 ivas_omasa_ener_brate_fx( Word16 ivas_omasa_ener_brate_fx(
const Word16 nchan_ism, /* i : number of ISMs */ const Word16 nchan_ism, /* i : number of ISMs */
const Word32 ivas_total_brate, /* i : IVAS total bitrate */ const Word32 ivas_total_brate, /* i : IVAS total bitrate */
Word32 *data_f[], /* i : Input / transport audio signals */ Word32 *data_f[], /* i : Input / transport audio signals */
const Word16 input_frame, /* i : Input frame size */ const Word16 input_frame, /* i : Input frame size */
Word16 data_e /*i:exponent for data_f */ const Word16 data_e /* i : exponent for data_f */
); );
void computeDiffuseness_mdft_fx( void computeDiffuseness_mdft_fx(
Word32 **buffer_intensity[DIRAC_NUM_DIMS], Word32 **buffer_intensity[DIRAC_NUM_DIMS],
const Word32 *buffer_energy, const Word32 *buffer_energy,
...@@ -3341,6 +3350,7 @@ UWord8 ivas_masa_surrcoh_signicant_fx( ...@@ -3341,6 +3350,7 @@ UWord8 ivas_masa_surrcoh_signicant_fx(
ivas_error ivas_mcmasa_enc_open_fx( ivas_error ivas_mcmasa_enc_open_fx(
Encoder_Struct *st_ivas /* i/o: IVAS encoder handle */ Encoder_Struct *st_ivas /* i/o: IVAS encoder handle */
); );
void ivas_mcmasa_enc_close_fx( void ivas_mcmasa_enc_close_fx(
MCMASA_ENC_HANDLE *hMcMasa, /* i/o: encoder McMASA handle */ MCMASA_ENC_HANDLE *hMcMasa, /* i/o: encoder McMASA handle */
const Word32 input_Fs /* i : input sampling rate */ const Word32 input_Fs /* i : input sampling rate */
...@@ -3422,7 +3432,11 @@ void mctStereoIGF_enc_fx( ...@@ -3422,7 +3432,11 @@ void mctStereoIGF_enc_fx(
Encoder_State **sts, /* i/o: encoder state structure */ Encoder_State **sts, /* i/o: encoder state structure */
Word32 *orig_spectrum_fx[MCT_MAX_CHANNELS][2], /* i : MDCT spectrum for ITF */ Word32 *orig_spectrum_fx[MCT_MAX_CHANNELS][2], /* i : MDCT spectrum for ITF */
Word16 q_origSpec, /* i : Q for MDCT spectrum */ Word16 q_origSpec, /* i : Q for MDCT spectrum */
#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC
Word32 *powerSpec[MCT_MAX_CHANNELS], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate */
#else
Word32 powerSpec_fx[MCT_MAX_CHANNELS][L_FRAME48k], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate */ Word32 powerSpec_fx[MCT_MAX_CHANNELS][L_FRAME48k], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate */
#endif
Word16 q_powerSpec[MCT_MAX_CHANNELS], /* i : Q for powSpec_fx */ Word16 q_powerSpec[MCT_MAX_CHANNELS], /* i : Q for powSpec_fx */
Word32 *powerSpecMsInv_fx[MCT_MAX_CHANNELS][NB_DIV], /* i : same as powerSpec_fx but for inverse spect.*/ Word32 *powerSpecMsInv_fx[MCT_MAX_CHANNELS][NB_DIV], /* i : same as powerSpec_fx but for inverse spect.*/
Word16 *q_powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV], /* i : Q for powSpecMsInv_fx */ Word16 *q_powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV], /* i : Q for powSpecMsInv_fx */
...@@ -4034,7 +4048,6 @@ void ivas_syn_output_f_fx( ...@@ -4034,7 +4048,6 @@ void ivas_syn_output_f_fx(
Word32 *synth_out /* o : integer 16 bits synthesis signal */ Word32 *synth_out /* o : integer 16 bits synthesis signal */
); );
ivas_error ivas_init_encoder_fx( ivas_error ivas_init_encoder_fx(
Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */
); );
...@@ -4045,10 +4058,8 @@ ivas_error ivas_output_buff_dec_fx( ...@@ -4045,10 +4058,8 @@ ivas_error ivas_output_buff_dec_fx(
const Word16 nchan_out_buff /* i : number of output channels */ const Word16 nchan_out_buff /* i : number of output channels */
); );
/*! r: flag to indicate if split rendering is enabled */ ivas_error ivas_dec_get_format_fx(
Word16 is_split_rendering_enabled( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */
const DECODER_CONFIG_HANDLE hDecoderConfig, /* i : configuration structure */
const IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* i : Render config data structure */
); );
ivas_error ivas_dec_setup( ivas_error ivas_dec_setup(
......
...@@ -2328,6 +2328,14 @@ const UWord16 ivas_param_mc_sym_freq_ild_delta_combined_48_16bits[2 * PARAM_MC_S ...@@ -2328,6 +2328,14 @@ const UWord16 ivas_param_mc_sym_freq_ild_delta_combined_48_16bits[2 * PARAM_MC_S
* MASA ROM tables * MASA ROM tables
*----------------------------------------------------------------------------------*/ *----------------------------------------------------------------------------------*/
#ifdef FIX_1121_MASA_DESCRIPTOR
const UWord8 ivasmasaFormatDescriptor[8] =
{
0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 /* "IVASMASA" */
};
#endif
const Word64 diffuseness_reconstructions_hr_fx[HR_MASA_ER_LEVELS] = { /* Q62 */ const Word64 diffuseness_reconstructions_hr_fx[HR_MASA_ER_LEVELS] = { /* Q62 */
0, 0,
65865144550293504, 65865144550293504,
......
...@@ -225,6 +225,10 @@ extern const UWord16 ivas_param_mc_sym_freq_icc_delta_combined_48_16bits[2 * PAR ...@@ -225,6 +225,10 @@ extern const UWord16 ivas_param_mc_sym_freq_icc_delta_combined_48_16bits[2 * PAR
* MASA ROM tables * MASA ROM tables
*----------------------------------------------------------------------------------*/ *----------------------------------------------------------------------------------*/
#ifdef FIX_1121_MASA_DESCRIPTOR
extern const UWord8 ivasmasaFormatDescriptor[8]; /* "IVASMASA" */
#endif
extern const Word16 bits_direction_masa[DIRAC_DIFFUSE_LEVELS]; extern const Word16 bits_direction_masa[DIRAC_DIFFUSE_LEVELS];
extern const Word16 no_theta_masa[NO_SPHERICAL_GRIDS - 2]; extern const Word16 no_theta_masa[NO_SPHERICAL_GRIDS - 2];
extern const Word16 no_phi_masa[NO_SPHERICAL_GRIDS][MAX_NO_THETA]; extern const Word16 no_phi_masa[NO_SPHERICAL_GRIDS][MAX_NO_THETA];
......
...@@ -802,7 +802,11 @@ static void ivas_get_pred_coeffs_enc_fx( ...@@ -802,7 +802,11 @@ static void ivas_get_pred_coeffs_enc_fx(
tmp64 = W_mult0_32_32( w_norm_fac, dm_w ); // Q=q_tmp tmp64 = W_mult0_32_32( w_norm_fac, dm_w ); // Q=q_tmp
IF( LT_16( q_tmp, q_cov_real[0][0][b] ) ) IF( LT_16( q_tmp, q_cov_real[0][0][b] ) )
{ {
#ifdef FIX_ISSUE_1811_EXCEEDING_W_SHIFTS
tmp64 = W_shr( tmp64, s_min( 63, sub( q_cov_real[0][0][b], q_tmp ) ) ); // Q=q_tmp
#else
tmp64 = W_shr( tmp64, sub( q_cov_real[0][0][b], q_tmp ) ); // Q=q_tmp tmp64 = W_shr( tmp64, sub( q_cov_real[0][0][b], q_tmp ) ); // Q=q_tmp
#endif
} }
ELSE ELSE
{ {
......
...@@ -82,11 +82,15 @@ ...@@ -82,11 +82,15 @@
#define FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW /* FhG: bit-exact, replace carry and overflow operations by 64-bit operations, MR 1931 */ #define FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW /* FhG: bit-exact, replace carry and overflow operations by 64-bit operations, MR 1931 */
#define NONBE_SVD_OPTIMIZATION /* FhG: reduce WMOPS of HouseHolderReduction() in ivas_svd_dec.c() by removing redundant mathematics and using 64 bit additions */ #define NONBE_SVD_OPTIMIZATION /* FhG: reduce WMOPS of HouseHolderReduction() in ivas_svd_dec.c() by removing redundant mathematics and using 64 bit additions */
#define FIX_1766_TCX2ACELP_BWE_ISSUE /* VA : Fix rare BWE issue when switching from TCX to ACELP */ #define FIX_1766_TCX2ACELP_BWE_ISSUE /* VA : Fix rare BWE issue when switching from TCX to ACELP */
#define FIX_1781_SPECTRAL_GAPS /* FhG: Change internal calculation of tcx_noise_factor_ivas_fx() to 32-bit*/
#define FIX_ISSUE_1811_EXCEEDING_W_SHIFTS /* FhG: limit exceeding 64bit shifts */
/* #################### Start BASOP porting switches ############################ */ /* #################### Start BASOP porting switches ############################ */
#define FIX_1372_ISAR_POST_REND #define FIX_1372_ISAR_POST_REND
#define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */
#define FIX_1161_REDUCE_OMASA_HEAP /* VA: reduction of OMASA heap memory */
#define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ #define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */
#define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ #define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */
#define FIX_1052_EXT_OUTPUT /* VA: issue 1052: define EXT decoder output configuration for stereo and MC formats */ #define FIX_1052_EXT_OUTPUT /* VA: issue 1052: define EXT decoder output configuration for stereo and MC formats */
...@@ -113,16 +117,27 @@ ...@@ -113,16 +117,27 @@
#define NONBE_1329_FIX_OSBA_CRASH /* FhG: issue 1329: prevent assert when bit budget is low*/ #define NONBE_1329_FIX_OSBA_CRASH /* FhG: issue 1329: prevent assert when bit budget is low*/
#define NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER /* FhG: issue 1128: set output ambisonics order to input order for EXT output */ #define NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER /* FhG: issue 1128: set output ambisonics order to input order for EXT output */
#define FIX_1138_SBA_EXT_ERROR_PRINTOUT /* VA: issue 1138: Fix SBA EXT output call of audioCfg2channels() */ #define FIX_1138_SBA_EXT_ERROR_PRINTOUT /* VA: issue 1138: Fix SBA EXT output call of audioCfg2channels() */
#define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */
#define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */ #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_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */
#define NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC /* FhG: fix out-of-bound errors when switching from SID frame to active frame*/
#define NONBE_FIX_1052_SBA_EXT_FIX /* VA: SBA external output support fix - do not overwrite "output_config" parameter */ #define NONBE_FIX_1052_SBA_EXT_FIX /* VA: SBA external output support fix - do not overwrite "output_config" parameter */
#define NONBE_1289_STEREO_SW_TO_MONO /* VA: issue 1289: Fix glitch when stereo signal is decoded to mono n TD->DFT switching */
#define NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION /* Ericsson: Issue 1196, Always apply filter interpolation for each subframe */
#define NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING /* VA: issue 1110: fix encoder crash in the stereo DTX bitrate switching condition */ #define NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING /* VA: issue 1110: fix encoder crash in the stereo DTX bitrate switching condition */
#define FIX_1099_JBM_MD_HANDLE_ALLOC /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */
#define FIX_1121_MASA_DESCRIPTOR /* VA: issue 1121: Define 'ivasmasaFormatDescriptor' at one common place */
#define NONBE_1894_OSBA_SCALING /* FhG: do not scale OSBA inputs by 0.5 any more */ #define NONBE_1894_OSBA_SCALING /* FhG: do not scale OSBA inputs by 0.5 any more */
#define NONBE_FIX_1141_OSBA_ROOM_RENDERING /* FhG: Fix for issue 1141: render objects in OSBA decoder with room effect */ #define NONBE_FIX_1141_OSBA_ROOM_RENDERING /* FhG: Fix for issue 1141: render objects in OSBA decoder with room effect */
#define NONBE_1360_LFE_DELAY /* Dlb: LFE delay alignment when rendering in CLDFB domain*/ #define NONBE_1360_LFE_DELAY /* Dlb: LFE delay alignment when rendering in CLDFB domain*/
#define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */ #define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */
#define NONBE_SVD_OPTIMIZATION #define NONBE_SVD_OPTIMIZATION
#define FIX_1209_SID_SIGNALING /* VA: issue 1209: remove dead code in IVAS SID signaling */
#define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */ #define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */
#define NONBE_1131_ACELP_OOB /* VA: issue 1131: fix division-by-zero in acelp gain decoding caused by wrong length of buffer update when switching from HQ core to ACELP core */
#define NONBE_1240_FIX_CORE_SELECTION_ISM_SW /* VA: issue 1240: Remove the forcing of the TCX core in ISM when switching from a high bitarte to a low one */
#define FIX_1101_CLEANING_JBM_CALL /* VA: issue 1101: remove obsolete call of ivas_jbm_dec_tc_buffer_open() */
#define NONBE_FIX_1337_MISSING_DIRECTIVITY_DISTATT_EXTREND /* Eri: issue 1337: Missing directivity setting and distance attenuation in external renderer IVAS_rend */
/* #################### End BASOP porting switches ############################ */ /* #################### End BASOP porting switches ############################ */
......
...@@ -6903,7 +6903,11 @@ void synthesise_fb_high_band_fx( ...@@ -6903,7 +6903,11 @@ void synthesise_fb_high_band_fx(
Word64 W_temp; Word64 W_temp;
t_Q = sub( shl( exp_tmp, 1 ), 8 ); t_Q = sub( shl( exp_tmp, 1 ), 8 );
#ifdef FIX_ISSUE_1811_EXCEEDING_W_SHIFTS
P_ONE = W_shl( P_ONE, s_min( 63, sub( t_Q, 15 ) ) );
#else
P_ONE = W_shl( P_ONE, sub( t_Q, 15 ) ); P_ONE = W_shl( P_ONE, sub( t_Q, 15 ) );
#endif
W_temp = W_add( P_ONE, temp1 ); W_temp = W_add( P_ONE, temp1 );
......
...@@ -651,8 +651,11 @@ Word16 ITF_Detect_ivas_fx( ...@@ -651,8 +651,11 @@ Word16 ITF_Detect_ivas_fx(
{ {
sum = W_mac_32_32( sum, temp_spectrum[i], temp_spectrum[i] ); // 2(Q+shift)+1 sum = W_mac_32_32( sum, temp_spectrum[i], temp_spectrum[i] ); // 2(Q+shift)+1
} }
#ifdef FIX_ISSUE_1811_EXCEEDING_W_SHIFTS
IF( LE_64( sum, W_shl( 32768 * 2 /* HLM_MIN_NRG in Q1 */, s_min( 63, shl( add( Q, shift ), 1 ) ) ) ) )
#else
IF( LE_64( sum, W_shl( 32768 * 2 /* HLM_MIN_NRG in Q1 */, shl( add( Q, shift ), 1 ) ) ) ) IF( LE_64( sum, W_shl( 32768 * 2 /* HLM_MIN_NRG in Q1 */, shl( add( Q, shift ), 1 ) ) ) )
#endif
{ {
BREAK; BREAK;
} }
......
...@@ -992,7 +992,11 @@ ivas_error acelp_core_dec_fx( ...@@ -992,7 +992,11 @@ ivas_error acelp_core_dec_fx(
tmpF_fx = *old_exc_s_fx; tmpF_fx = *old_exc_s_fx;
st->mem_deemph_fx = shl_sat( old_exc_s_fx[st->L_frame - 1], st->Q_syn ); /* Q0 -> Q_syn */ st->mem_deemph_fx = shl_sat( old_exc_s_fx[st->L_frame - 1], st->Q_syn ); /* Q0 -> Q_syn */
move16(); move16();
#ifdef NONBE_1131_ACELP_OOB
PREEMPH_FX( old_exc_s_fx, st->preemph_fac, st->L_frame, &tmpF_fx );
#else
PREEMPH_FX( old_exc_s_fx, st->preemph_fac, L_FRAME16k, &tmpF_fx ); PREEMPH_FX( old_exc_s_fx, st->preemph_fac, L_FRAME16k, &tmpF_fx );
#endif
Copy( old_exc_s_fx + sub( st->L_frame, M ), st->mem_syn2_fx, M ); Copy( old_exc_s_fx + sub( st->L_frame, M ), st->mem_syn2_fx, M );
Scale_sig( st->mem_syn2_fx, M, st->Q_syn ); /* Q0 -> Q_syn */ Scale_sig( st->mem_syn2_fx, M, st->Q_syn ); /* Q0 -> Q_syn */
Residu3_fx( Aq_fx, old_exc_s_fx, old_exc_fx + sub( L_EXC_MEM_DEC, st->L_frame ), st->L_frame, 0 ); Residu3_fx( Aq_fx, old_exc_s_fx, old_exc_fx + sub( L_EXC_MEM_DEC, st->L_frame ), st->L_frame, 0 );
......
This diff is collapsed.
...@@ -110,6 +110,7 @@ ivas_error ivas_ism_renderer_open_fx( ...@@ -110,6 +110,7 @@ ivas_error ivas_ism_renderer_open_fx(
interpolator_length = init_interpolator_length; interpolator_length = init_interpolator_length;
move16(); move16();
} }
IF( ( st_ivas->hIsmRendererData->interpolator_fx = (Word16 *) malloc( sizeof( Word16 ) * init_interpolator_length ) ) == NULL ) IF( ( st_ivas->hIsmRendererData->interpolator_fx = (Word16 *) malloc( sizeof( Word16 ) * init_interpolator_length ) ) == NULL )
{ {
return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISM renderer interpolator\n" ) ); return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISM renderer interpolator\n" ) );
...@@ -411,7 +412,7 @@ void ivas_ism_get_stereo_gains_fx( ...@@ -411,7 +412,7 @@ void ivas_ism_get_stereo_gains_fx(
} }
/*-------------------------------------------------------------------------* /*-------------------------------------------------------------------------*
* ivas_masa_oism_separate_object_renderer_open() * ivas_omasa_separate_object_renderer_open()
* *
* Open structures, reserve memory, and init values. * Open structures, reserve memory, and init values.
*-------------------------------------------------------------------------*/ *-------------------------------------------------------------------------*/
...@@ -452,6 +453,7 @@ ivas_error ivas_omasa_separate_object_renderer_open( ...@@ -452,6 +453,7 @@ ivas_error ivas_omasa_separate_object_renderer_open(
st_ivas->hIsmRendererData->interpolator_len = interpolator_length; st_ivas->hIsmRendererData->interpolator_len = interpolator_length;
move16(); move16();
#ifndef FIX_1161_REDUCE_OMASA_HEAP
st_ivas->hMasaIsmData->delayBuffer_size = extract_l( ( st_ivas->hDecoderConfig->output_Fs / 50 ) / MAX_PARAM_SPATIAL_SUBFRAMES ); st_ivas->hMasaIsmData->delayBuffer_size = extract_l( ( st_ivas->hDecoderConfig->output_Fs / 50 ) / MAX_PARAM_SPATIAL_SUBFRAMES );
move16(); move16();
...@@ -480,6 +482,7 @@ ivas_error ivas_omasa_separate_object_renderer_open( ...@@ -480,6 +482,7 @@ ivas_error ivas_omasa_separate_object_renderer_open(
} }
set32_fx( st_ivas->hMasaIsmData->delayBuffer_fx[i], 0, st_ivas->hMasaIsmData->delayBuffer_size ); set32_fx( st_ivas->hMasaIsmData->delayBuffer_fx[i], 0, st_ivas->hMasaIsmData->delayBuffer_size );
} }
#endif
return IVAS_ERR_OK; return IVAS_ERR_OK;
} }
......
...@@ -82,7 +82,7 @@ ivas_error ivas_jbm_dec_tc_fx( ...@@ -82,7 +82,7 @@ ivas_error ivas_jbm_dec_tc_fx(
Word32 *data_fx /*Q11*/ Word32 *data_fx /*Q11*/
) )
{ {
Word16 n, output_frame, nchan_out, i, ii; Word16 ch, n, output_frame, nchan_out, i, ii;
Decoder_State *st; /* used for bitstream handling */ Decoder_State *st; /* used for bitstream handling */
Word32 *p_output_fx[MAX_TRANSPORT_CHANNELS]; /* buffer for output synthesis */ Word32 *p_output_fx[MAX_TRANSPORT_CHANNELS]; /* buffer for output synthesis */
Word16 nchan_remapped; Word16 nchan_remapped;
...@@ -122,6 +122,7 @@ ivas_error ivas_jbm_dec_tc_fx( ...@@ -122,6 +122,7 @@ ivas_error ivas_jbm_dec_tc_fx(
} }
} }
#ifndef FIX_1101_CLEANING_JBM_CALL
IF( st_ivas->hDecoderConfig->Opt_tsm == 0 ) IF( st_ivas->hDecoderConfig->Opt_tsm == 0 )
{ {
FOR( n = 0; n < ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) FOR( n = 0; n < ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ )
...@@ -132,10 +133,7 @@ ivas_error ivas_jbm_dec_tc_fx( ...@@ -132,10 +133,7 @@ ivas_error ivas_jbm_dec_tc_fx(
st_ivas->hTcBuffer->no_channels = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); st_ivas->hTcBuffer->no_channels = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
move16(); move16();
} }
#endif
Word16 ch;
/*----------------------------------------------------------------* /*----------------------------------------------------------------*
* Decoding + pre-rendering * Decoding + pre-rendering
*----------------------------------------------------------------*/ *----------------------------------------------------------------*/
...@@ -656,16 +654,17 @@ ivas_error ivas_jbm_dec_tc_fx( ...@@ -656,16 +654,17 @@ ivas_error ivas_jbm_dec_tc_fx(
{ {
Word16 q_shift = 0; Word16 q_shift = 0;
move16(); move16();
ivas_masa_prerender_fx( st_ivas, p_output_fx, &q_shift, output_frame, nchan_remapped ); ivas_masa_prerender_fx( st_ivas, p_output_fx, &q_shift, output_frame, nchan_remapped );
FOR( i = 0; i < 2; i++ ) FOR( i = 0; i < 2; i++ )
{ {
Scale_sig32( p_output_fx[i], output_frame, negate( q_shift ) ); Scale_sig32( p_output_fx[i], output_frame, negate( q_shift ) );
} }
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
test(); test();
/* external output */ /* external output */
IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) && IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) && EQ_32( st_ivas->hMasa->config.input_ivas_format, MASA_ISM_FORMAT ) )
EQ_32( st_ivas->hMasa->config.input_ivas_format, MASA_ISM_FORMAT ) )
{ {
FOR( n = 0; n < st_ivas->nchan_ism; n++ ) FOR( n = 0; n < st_ivas->nchan_ism; n++ )
{ {
...@@ -823,6 +822,7 @@ ivas_error ivas_jbm_dec_tc_fx( ...@@ -823,6 +822,7 @@ ivas_error ivas_jbm_dec_tc_fx(
ivas_omasa_rearrange_channels_fx( p_output_fx, nchan_transport_ism, output_frame ); ivas_omasa_rearrange_channels_fx( p_output_fx, nchan_transport_ism, output_frame );
#endif #endif
IF( st_ivas->hDecoderConfig->Opt_tsm ) IF( st_ivas->hDecoderConfig->Opt_tsm )
{ {
ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas ); ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas );
...@@ -1592,6 +1592,16 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( ...@@ -1592,6 +1592,16 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx(
p_data_f_fx[n] = &data_f_fx[n][0]; p_data_f_fx[n] = &data_f_fx[n][0];
} }
#ifdef FIX_1101_CLEANING_JBM_CALL
IF( st_ivas->hDecoderConfig->Opt_tsm == 0 )
{
FOR( n = 0; n < ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ )
{
st_ivas->hTcBuffer->tc_fx[n] = st_ivas->p_output_fx[n]; /* note: buffers needed in the TD decorellator */
}
}
#endif
IF( st_ivas->hDecoderConfig->Opt_tsm ) IF( st_ivas->hDecoderConfig->Opt_tsm )
{ {
ivas_jbm_dec_copy_tc( st_ivas, nSamplesForRendering, nSamplesResidual, data_fx, p_data_f_fx, 11 ); ivas_jbm_dec_copy_tc( st_ivas, nSamplesForRendering, nSamplesResidual, data_fx, p_data_f_fx, 11 );
...@@ -1767,23 +1777,31 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( ...@@ -1767,23 +1777,31 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx(
} }
#endif #endif
if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_DIRAC ) test();
IF( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_16( st_ivas->renderer_type, RENDERER_DIRAC ) )
{ {
int16_t num_objects; Word16 num_objects;
/* Delay the signal to match CLDFB delay. Delay the whole buffer. */ /* Delay the signal to match CLDFB delay. Delay the whole buffer. */
num_objects = 0; num_objects = 0;
IF( ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC ) move16();
test();
test();
IF( ( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_MASA_ONE_OBJ ) || EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) && NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) )
{ {
num_objects = 1; num_objects = 1;
move16();
} }
ELSE IF( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) ELSE IF( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) )
{ {
num_objects = st_ivas->nchan_ism; num_objects = st_ivas->nchan_ism;
move16();
} }
FOR( n = 0; n < num_objects; n++ ) FOR( n = 0; n < num_objects; n++ )
{ {
if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) test();
IF( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) && EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) )
{ {
v_multc_fixed_16( st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], OMASA_TDREND_MATCHING_GAIN_FX, st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available ); v_multc_fixed_16( st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], OMASA_TDREND_MATCHING_GAIN_FX, st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available );
} }
...@@ -2170,8 +2188,7 @@ ivas_error ivas_jbm_dec_render_fx( ...@@ -2170,8 +2188,7 @@ ivas_error ivas_jbm_dec_render_fx(
ivas_omasa_dirac_rend_jbm_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output_fx ); ivas_omasa_dirac_rend_jbm_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output_fx );
} }
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_OBJECT_EXT ) || ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_OBJECT_EXT ) || EQ_32( st_ivas->renderer_type, RENDERER_OMASA_MIX_EXT ) )
EQ_32( st_ivas->renderer_type, RENDERER_OMASA_MIX_EXT ) )
{ {
ivas_jbm_dec_tc_buffer_playout_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output_fx ); ivas_jbm_dec_tc_buffer_playout_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output_fx );
ivas_omasa_rearrange_channels_fx( p_output_fx, st_ivas->nchan_ism, *nSamplesRendered ); ivas_omasa_rearrange_channels_fx( p_output_fx, st_ivas->nchan_ism, *nSamplesRendered );
...@@ -2651,7 +2668,7 @@ ivas_error ivas_jbm_dec_render_fx( ...@@ -2651,7 +2668,7 @@ ivas_error ivas_jbm_dec_render_fx(
nchan_out_syn_output = nchan_out; nchan_out_syn_output = nchan_out;
move16(); move16();
if ( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ) == 0 ) IF( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ) == 0 )
{ {
IF( NE_32( st_ivas->ivas_format, MONO_FORMAT ) ) IF( NE_32( st_ivas->ivas_format, MONO_FORMAT ) )
{ {
...@@ -2801,7 +2818,7 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( ...@@ -2801,7 +2818,7 @@ ivas_error ivas_jbm_dec_flush_renderer_fx(
IF( EQ_16( mc_mode_old, MC_MODE_MCT ) ) IF( EQ_16( mc_mode_old, MC_MODE_MCT ) )
{ {
#ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT #ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT
int16_t crendInPlaceRotation = FALSE; Word16 crendInPlaceRotation = FALSE;
test(); test();
test(); test();
...@@ -2963,7 +2980,7 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( ...@@ -2963,7 +2980,7 @@ ivas_error ivas_jbm_dec_flush_renderer_fx(
move16(); move16();
/* Only write out the valid data*/ /* Only write out the valid data*/
if ( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ) == 0 ) IF( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ) == 0 )
{ {
IF( NE_16( st_ivas->ivas_format, MONO_FORMAT ) ) IF( NE_16( st_ivas->ivas_format, MONO_FORMAT ) )
{ {
...@@ -3611,6 +3628,7 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx( ...@@ -3611,6 +3628,7 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx(
set16_fx( hTcBuffer->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS ); set16_fx( hTcBuffer->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS );
set16_fx( hTcBuffer->subframe_nbslots, nMaxSlotsPerSubframe, MAX_PARAM_SPATIAL_SUBFRAMES ); set16_fx( hTcBuffer->subframe_nbslots, nMaxSlotsPerSubframe, MAX_PARAM_SPATIAL_SUBFRAMES );
#ifndef FIX_1101_CLEANING_JBM_CALL
IF( EQ_16( hTcBuffer->tc_buffer_mode, TC_BUFFER_MODE_NONE ) ) IF( EQ_16( hTcBuffer->tc_buffer_mode, TC_BUFFER_MODE_NONE ) )
{ {
hTcBuffer->tc_buffer_fx = NULL; hTcBuffer->tc_buffer_fx = NULL;
...@@ -3621,6 +3639,7 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx( ...@@ -3621,6 +3639,7 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx(
} }
} }
ELSE ELSE
#endif
{ {
Word16 n_samp_full, n_samp_residual; Word16 n_samp_full, n_samp_residual;
Word32 offset; Word32 offset;
...@@ -4092,7 +4111,9 @@ void ivas_jbm_dec_copy_tc_no_tsm_fx( ...@@ -4092,7 +4111,9 @@ void ivas_jbm_dec_copy_tc_no_tsm_fx(
) )
{ {
Word16 Q_tc; Word16 Q_tc;
#ifndef FIX_1101_CLEANING_JBM_CALL
Word16 n_ch_full_copy; Word16 n_ch_full_copy;
#endif
Word16 n_ch_cldfb; Word16 n_ch_cldfb;
Word16 ch_idx; Word16 ch_idx;
DECODER_TC_BUFFER_HANDLE hTcBuffer; DECODER_TC_BUFFER_HANDLE hTcBuffer;
...@@ -4102,11 +4123,19 @@ void ivas_jbm_dec_copy_tc_no_tsm_fx( ...@@ -4102,11 +4123,19 @@ void ivas_jbm_dec_copy_tc_no_tsm_fx(
hTcBuffer->n_samples_available = hTcBuffer->n_samples_buffered; hTcBuffer->n_samples_available = hTcBuffer->n_samples_buffered;
move16(); move16();
move16(); move16();
#ifndef FIX_1101_CLEANING_JBM_CALL
n_ch_full_copy = s_min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); n_ch_full_copy = s_min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full );
#endif
n_ch_cldfb = sub( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); n_ch_cldfb = sub( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full );
Q_tc = 11; /*tc buffer is at Q11*/ Q_tc = 11; /*tc buffer is at Q11*/
move16(); move16();
#ifdef FIX_1101_CLEANING_JBM_CALL
#ifdef DEBUGGING
assert( st_ivas->hDecoderConfig->Opt_tsm == 0 );
#endif
#else
/* copy full tcs*/ /* copy full tcs*/
IF( st_ivas->hDecoderConfig->Opt_tsm ) IF( st_ivas->hDecoderConfig->Opt_tsm )
{ {
...@@ -4117,7 +4146,7 @@ void ivas_jbm_dec_copy_tc_no_tsm_fx( ...@@ -4117,7 +4146,7 @@ void ivas_jbm_dec_copy_tc_no_tsm_fx(
} }
ch_idx = 0; ch_idx = 0;
move16(); move16();
#endif
/* CLDFB ana for ParamMC/ParamISM */ /* CLDFB ana for ParamMC/ParamISM */
IF( n_ch_cldfb > 0 ) IF( n_ch_cldfb > 0 )
{ {
...@@ -4148,9 +4177,13 @@ void ivas_jbm_dec_copy_tc_no_tsm_fx( ...@@ -4148,9 +4177,13 @@ void ivas_jbm_dec_copy_tc_no_tsm_fx(
num_freq_bands = st_ivas->hParamMC->num_freq_bands; num_freq_bands = st_ivas->hParamMC->num_freq_bands;
move16(); move16();
} }
/* CLDFB Analysis*/
/* CLDFB Analysis*/
#ifdef FIX_1101_CLEANING_JBM_CALL
FOR( ( ch_idx = 0, cldfb_ch = 0 ); cldfb_ch < n_ch_cldfb; ( cldfb_ch++, ch_idx++ ) )
#else
FOR( cldfb_ch = 0; cldfb_ch < n_ch_cldfb; ( cldfb_ch++, ch_idx++ ) ) FOR( cldfb_ch = 0; cldfb_ch < n_ch_cldfb; ( cldfb_ch++, ch_idx++ ) )
#endif
{ {
FOR( slot_idx = 0; slot_idx < DEFAULT_JBM_CLDFB_TIMESLOTS; slot_idx++ ) FOR( slot_idx = 0; slot_idx < DEFAULT_JBM_CLDFB_TIMESLOTS; slot_idx++ )
{ {
......
...@@ -409,7 +409,6 @@ void ivas_lfe_dec_fx( ...@@ -409,7 +409,6 @@ void ivas_lfe_dec_fx(
IF( hLFE->filter_state.order > 0 ) IF( hLFE->filter_state.order > 0 )
{ {
/* NOTE: this block is not getting hit by any stream present in pytest test suite */
/* Low Pass Filter */ /* Low Pass Filter */
ivas_filter_process_fx( &hLFE->filter_state, output_lfe_ch, output_frame, q_out ); ivas_filter_process_fx( &hLFE->filter_state, output_lfe_ch, output_frame, q_out );
} }
......
...@@ -646,7 +646,11 @@ static void d_syn_filt_fx( ...@@ -646,7 +646,11 @@ static void d_syn_filt_fx(
} }
ELSE ELSE
{ {
#ifdef FIX_ISSUE_1811_EXCEEDING_W_SHIFTS
s_fx = W_sub( W_shr( s_fx, s_min( 63, sub( s_q_fx, temp_q ) ) ), temp );
#else
s_fx = W_sub( W_shr( s_fx, sub( s_q_fx, temp_q ) ), temp ); s_fx = W_sub( W_shr( s_fx, sub( s_q_fx, temp_q ) ), temp );
#endif
s_q_fx = temp_q; s_q_fx = temp_q;
move16(); move16();
} }
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
* Local function prototypes * Local function prototypes
*-----------------------------------------------------------------------*/ *-----------------------------------------------------------------------*/
static Word16 rint_fx( Word32 num ); static Word16 rint_fx( const Word32 num );
static void index_16bits_fx( IVAS_QMETADATA_HANDLE hQMetaData, SPHERICAL_GRID_DATA *Sph_Grid16 ); static void index_16bits_fx( IVAS_QMETADATA_HANDLE hQMetaData, SPHERICAL_GRID_DATA *Sph_Grid16 );
...@@ -703,11 +703,12 @@ ivas_error ivas_masa_decode_fx( ...@@ -703,11 +703,12 @@ ivas_error ivas_masa_decode_fx(
move16(); move16();
} }
#endif #endif
IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) )
{ {
IF( hQMetaData->q_direction == NULL ) IF( hQMetaData->q_direction == NULL )
{ {
if ( NE_32( ( error = ivas_masa_dec_config_fx( st_ivas ) ), IVAS_ERR_OK ) ) IF( NE_32( ( error = ivas_masa_dec_config_fx( st_ivas ) ), IVAS_ERR_OK ) )
{ {
return error; return error;
} }
...@@ -858,13 +859,12 @@ ivas_error ivas_masa_dec_open_fx( ...@@ -858,13 +859,12 @@ ivas_error ivas_masa_dec_open_fx(
ism_total_brate = 0; ism_total_brate = 0;
move32(); move32();
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
/* ISM metadata */ /* ISM metadata */
test(); test();
test(); test();
if ( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) && IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) && st_ivas->hIsmMetaData[0] != NULL && EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) )
st_ivas->hIsmMetaData[0] != NULL &&
EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) )
{ {
/* these are not needed -> clean. EXT metafile writer in OMASA needs only the number of ISMs and writes default null-data */ /* these are not needed -> clean. EXT metafile writer in OMASA needs only the number of ISMs and writes default null-data */
ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 );
...@@ -958,6 +958,7 @@ ivas_error ivas_masa_dec_open_fx( ...@@ -958,6 +958,7 @@ ivas_error ivas_masa_dec_open_fx(
nchan_transport = ivas_jbm_dec_get_num_tc_channels_fx( st_ivas ); nchan_transport = ivas_jbm_dec_get_num_tc_channels_fx( st_ivas );
nchan_to_allocate = nchan_transport; nchan_to_allocate = nchan_transport;
move16(); move16();
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
test(); test();
test(); test();
...@@ -972,9 +973,7 @@ ivas_error ivas_masa_dec_open_fx( ...@@ -972,9 +973,7 @@ ivas_error ivas_masa_dec_open_fx(
move16(); move16();
} }
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
ELSE IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && ELSE IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && ( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_MIX_EXT ) || EQ_32( st_ivas->renderer_type, RENDERER_OMASA_OBJECT_EXT ) ) )
( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_MIX_EXT ) ||
EQ_32( st_ivas->renderer_type, RENDERER_OMASA_OBJECT_EXT ) ) )
{ {
nchan_transport = add( st_ivas->nchan_transport, st_ivas->nchan_ism ); nchan_transport = add( st_ivas->nchan_transport, st_ivas->nchan_ism );
nchan_to_allocate = add( st_ivas->nchan_transport, st_ivas->nchan_ism ); nchan_to_allocate = add( st_ivas->nchan_transport, st_ivas->nchan_ism );
...@@ -1155,7 +1154,7 @@ static ivas_error ivas_masa_dec_config_fx( ...@@ -1155,7 +1154,7 @@ static ivas_error ivas_masa_dec_config_fx(
} }
ELSE ELSE
{ {
st_ivas->hQMetaData->q_direction[i].cfg.nblocks = 4; st_ivas->hQMetaData->q_direction[i].cfg.nblocks = MAX_PARAM_SPATIAL_SUBFRAMES;
} }
move16(); move16();
...@@ -2069,9 +2068,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( ...@@ -2069,9 +2068,7 @@ ivas_error ivas_masa_dec_reconfigure_fx(
tc_nchan_to_allocate = add( tc_nchan_to_allocate, 1 ); tc_nchan_to_allocate = add( tc_nchan_to_allocate, 1 );
} }
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
ELSE IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && ELSE IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && ( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_MIX_EXT ) || EQ_32( st_ivas->renderer_type, RENDERER_OMASA_OBJECT_EXT ) ) )
( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_MIX_EXT ) ||
EQ_32( st_ivas->renderer_type, RENDERER_OMASA_OBJECT_EXT ) ) )
{ {
tc_nchan_transport = add( st_ivas->nchan_transport, st_ivas->nchan_ism ); tc_nchan_transport = add( st_ivas->nchan_transport, st_ivas->nchan_ism );
tc_nchan_to_allocate = add( st_ivas->nchan_transport, st_ivas->nchan_ism ); tc_nchan_to_allocate = add( st_ivas->nchan_transport, st_ivas->nchan_ism );
...@@ -2081,7 +2078,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( ...@@ -2081,7 +2078,7 @@ ivas_error ivas_masa_dec_reconfigure_fx(
test(); test();
IF( NE_16( tc_nchan_transport, st_ivas->hTcBuffer->nchan_transport_jbm ) || NE_16( tc_nchan_to_allocate, st_ivas->hTcBuffer->nchan_transport_internal ) || NE_16( buffer_mode_new, st_ivas->hTcBuffer->tc_buffer_mode ) ) IF( NE_16( tc_nchan_transport, st_ivas->hTcBuffer->nchan_transport_jbm ) || NE_16( tc_nchan_to_allocate, st_ivas->hTcBuffer->nchan_transport_internal ) || NE_16( buffer_mode_new, st_ivas->hTcBuffer->tc_buffer_mode ) )
{ {
if ( NE_32( error = ivas_jbm_dec_tc_buffer_reconfigure_fx( st_ivas, buffer_mode_new, tc_nchan_transport, tc_nchan_to_allocate, tc_nchan_to_allocate, n_samples_granularity ), IVAS_ERR_OK ) ) IF( NE_32( error = ivas_jbm_dec_tc_buffer_reconfigure_fx( st_ivas, buffer_mode_new, tc_nchan_transport, tc_nchan_to_allocate, tc_nchan_to_allocate, n_samples_granularity ), IVAS_ERR_OK ) )
{ {
return error; return error;
} }
...@@ -2698,13 +2695,16 @@ static void create_masa_ext_out_meta_fx( ...@@ -2698,13 +2695,16 @@ static void create_masa_ext_out_meta_fx(
IVAS_QMETADATA_HANDLE hQMetaData, IVAS_QMETADATA_HANDLE hQMetaData,
const Word16 nchan_transport ) const Word16 nchan_transport )
{ {
#ifndef FIX_1121_MASA_DESCRIPTOR
const UWord8 ivasmasaFormatDescriptor[8] = { 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 }; /* "IVASMASA" */ const UWord8 ivasmasaFormatDescriptor[8] = { 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 }; /* "IVASMASA" */
#endif
Word16 i, sf, b_old, b_new, dir; Word16 i, sf, b_old, b_new, dir;
MASA_DECRIPTIVE_META *descMeta; MASA_DECRIPTIVE_META *descMeta;
Word16 *bandMap; Word16 *bandMap;
UWord8 numCodingBands; UWord8 numCodingBands;
UWord8 numDirections; UWord8 numDirections;
MASA_DECODER_EXT_OUT_META *extOutMeta; MASA_DECODER_EXT_OUT_META *extOutMeta;
#ifndef FIX_1121_MASA_DESCRIPTOR
move16(); /*ivasmasaFormatDescriptor*/ move16(); /*ivasmasaFormatDescriptor*/
move16(); move16();
move16(); move16();
...@@ -2713,6 +2713,7 @@ static void create_masa_ext_out_meta_fx( ...@@ -2713,6 +2713,7 @@ static void create_masa_ext_out_meta_fx(
move16(); move16();
move16(); move16();
move16(); move16();
#endif
numDirections = hMasa->config.numberOfDirections; numDirections = hMasa->config.numberOfDirections;
move16(); move16();
...@@ -3514,6 +3515,7 @@ static Word16 ivas_decode_masaism_metadata_fx( ...@@ -3514,6 +3515,7 @@ static Word16 ivas_decode_masaism_metadata_fx(
hMasaIsmData->energy_ratio_ism_fx[dir][meta_write_index][b] = energy_ratio_ism_fx[i][band][dir]; hMasaIsmData->energy_ratio_ism_fx[dir][meta_write_index][b] = energy_ratio_ism_fx[i][band][dir];
move32(); move32();
} }
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
IF( hMasaIsmData->hExtData != NULL ) IF( hMasaIsmData->hExtData != NULL )
{ {
...@@ -3529,11 +3531,13 @@ static Word16 ivas_decode_masaism_metadata_fx( ...@@ -3529,11 +3531,13 @@ static Word16 ivas_decode_masaism_metadata_fx(
return sub( nb_bits_read, *next_bit_pos ); return sub( nb_bits_read, *next_bit_pos );
} }
/* /*
Fixed point implementation of rint(). Fixed point implementation of rint().
*/ */
static Word16 rint_fx( /* returns in Q0 */ /* returns in Q0 */
Word32 num /* num in Q0 */ static Word16 rint_fx(
const Word32 num /* num in Q0 */
) )
{ {
Word32 frac_part = L_and( L_abs( num ), 0x0000FFFF ); // Q15 Word32 frac_part = L_and( L_abs( num ), 0x0000FFFF ); // Q15
......
...@@ -263,7 +263,11 @@ ivas_error ivas_td_binaural_renderer_sf_fx( ...@@ -263,7 +263,11 @@ ivas_error ivas_td_binaural_renderer_sf_fx(
/* Render subframe */ /* Render subframe */
/* ism_md_subframe_update_jbm != subframe_idx: trigger update only for ism_md_subframe_update_jbm == subframe_idx, /* ism_md_subframe_update_jbm != subframe_idx: trigger update only for ism_md_subframe_update_jbm == subframe_idx,
where then the two TDREND_GetMix()-arguments subframe_idx and ism_md_subframe_update are equal, and we want to enforce the update inside TDREND_GetMix to use subframe_idx == 0 */ where then the two TDREND_GetMix()-arguments subframe_idx and ism_md_subframe_update are equal, and we want to enforce the update inside TDREND_GetMix to use subframe_idx == 0 */
#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION
IF( NE_32( ( error = TDREND_GetMix_fx( st_ivas->hBinRendererTd, output_fx_local, output_frame, 0 ) ), IVAS_ERR_OK ) )
#else
IF( NE_32( ( error = TDREND_GetMix_fx( st_ivas->hBinRendererTd, output_fx_local, output_frame, 0, ism_md_subframe_update_jbm != subframe_idx ) ), IVAS_ERR_OK ) ) IF( NE_32( ( error = TDREND_GetMix_fx( st_ivas->hBinRendererTd, output_fx_local, output_frame, 0, ism_md_subframe_update_jbm != subframe_idx ) ), IVAS_ERR_OK ) )
#endif
{ {
return error; return error;
} }
......