Skip to content

Commits on Source 109

9 additional commits have been omitted to prevent performance issues.
......@@ -150,7 +150,6 @@
<ClCompile Include="..\lib_rend\ivas_lcld_rom_tables.c" />
<ClCompile Include="..\lib_rend\ivas_sba_rendering.c" />
<ClCompile Include="..\lib_rend\ivas_allrad_dec.c" />
<ClCompile Include="..\lib_rend\ivas_cldfb_codec_bitstream.c" />
<ClCompile Include="..\lib_rend\ivas_MSPred.c" />
<ClCompile Include="..\lib_rend\ivas_NoiseGen.c" />
<ClCompile Include="..\lib_rend\ivas_PerceptualModel.c" />
......@@ -195,7 +194,6 @@
<ClCompile Include="..\lib_rend\lib_rend.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\lib_rend\ivas_cldfb_codec_bitstream.h" />
<ClInclude Include="..\lib_rend\ivas_lcld_prot.h" />
<ClInclude Include="..\lib_rend\ivas_lcld_rom_tables.h" />
<ClInclude Include="..\lib_rend\ivas_prot_rend.h" />
......
......@@ -5,9 +5,6 @@
<ClCompile Include="..\lib_rend\ivas_allrad_dec.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_cldfb_codec_bitstream.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_crend.c">
<Filter>rend_c</Filter>
</ClCompile>
......@@ -206,9 +203,6 @@
<ClInclude Include="..\lib_rend\ivas_lcld_rom_tables.h">
<Filter>rend_h</Filter>
</ClInclude>
<ClInclude Include="..\lib_rend\ivas_cldfb_codec_bitstream.h">
<Filter>rend_h</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="rend_h">
......
......@@ -156,22 +156,16 @@ typedef struct
*------------------------------------------------------------------------------------------*/
static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg );
static void usage_dec( void );
#ifdef SPLIT_REND_WITH_HEAD_ROT
static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, uint8_t *splitRendBitsBuf, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf );
#else
static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf );
#endif
static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec );
#ifdef DEBUGGING
static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec );
static int16_t app_own_random( int16_t *seed );
static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( char *forcedRendModeChar );
#endif
......@@ -187,6 +181,12 @@ int main(
{
bool mainFailed = true; /* Assume main failed until cleanup is reached without errors */
DecArguments arg;
ivas_error error = IVAS_ERR_UNKNOWN;
#ifdef SPLIT_REND_WITH_HEAD_ROT
uint8_t splitRendBitsBuf[IVAS_MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES];
#endif
/* Any handles that require cleanup must be declared here and initialized to NULL */
IVAS_DEC_HANDLE hIvasDec = NULL;
BS_READER_HANDLE hBsReader = NULL;
LsCustomFileReader *hLsCustomReader = NULL;
......@@ -195,12 +195,12 @@ int main(
RotFileReader *externalOrientationFileReader = NULL;
RotFileReader *refRotReader = NULL;
Vector3PairFileReader *referenceVectorReader = NULL;
ivas_error error = IVAS_ERR_UNKNOWN;
RenderConfigReader *renderConfigReader = NULL;
#ifdef FIX_847_OUTPUT_PCM_BUFFER
int16_t *pcmBuf = NULL;
#else
int16_t pcmBuf[MAX_OUTPUT_PCM_BUFFER_SIZE];
#ifdef SPLIT_REND_WITH_HEAD_ROT
uint8_t splitRendBitsBuf[IVAS_MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES];
#endif
RenderConfigReader *renderConfigReader = NULL;
#ifdef DEBUGGING
int32_t noClipping;
int32_t cnt_frames_limited;
......@@ -743,6 +743,21 @@ int main(
}
}
#ifdef FIX_847_OUTPUT_PCM_BUFFER
/*------------------------------------------------------------------------------------------*
* Allocate output data buffer
*------------------------------------------------------------------------------------------*/
int16_t pcmBufSize;
if ( ( error = IVAS_DEC_GetOutputBufferSize( hIvasDec, &pcmBufSize ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nGetOutputBufferSize failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
goto cleanup;
}
pcmBuf = malloc( pcmBufSize * sizeof( int16_t ) );
#endif
/*-----------------------------------------------------------------*
* Decoding
......@@ -797,10 +812,14 @@ int main(
cleanup:
#ifdef FIX_847_OUTPUT_PCM_BUFFER
free( pcmBuf );
#endif
#ifdef DEBUG_SBA_AUDIO_DUMP
IVAS_DEC_GetSbaDebugParams( hIvasDec, &numOutChannels, &numTransportChannels, &pca_ingest_channels );
#endif
#endif
if ( arg.hrtfReaderEnabled )
{
IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL;
......@@ -1693,10 +1712,11 @@ static ivas_error initOnFirstGoodFrame(
MasaFileWriter **ppMasaWriter, /* o : */
IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS], /* o : */
int16_t *pNumOutChannels, /* o : */
uint16_t *pNumObj /* o : */
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
uint16_t *pNumObj, /* o : */
SplitFileReadWrite **splitRendWriter
#else
uint16_t *pNumObj /* o : */
#endif
)
{
......@@ -2433,7 +2453,6 @@ static ivas_error decodeG192(
#ifdef WMOPS
if ( vec_pos_update == 0 )
{
// update_mem(); TODO: verify this
update_wmops();
update_mem();
#ifdef MEM_COUNT_DETAILS
......
......@@ -131,7 +131,6 @@ typedef struct
const char *ca_config_file;
bool mimeOutput;
IVAS_ENC_COMPLEXITY_LEVEL complexityLevel;
#ifdef DEBUGGING
IVAS_ENC_FORCED_MODE forcedMode;
const char *forcedModeFile;
......@@ -178,7 +177,7 @@ int main(
{
bool mainFailed = true; /* Assume main failed until cleanup is reached without errors */
EncArguments arg;
int16_t i = 0;
int16_t i;
ivas_error error = IVAS_ERR_UNKNOWN;
/* Any handles that require cleanup must be declared here and initialized to NULL */
......@@ -189,11 +188,7 @@ int main(
FILE *f_bwProfile = NULL;
JbmFileReader *jbmReader = NULL;
MasaFileReader *masaReader = NULL;
IsmFileReader *ismReaders[IVAS_MAX_NUM_OBJECTS];
for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
{
ismReaders[i] = NULL;
}
IsmFileReader *ismReaders[IVAS_MAX_NUM_OBJECTS] = { NULL, NULL, NULL, NULL };
int16_t *pcmBuf = NULL;
#ifdef DEBUGGING
FILE *f_forcedModeProfile = NULL;
......@@ -234,7 +229,6 @@ int main(
goto cleanup;
}
/*------------------------------------------------------------------------------------------*
* Open output bitstream file
*------------------------------------------------------------------------------------------*/
......@@ -492,7 +486,6 @@ int main(
goto cleanup;
}
/* Validate number of channels */
int16_t encInNumChannels = 0;
if ( ( error = IVAS_ENC_GetNumInChannels( hIvasEnc, &encInNumChannels ) ) != IVAS_ERR_OK )
......@@ -603,7 +596,6 @@ int main(
int16_t numSamplesRead = 0;
uint16_t bitStream[IVAS_MAX_BITS_PER_FRAME];
uint16_t numBits = 0;
#ifdef DEBUG_SBA
#ifdef DEBUG_AGC
ivas_open_agc_debug_files( (int16_t) arg.agc );
......@@ -725,7 +717,6 @@ int main(
}
}
#endif
/* Read ISM input metadata */
for ( i = 0; i < numIsmInputs; ++i )
{
......@@ -803,7 +794,6 @@ int main(
#ifdef DEBUGGING
print_snr();
#endif
/*------------------------------------------------------------------------------------------*
* Close files and deallocate resources
*------------------------------------------------------------------------------------------*/
......@@ -856,7 +846,6 @@ cleanup:
print_wmops();
print_mem( NULL );
#endif
#ifdef DEBUGGING
dbgclose();
......@@ -1606,7 +1595,6 @@ static bool parseCmdlIVAS_enc(
usage_enc();
}
}
else if ( strcmp( to_upper( argv[i] ), "-ISM_SBA" ) == 0 )
{
arg->inputFormat = IVAS_ENC_INPUT_SBA_ISM;
......@@ -1695,7 +1683,6 @@ static bool parseCmdlIVAS_enc(
}
}
}
else if ( strcmp( argv_to_upper, "-STEREO_DMX_EVS" ) == 0 )
{
arg->inputFormat = IVAS_ENC_INPUT_MONO;
......@@ -1932,7 +1919,6 @@ static void usage_enc( void )
fprintf( stdout, "-mime : Mime output bitstream file format\n" );
fprintf( stdout, " The encoder produces TS26.445 Annex.2.6 Mime Storage Format, (not RFC4867 Mime Format).\n" );
fprintf( stdout, " default output bitstream file format is G.192\n" );
fprintf( stdout, "-bypass mode : SBA PCA by-pass, mode = (1, 2), 1 = PCA off, 2 = signal adaptive, default is 1\n" );
fprintf( stdout, "-level level : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" );
fprintf( stdout, " Currently, all values default to level 3 (full functionality).\n" );
......
......@@ -67,7 +67,7 @@
#define RENDERER_MAX_METADATA_LINE_LENGTH 1024
#ifdef SPLIT_REND_WITH_HEAD_ROT
#define SPLIT_REND_BITS_BUFF_SIZE ( ( ( ( (int32_t) SPLIT_REND_MAX_BRATE / IVAS_NUM_FRAMES_PER_SEC ) + 7 ) >> 3 ) + SPLIT_REND_ADDITIONAL_BYTES_TO_READ )
#define SPLIT_REND_BITS_BUFF_SIZE ( ( ( ( (int32_t) IVAS_MAX_SPLIT_REND_BITRATE / IVAS_NUM_FRAMES_PER_SEC ) + 7 ) >> 3 ) + IVAS_SPLIT_REND_ADDITIONAL_BYTES_TO_READ )
#endif
#define IVAS_MAX16B_FLT 32767.0f
......@@ -478,10 +478,11 @@ static int16_t getTotalNumInChannels(
IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS],
IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS],
IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS],
IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS]
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS],
IVAS_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS]
#else
IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS]
#endif
)
{
......@@ -586,10 +587,11 @@ static void setupWithSingleFormatInput(
CmdlnArgs args,
char *audioFilePath,
IsmPositionProvider *positionProvider,
MasaFileReader **masaReaders
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
MasaFileReader **masaReaders,
SplitFileReadWrite **hhSplitRendFileReadWrite
#else
MasaFileReader **masaReaders
#endif
)
{
......@@ -605,7 +607,7 @@ static void setupWithSingleFormatInput(
exit( -1 );
}
for ( int32_t i = 0; i < args.numInMetadataFiles; ++i )
for ( int16_t i = 0; i < args.numInMetadataFiles; ++i )
{
masaReaders[i] = MasaFileReader_open( args.inMetadataFilePaths[i] );
if ( masaReaders[i] == NULL )
......@@ -1847,11 +1849,11 @@ int main(
if ( delayNumSamples == -1 )
{
if ( args.delayCompensationEnabled
#ifdef SPLIT_REND_WITH_HEAD_ROT
&& !is_split_pre_rend_mode( &args )
if ( args.delayCompensationEnabled && !is_split_pre_rend_mode( &args ) )
#else
if ( args.delayCompensationEnabled )
#endif
)
{
if ( IVAS_REND_GetDelay( hIvasRend, &delayNumSamples, &delayTimeScale ) != IVAS_ERR_OK )
{
......@@ -3290,6 +3292,7 @@ static void parseObjectPosition(
int16_t read_values;
float meta_prm[8] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f };
readNextMetadataChunk( line, "," );
*positionDuration = (uint16_t) strtol( line, &endptr, 10 );
readNextMetadataChunk( line, "\n" );
......@@ -3808,11 +3811,12 @@ static void convertInputBuffer(
const int16_t numIntSamplesPerChannel,
const int16_t numFloatSamplesPerChannel,
const int16_t numChannels,
float *floatBuffer
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
float *floatBuffer,
const int16_t cldfb_in_flag,
IVAS_CLDFB_FILTER_BANK_HANDLE *cldfbAna
#else
float *floatBuffer
#endif
)
{
......@@ -3896,11 +3900,12 @@ static void convertOutputBuffer(
const float *floatBuffer,
const int16_t numSamplesPerChannel,
const int16_t numChannels,
int16_t *intBuffer
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
int16_t *intBuffer,
const int16_t cldfb_in_flag,
IVAS_CLDFB_FILTER_BANK_HANDLE *cldfbSyn
#else
int16_t *intBuffer
#endif
)
{
......
......@@ -196,6 +196,7 @@ typedef struct _IVAS_JBM_TRACE_DATA
#define IVAS_MAX_SPLIT_REND_BITRATE 768000
#define IVAS_MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES ( ( ( (int32_t) IVAS_MAX_SPLIT_REND_BITRATE / IVAS_NUM_FRAMES_PER_SEC ) + 7 ) >> 3 )
#define IVAS_SPLIT_REND_ADDITIONAL_BYTES_TO_READ 1
typedef enum
{
......@@ -235,7 +236,7 @@ typedef enum
} IVAS_SPLIT_REND_RENDERER_SELECTION;
typedef struct ivas_split_rend_bits_t
typedef struct _IVAS_SPLIT_REND_BITS_DATA
{
uint8_t *bits_buf;
int32_t buf_len; /*size of bits_buf in bytes. This field should be set by allocator of bits_buf*/
......@@ -245,7 +246,7 @@ typedef struct ivas_split_rend_bits_t
IVAS_SPLIT_REND_CODEC codec;
IVAS_SPLIT_REND_POSE_CORRECTION_MODE pose_correction;
} ivas_split_rend_bits_t, IVAS_SPLIT_REND_BITS_DATA, *IVAS_SPLIT_REND_BITS_HANDLE;
} IVAS_SPLIT_REND_BITS_DATA, *IVAS_SPLIT_REND_BITS_HANDLE;
typedef struct _IVAS_SPLIT_REND_CONFIG
{
......
......@@ -54,10 +54,11 @@ int32_t get_delay(
const int16_t enc_dec, /* i : encoder/decoder flag */
const int32_t io_fs, /* i : input/output sampling frequency */
const IVAS_FORMAT ivas_format, /* i : IVAS format */
HANDLE_CLDFB_FILTER_BANK hCldfb /* i : Handle of Cldfb analysis */
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
HANDLE_CLDFB_FILTER_BANK hCldfb, /* i : Handle of Cldfb analysis */
const AUDIO_CONFIG output_config /* i : decoder output config */
#else
HANDLE_CLDFB_FILTER_BANK hCldfb /* i : Handle of Cldfb analysis */
#endif
)
{
......
......@@ -1081,10 +1081,10 @@ enum
#define IVAS_PCA_N1 91
#define IVAS_PCA_N1_EQ ( (IVAS_PCA_N1-1)/2 )
#define IVAS_PCA_BIT_LEN ( 1 + ( IVAS_PCA_QBITS - 1 + IVAS_PCA_QBITS ) )
#define IVAS_PCA_INTERP 4 /* 4D (Quaternion) dimension */
#define IVAS_PCA_N_SLOTS 40 //20
#define IVAS_PCA_INTERP 4
#define IVAS_PCA_N_SLOTS 40
#define IVAS_PCA_LEN_INTERP_Q ( IVAS_PCA_INTERP * IVAS_PCA_N_SLOTS )
#define IVAS_PCA_DELAY_CMP 24 // 12
#define IVAS_PCA_DELAY_CMP 24
#define IVAS_PCA_LEN_INTERP_EIG_DEC ( (IVAS_PCA_N_SLOTS+IVAS_PCA_DELAY_CMP)*16)
#define IVAS_PCA_THRES_MIN_DOT 0.8f
#define IVAS_PCA_THRES_MIN_DOT2 0.0f
......@@ -1811,7 +1811,7 @@ typedef enum
#define SPLIT_REND_512k 512000
#define SPLIT_REND_768k 768000
#define SPLIT_REND_MAX_BRATE SPLIT_REND_768k
#define SPLIT_REND_ADDITIONAL_BYTES_TO_READ 1
#endif
/*----------------------------------------------------------------------------------*
......
......@@ -65,10 +65,12 @@ typedef enum
IVAS_ERR_INVALID_FEC_CONFIG,
IVAS_ERR_INVALID_FEC_OFFSET,
IVAS_ERR_INVALID_INPUT_BUFFER_SIZE,
#ifdef FIX_847_OUTPUT_PCM_BUFFER
IVAS_ERR_INVALID_OUTPUT_BUFFER_SIZE,
#endif
IVAS_ERR_DTX_NOT_SUPPORTED,
IVAS_ERR_UNEXPECTED_NULL_POINTER,
IVAS_ERR_METADATA_NOT_EXPECTED,
IVAS_ERR_INVALID_SPAR_CONFIG,
IVAS_ERR_WRONG_PARAMS,
IVAS_ERR_INIT_ERROR,
IVAS_ERR_WRONG_MODE,
......@@ -80,7 +82,6 @@ typedef enum
IVAS_ERR_INVALID_HRTF,
IVAS_ERR_INVALID_INPUT_FORMAT,
IVAS_ERR_INVALID_INDEX,
IVAS_ERR_NOT_SUPPORTED_OPTION,
IVAS_ERR_NOT_IMPLEMENTED,
IVAS_ERR_WAITING_FOR_BITSTREAM,
......@@ -133,7 +134,6 @@ typedef enum
/*----------------------------------------*
* renderer (lib_rend only) *
*----------------------------------------*/
IVAS_ERR_NUM_CHANNELS_UNKNOWN = 0x6000,
IVAS_ERR_INVALID_CUSTOM_LS_LAYOUT,
IVAS_ERR_INVALID_INPUT_ID,
......@@ -217,6 +217,10 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
return "Invalid FEC offset";
case IVAS_ERR_INVALID_INPUT_BUFFER_SIZE:
return "Invalid input buffer size";
#ifdef FIX_847_OUTPUT_PCM_BUFFER
case IVAS_ERR_INVALID_OUTPUT_BUFFER_SIZE:
return "Invalid output buffer size";
#endif
case IVAS_ERR_DTX_NOT_SUPPORTED:
return "DTX is not supported in this IVAS format and element mode";
case IVAS_ERR_UNEXPECTED_NULL_POINTER:
......
......@@ -30,13 +30,14 @@
*******************************************************************************************************/
/* options.h needed for debugging/development features
* It should be stripped for delivery along with debugging switches */
#include "options.h"
#include "ivas_error.h"
#include <assert.h>
#include <stdarg.h>
#include <stdint.h>
#include "ivas_error.h"
#ifdef DEBUGGING
#include <stdio.h>
#endif
......
......@@ -294,6 +294,14 @@ ivas_error ivas_init_decoder(
Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */
);
#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC
ivas_error ivas_output_buff_dec(
float *p_output_f[], /* i/o: output audio buffers */
const int16_t nchan_out_buff_old, /* i : previous frame number of output channels*/
const int16_t nchan_out_buff /* i : number of output channels */
);
#endif
ivas_error stereo_dmx_evs_init_encoder(
STEREO_DMX_EVS_ENC_HANDLE *hStereoDmxEVS, /* o : Stereo downmix for EVS encoder handle */
const int32_t input_Fs /* i : input sampling rate */
......@@ -812,7 +820,7 @@ ivas_error ivas_jbm_dec_flush_renderer(
#endif
);
ivas_error ivas_jbm_dec_feed_tc_to_renderer(
void ivas_jbm_dec_feed_tc_to_renderer(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
const int16_t nSamplesForRendering, /* i : number of TC samples available for rendering */
int16_t *nSamplesResidual, /* o : number of samples not fitting into the renderer grid and buffer for the next call*/
......@@ -849,9 +857,9 @@ int16_t ivas_jbm_dec_get_num_tc_channels(
);
void ivas_jbm_dec_copy_tc_no_tsm(
Decoder_Struct *st_ivas,
float *tc[],
const int16_t output_frame
Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */
float *tc[], /* i : transport channels */
const int16_t output_frame /* i : output frame size */
);
void ivas_jbm_dec_get_md_map_even_spacing(
......@@ -1167,8 +1175,8 @@ void ivas_ism_metadata_sid_enc(
);
void ivas_ism_metadata_sid_dec(
SCE_DEC_HANDLE hSCE[MAX_SCE], /* i/o: SCE encoder structure */
const int32_t ism_total_brate, /* i : ISms total bitrate */
SCE_DEC_HANDLE hSCE[MAX_SCE], /* i/o: SCE decoder structure */
const int32_t ism_total_brate, /* i : ISM total bitrate */
const int16_t bfi, /* i : bfi flag */
const int16_t nchan_ism, /* i : number of objects */
const int16_t nchan_transport, /* i : number of transport channels */
......@@ -1214,7 +1222,7 @@ void ivas_get_ism_sid_quan_bitbudget(
);
void ivas_ism_dtx_limit_noise_energy_for_near_silence(
SCE_DEC_HANDLE hSCE[], /* i/o: SCE encoder structures */
SCE_DEC_HANDLE hSCE[], /* i/o: SCE decoder structures */
const int16_t sce_id_dtx, /* i : SCE DTX ID */
const int16_t nchan_transport /* i : number of transport channels */
);
......@@ -3463,7 +3471,7 @@ ivas_error ivas_sba_dec_reconfigure(
#ifdef JBM_FOR_OSBA
,
uint16_t *nSamplesFlushed, /* o : number of samples flushed */
#if defined SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */
void *data /* o : output synthesis signal */
#else
......@@ -4156,7 +4164,7 @@ ivas_error ivas_sba_linear_renderer(
float *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output */
const int16_t output_frame, /* i : output frame length per channel */
const int16_t nchan_in, /* i : number of input ambisonics channels */
const int16_t nchan_ism,
const int16_t nchan_ism, /* i : number of objects */
const AUDIO_CONFIG output_config, /* i : output audio configuration */
const IVAS_OUTPUT_SETUP output_setup /* i : output format setup */
);
......@@ -4174,9 +4182,9 @@ void ivas_sba_mix_matrix_determiner(
/*! r: AGC enable flag */
int16_t ivas_agc_enc_get_flag(
#ifdef DEBUG_AGC_ENCODER_CMD_OPTION
int16_t agc_configuration, /* i : AGC configuration from command-line */
const int16_t agc_configuration, /* i : AGC configuration from command-line */
#endif
int16_t nchan_transport /* i : number of transport channels */
const int16_t nchan_transport /* i : number of transport channels */
);
ivas_error ivas_spar_agc_enc_open(
......@@ -4360,7 +4368,7 @@ void ivas_spar_dec_digest_tc(
const int16_t nSamplesForRendering /* i : number of samples provided */
);
ivas_error ivas_sba_dec_digest_tc(
void ivas_sba_dec_digest_tc(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */
const int16_t nCldfbSlots, /* i : number of CLDFB slots */
const int16_t nSamplesForRendering /* i : number of samples provided */
......@@ -5545,6 +5553,11 @@ ivas_error ivas_mono_dmx_renderer_open(
Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */
);
void ivas_mono_dmx_renderer_close(
MONO_DOWNMIX_RENDERER_HANDLE *hMonoDmxRenderer /* i/ i/o: Mono downmix structure */
);
void ivas_mono_downmix_render_passive(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
float *output_f[], /* i/o: synthesized core-coder transport channels/mono output */
......@@ -5679,9 +5692,8 @@ void ivas_osba_enc(
const int16_t input_frame, /* i : Input frame size */
const int16_t nchan_ism, /* i : Number of objects for parameter analysis*/
const ISM_MODE ism_mode, /* i : ISM mode */
const int16_t sba_analysis_order, /* i : SBA order evaluated in DirAC/SPAR encoder */
const int32_t input_Fs /* i : input sampling rate */
,
const int16_t sba_analysis_order, /* i : SBA order evaluated in SBA encoder */
const int32_t input_Fs, /* i : input sampling rate */
const int16_t sba_planar /* i : planar SBA flag */
);
......@@ -5689,7 +5701,6 @@ ivas_error ivas_osba_data_open(
Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */
);
#ifdef JBM_FOR_OSBA
ivas_error ivas_osba_dirac_td_binaural_jbm(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
......@@ -5700,7 +5711,6 @@ ivas_error ivas_osba_dirac_td_binaural_jbm(
);
#endif
ivas_error ivas_osba_dirac_td_binaural(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
float *output[], /* o : output synthesis signal */
......
......@@ -928,22 +928,22 @@ const ivas_spar_br_table_t ivas_spar_br_table_consts[IVAS_SPAR_BR_TABLE_LEN] =
{ 256000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 76300, 73550, 112000 },{ 59350, 57200, 56000 },{ 42400, 40850, 48000 },{ 25450, 24500, 40000 } },
{ { 31, 11, 11, 1 },{ 1, 1, 1, 1 }, { 1, 1, 1, 1 } }, 1, 2, 0 },
 
{ 384000, 0, SBA_FOA_ORDER, FB, 24000, 4, WYXZ, 0, 0,{ { 128000, 128000, 128000 },{ 100000, 100000, 128000 },{ 79850, 79850, 104000 },{ 66600, 66600, 104000 } }, // not yet optimized
{ 384000, 0, SBA_FOA_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 128000, 128000, 128000 },{ 100000, 100000, 128000 },{ 79850, 79850, 104000 },{ 66600, 66600, 104000 } },
{ { 31, 1, 1, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 },
 
{ 384000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0,{ { 128000, 128000, 128000 },{ 105350, 103300, 112000 },{ 75200, 73750, 96000 },{ 45100, 44250, 48000 } }, // just added as a place holder, not necessarily operational
{ 384000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 128000, 128000, 128000 },{ 105350, 103300, 112000 },{ 75200, 73750, 96000 },{ 45100, 44250, 48000 } },
{ { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 },
 
{ 384000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0,{ { 124300, 121550, 128000 },{ 96700, 94550, 112000 },{ 69050, 67500, 96000 },{ 41450, 40500, 48000 } }, // just added as a place holder, not necessarily operational
{ 384000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 124300, 121550, 128000 },{ 96700, 94550, 112000 },{ 69050, 67500, 96000 },{ 41450, 40500, 48000 } },
{ { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 },
 
{ 512000, 0, SBA_FOA_ORDER, FB, 24000, 4, WYXZ, 0, 0,{ { 128000, 128000, 128000 },{ 128000, 128000, 128000 },{ 128000, 128000, 128000 }, {118450, 118450, 128000 } }, // not yet optimized
{ 512000, 0, SBA_FOA_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 128000, 128000, 128000 },{ 128000, 128000, 128000 },{ 128000, 128000, 128000 }, {118450, 118450, 128000 } },
{ { 31, 1, 1, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 },
 
{ 512000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0,{ { 124000, 124000, 128000 },{ 124000, 124000, 128000 },{ 125200, 118450, 128000 },{ 76300, 73000, 128000 } }, // not yet optimized
{ 512000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0,{ { 124000, 124000, 128000 },{ 124000, 124000, 128000 },{ 125200, 118450, 128000 },{ 76300, 73000, 128000 } },
{ { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 },
 
{ 512000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0,{ { 118000, 118000, 128000 },{ 118000, 118000, 128000 },{ 117200, 109250, 128000 },{ 72300, 69000, 128000 } }, // not yet optimized
{ 512000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 118000, 118000, 128000 },{ 118000, 118000, 128000 },{ 117200, 109250, 128000 },{ 72300, 69000, 128000 } },
{ { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 },
};
 
......
......@@ -943,7 +943,7 @@ static void ivas_calc_p_coeffs_per_band(
{
if ( i == j )
{
pSparMd->band_coeffs[b_ts_idx].P_re[j - num_dmx] = cov_uu_re[i - num_dmx][j - num_dmx]; // can optimise here
pSparMd->band_coeffs[b_ts_idx].P_re[j - num_dmx] = cov_uu_re[i - num_dmx][j - num_dmx];
}
}
}
......
......@@ -83,7 +83,7 @@
/*#define ALLOW_BYTE_EP*/ /* allow byte fer pattern files and check fer pattern file validity */
#define WRAP_AS_EIDXOR /* wraps FER file (as in STL_eid-xor.c/softbit.c) */
#define DEBUG_FORCE_MDCT_STEREO_MODE /* Force stereo mode decision for MDCT stereo: -stereo 3 1 forces L/R coding and -stereo 3 2 forces full M/S coding */
/*#define DEBUG_FORCE_MDCT_STEREO_MODE*/ /* Force stereo mode decision for MDCT stereo: -stereo 3 1 forces L/R coding and -stereo 3 2 forces full M/S coding */
/*#define DEBUG_STEREO_DFT_NOCORE*/ /* DFT stereo: by-pass core coder at decoder side*/
/*#define DEBUG_STEREO_DFT_NOSTEREO*/ /* DFT stereo: by-pass stereo processing at encoder and decoder side*/
/*#define DEBUG_STEREO_DFT_NOQRES*/
......@@ -150,9 +150,12 @@
/*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */
/*#define SPLIT_REND_WITH_HEAD_ROT*/ /* Dlb,FhG: Split Rendering contributions 21 and 35 */
#define REMOVE_UNUSED_FUNCTION /* Dlb: Remove functions that are unhit/unused */
#define FIX_MSAN_USAN_ERROR_JBM /* Dlb: Resolve MSAN and USAN errors in the SBA-JBM test case added*/
#define FIX_818_DOUBLE_PREC_KERNEN_SW /* FhG: Issue 818: Avoid double precision in kernel switching */
#define FIX_818_DOUBLE_PREC_KERNEL_SW /* FhG: Issue 818: Avoid double precision in kernel switching */
#define FIX_822_REFACTOR_BIN_REVERB_OPEN /* Nokia: Addresses first step of issue 822 by refactoring ivas_binaural_reverb_open */
#define FIX_847_OUTPUT_PCM_BUFFER /* VA: issue 847: Allocate decoder output PCM buffer dynamically */
/* #################### End BE switches ################################## */
......@@ -171,6 +174,13 @@
#define NONBE_FIX_841_MC_RS_TDOBJ_RENDERER /* FhG: Issue #841: [Non-BE] Resolve "MC RS HRFT handle not set to NULL" */
#define NONBE_FIX_840_PARAMMC_RS /* FhG: Issue #840: Resolve "MC RS ParamMC hoa encoder wrongly set to zero" */
#define NONBE_FIX_826_JBM_MASA_CNA_CNG /* FhG: issue #826: Resolve "JBM MASA: CNA and CNG not in sync with non-JBM decoding" */
#define NONBE_FIX_835_JBM_PARAMUPMIX_HEADROT /* FhG: issue #835: Resolve "JBM: ParamUpmix head rotation broken" */
#define NONBE_FIX_838_CRASH_24_4_WB /* FhG: Issue 838: fix encoder crashes for Unified Stereo and MASA 2 TC at 24.4 kbps WB due to missing IGF (re-) allocation */
#define NONBE_FIX_839_MC_RS_CHANNEL_ALLOC /* FhG: Issues #839: problems with reallocation of the channels on the heap in case of MC RS */
#define BE_FIX_832_ASAN_ERROR_EFAP_OSBA /* FhG: issue #832: fix ASAN error caused by re-allocating EFAP memories in OSBA*/
#define NONBE_FIX_819_DOUBLE_PREC_COMB_FORMATS /* VA: issue 820: Double precision arithmetic in combined formats */
#define NONBE_FIX_849_OMASA_BFI_CRASH /* VA: issue 849: fix OMASA 2TC and FEC crashes */
/* ##################### End NON-BE switches ########################### */
......
......@@ -64,10 +64,11 @@ static void ivas_binRenderer_filterModule(
float CLDFB_real[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : real part of LS signals */
float CLDFB_imag[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : imag part of LS signals */
const int16_t numTimeSlots, /* i : number of time slots to process */
BINAURAL_RENDERER_HANDLE hBinRenderer /* i/o: fastconv binaural renderer handle */
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
const int16_t pos_idx
BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: fastconv binaural renderer handle */
const int16_t pos_idx /* i : pose index */
#else
BINAURAL_RENDERER_HANDLE hBinRenderer /* i/o: fastconv binaural renderer handle */
#endif
)
{
......@@ -140,10 +141,11 @@ static ivas_error ivas_binRenderer_convModuleOpen(
const int16_t renderer_type,
const int16_t isLoudspeaker,
const AUDIO_CONFIG input_config,
const HRTFS_FASTCONV_HANDLE hHrtf
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
const HRTFS_FASTCONV_HANDLE hHrtf,
const int16_t num_poses
#else
const HRTFS_FASTCONV_HANDLE hHrtf
#endif
)
{
......@@ -1230,7 +1232,11 @@ ivas_error ivas_binRenderer_open(
/* Allocate memories needed for reverb module */
if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
{
#ifdef FIX_822_REFACTOR_BIN_REVERB_OPEN
if ( ( error = ivas_binaural_reverb_open_fastconv( &( hBinRenderer->hReverb ), hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hIntSetup.output_config, st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv ) ) != IVAS_ERR_OK )
#else
if ( ( error = ivas_binaural_reverb_open( &( hBinRenderer->hReverb ), hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hIntSetup.output_config, st_ivas->hDecoderConfig->output_Fs, RENDERER_BINAURAL_FASTCONV, st_ivas->hHrtfFastConv, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK )
#endif
{
return error;
}
......@@ -1286,10 +1292,11 @@ ivas_error ivas_binRenderer_open(
*------------------------------------------------------------------------*/
static void ivas_binRenderer_convModuleClose(
BINAURAL_RENDERER_HANDLE *hBinRenderer /* i/o: fastconv binaural renderer handle */
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
const int16_t num_poses
BINAURAL_RENDERER_HANDLE *hBinRenderer, /* i/o: fastconv binaural renderer handle */
const int16_t num_poses /* i : number of poses */
#else
BINAURAL_RENDERER_HANDLE *hBinRenderer /* i/o: fastconv binaural renderer handle */
#endif
)
{
......@@ -1992,8 +1999,8 @@ void ivas_binRenderer(
Quaternions_abs.y = Quaternions_abs.y + Quaternions_rel.y;
Quaternions_abs.z = Quaternions_abs.z + Quaternions_rel.z;
QuatToRotMat( Quaternions_rel, Rmat_local );
if ( hBinRenderer->hInputSetup->is_loudspeaker_setup )
{
rotateFrame_sd_cldfb( Rmat_local, RealBuffer, ImagBuffer, hBinRenderer->hInputSetup, hBinRenderer->hEFAPdata, numTimeSlots, hBinRenderer->conv_band );
......
......@@ -1114,6 +1114,10 @@ static void stereo_mode_combined_format_dec(
( ( st_ivas->nchan_ism == 3 && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_96k ) ||
( st_ivas->nchan_ism == 4 && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_128k ) ) )
{
#ifdef NONBE_FIX_849_OMASA_BFI_CRASH
if ( !st_ivas->bfi )
{
#endif
/* read OMASA stereo mode signalling */
if ( get_next_indice( hCPE->hCoreCoder[0], NBITS_ELEMENT_MODE ) )
{
......@@ -1123,6 +1127,9 @@ static void stereo_mode_combined_format_dec(
{
hCPE->element_mode = IVAS_CPE_DFT;
}
#ifdef NONBE_FIX_849_OMASA_BFI_CRASH
}
#endif
if ( hCPE->element_mode == IVAS_CPE_MDCT )
{
......
......@@ -465,7 +465,6 @@ ivas_error ivas_dec(
int16_t nchan_ism, nchan_transport_ism;
int16_t dirac_bs_md_write_idx;
st = st_ivas->hCPE[0]->hCoreCoder[0];
set_s( nb_bits_metadata, 0, MAX_SCE + 1 );
/* Set the number of objects for the parametric rendering */
......@@ -482,7 +481,7 @@ ivas_error ivas_dec(
}
/* MASA metadata decoding */
if ( ( error = ivas_masa_decode( st_ivas, st, &nb_bits_metadata[0] ) ) != IVAS_ERR_OK )
if ( ( error = ivas_masa_decode( st_ivas, st_ivas->hCPE[0]->hCoreCoder[0], &nb_bits_metadata[0] ) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -490,7 +489,7 @@ ivas_error ivas_dec(
/* Configuration of combined-format bit-budget distribution */
ivas_set_surplus_brate_dec( st_ivas, &ism_total_brate );
st->bit_stream = &( st_ivas->bit_stream[( ism_total_brate / FRAMES_PER_SEC )] );
st_ivas->hCPE[0]->hCoreCoder[0]->bit_stream = &( st_ivas->bit_stream[( ism_total_brate / FRAMES_PER_SEC )] );
/* set ISM parameters and decode ISM metadata in OMASA format */
if ( ( error = ivas_omasa_ism_metadata_dec( st_ivas, ism_total_brate, &nchan_ism, &nchan_transport_ism, dirac_bs_md_write_idx, &nb_bits_metadata[1] ) ) != IVAS_ERR_OK )
......@@ -595,7 +594,6 @@ ivas_error ivas_dec(
/* core-decoding of transport channels */
if ( st_ivas->nSCE == 1 )
{
st = st_ivas->hSCE[0]->hCoreCoder[0];
if ( ( error = ivas_sce_dec( st_ivas, 0, &p_output[0], output_frame, nb_bits_metadata[0] + nb_bits_metadata[1] ) ) != IVAS_ERR_OK )
{
return error;
......@@ -603,7 +601,6 @@ ivas_error ivas_dec(
}
else if ( st_ivas->nCPE == 1 )
{
st = st_ivas->hCPE[0]->hCoreCoder[0];
if ( ( error = ivas_cpe_dec( st_ivas, 0, p_output, output_frame, nb_bits_metadata[0] + nb_bits_metadata[1] ) ) != IVAS_ERR_OK )
{
return error;
......@@ -611,7 +608,6 @@ ivas_error ivas_dec(
}
else if ( st_ivas->nCPE > 1 )
{
st = st_ivas->hCPE[0]->hCoreCoder[0];
if ( ( error = ivas_mct_dec( st_ivas, p_output, output_frame, nb_bits_metadata[0] + nb_bits_metadata[1] ) ) != IVAS_ERR_OK )
{
return error;
......@@ -740,7 +736,6 @@ ivas_error ivas_dec(
#ifdef JBM_FOR_OSBA
if ( ( error = ivas_sba_upmixer_renderer( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK )
#else
if ( ( error = ivas_sba_upmixer_renderer( st_ivas, &p_output[sba_ch_idx], output_frame ) ) != IVAS_ERR_OK )
#endif
{
......