From 74dae8d165b7de632f12463c67c061eab1a3304f Mon Sep 17 00:00:00 2001 From: malenov Date: Tue, 31 Jan 2023 14:43:28 +0100 Subject: [PATCH 01/43] dynamical allocation of ind_list[] based on the actual number of transport channels --- apps/encoder.c | 17 ++++ lib_com/bitstream.c | 9 +++ lib_com/ivas_prot.h | 4 + lib_com/options.h | 7 +- lib_enc/init_enc.c | 10 +++ lib_enc/ivas_corecoder_enc_reconfig.c | 112 +++++++++++++++++++++++++- lib_enc/ivas_init_enc.c | 108 ++++++++++++++++++++++--- lib_enc/lib_enc.c | 43 +++++++++- lib_enc/stat_enc.h | 8 ++ 9 files changed, 303 insertions(+), 15 deletions(-) diff --git a/apps/encoder.c b/apps/encoder.c index d789fd5486..b7bc8b6433 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -48,6 +48,10 @@ #define WMC_TOOL_SKIP +#ifdef DEBUG_IND +extern int16_t total_num_id; +#endif + /*------------------------------------------------------------------------------------------* * Local constants, enums, structures *------------------------------------------------------------------------------------------*/ @@ -551,6 +555,7 @@ int main( fprintf( stdout, "\n\n-- Start the encoder (quiet mode) --\n\n" ); } + #ifdef WMOPS reset_stack(); reset_wmops(); @@ -567,6 +572,10 @@ int main( while ( 1 ) { +#ifdef DEBUG_IND + total_num_id = 0; +#endif + /* Read the input data */ if ( ( error = AudioFileReader_read( audioReader, pcmBuf, pcmBufSize, &numSamplesRead ) ) != IVAS_ERR_OK ) { @@ -709,6 +718,14 @@ int main( goto cleanup; } +#ifdef DEBUG_IND + { + int16_t tmp_i = -1; + + dbgwrite( &tmp_i, sizeof( int16_t ), 1, 960 - total_num_id, "res/ind_list.x" ); + } +#endif + frame++; if ( !arg.quietModeEnabled ) { diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index e5f72590a6..5f7be30f67 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -53,6 +53,10 @@ #ifdef DEBUGGING +#ifdef DEBUG_IND +int16_t total_num_id = 0; +#endif + #define FEC_SEED 12558 /*-------------------------------------------------------------------* @@ -300,6 +304,11 @@ ivas_error push_indice( hBstr->last_ind = id; hBstr->nb_bits_tot += nb_bits; +#ifdef DEBUG_IND + dbgwrite( &i, sizeof( int16_t ), 1, 1, "res/ind_list.x" ); + total_num_id++; +#endif + return error; } diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index c91013ca92..142f6a0059 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -285,7 +285,11 @@ void ivas_initialize_handles_enc( ivas_error ivas_init_encoder( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ +#ifdef IND_LIST_DYN + //Indice *ind_list[], /* i : list of indices */ +#else Indice ind_list[][MAX_NUM_INDICES], /* i : indices list */ +#endif Indice ind_list_metadata[][MAX_BITS_METADATA] /* i : indices list metadata */ ); diff --git a/lib_com/options.h b/lib_com/options.h index 1efe925fe0..2096942f81 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -50,12 +50,16 @@ #ifndef RELEASE #define DEBUGGING /* Activate debugging part of the code */ #endif -/*#define WMOPS*/ /* Activate complexity and memory counters */ +#define WMOPS /* Activate complexity and memory counters */ /*#define WMOPS_PER_FRAME*/ /* Output per-frame complexity (writes one float value per frame to the file "wmops_analysis") */ /*#define WMOPS_DETAIL*/ /* Output detailed complexity printout for every function. Increases runtime overhead */ /*#define WMOPS_WC_FRAME_ANALYSIS*/ /* Output detailed complexity analysis for the worst-case frame */ /*#define MEM_COUNT_DETAILS*/ /* Output detailed memory analysis for the worst-case frame (writes to the file "mem_analysis.csv") */ +/*#define BITSTREAM_INDICES_MEMORY*/ /* Don't count memory for bitstream Indice at the encoder - it is a temporary solution for development only */ +#define DEBUG_IND +#define IND_LIST_DYN /* dynamic allocation of ind_list based on transport channels */ + #ifdef DEBUGGING /*#define DEBUG_MODE_INFO*/ /* output most important parameters to the subdirectory "res/" */ @@ -132,7 +136,6 @@ /* ################# Start DEVELOPMENT switches ######################## */ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ -#define BITSTREAM_INDICES_MEMORY /* Don't count memory for bitstream Indice at the encoder - it is a temporary solution for development only */ #define LSF_RE_USE_SECONDARY_CHANNEL /* TD stereo Secondary channel LSF Q improvement */ #ifdef LSF_RE_USE_SECONDARY_CHANNEL diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index e456a52a61..dbd5693f1c 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -111,6 +111,16 @@ ivas_error init_encoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Bitstream structure\n" ) ); } + +#ifdef IND_LIST_DYN + /* allocate buffer of indices */ + if ( ( st->hBstr->ind_list = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); + } + + reset_indices_enc( st->hBstr, MAX_NUM_INDICES ); +#endif } else { diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index e8486d7738..233f7681f7 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -63,7 +63,14 @@ ivas_error ivas_corecoder_enc_reconfig( int16_t len_inp_memory, n_CoreCoder_existing, nSCE_existing, nCPE_existing; float input_buff[MCT_MAX_BLOCKS][L_FRAME48k + NS2SA( 48000, IVAS_FB_ENC_DELAY_NS )]; BSTR_ENC_HANDLE hBstr, hMetaData; - Indice *ind_list, *ind_list_metadata; +#ifndef IND_LIST_DYN + Indice *ind_list; +#endif + Indice *ind_list_metadata; +#ifdef IND_LIST_DYN + int16_t i, nb_bits; + Indice temp_ind_list[10]; +#endif int16_t nb_bits_tot, next_ind, last_ind; ENCODER_CONFIG_HANDLE hEncoderConfig; ivas_error error; @@ -131,8 +138,10 @@ ivas_error ivas_corecoder_enc_reconfig( } /* something in transport changes */ +#ifndef IND_LIST_DYN ind_list = NULL; ind_list_metadata = NULL; +#endif hBstr = NULL; hMetaData = NULL; @@ -155,10 +164,31 @@ ivas_error ivas_corecoder_enc_reconfig( #endif /* save bitstream information */ +#ifndef IND_LIST_DYN ind_list = hBstr->ind_list; /* pointer to the beginning of the global list */ +#endif nb_bits_tot = hBstr->nb_bits_tot; next_ind = hBstr->next_ind; last_ind = hBstr->last_ind; +#ifdef IND_LIST_DYN + i = 0; + nb_bits = 0; + while ( nb_bits < nb_bits_tot && i < 10 ) + { + if ( hBstr->ind_list[i].nb_bits > 0 ) + { + temp_ind_list[i].value = hBstr->ind_list[i].value; + temp_ind_list[i].nb_bits = hBstr->ind_list[i].nb_bits; + } + + nb_bits += temp_ind_list[i].nb_bits; + i++; + } + +#ifdef DEBUGGING + assert( (nb_bits == nb_bits_tot) && "Error saving bitstream information during core-coder reconfiguration!\n" ); +#endif +#endif ind_list_metadata = hMetaData->ind_list; /* pointer to the beginning of the global list */ if ( hEncoderConfig->ivas_format == MC_FORMAT && last_mc_mode == MC_MODE_MCMASA && st_ivas->mc_mode == MC_MODE_MCMASA ) @@ -255,8 +285,17 @@ ivas_error ivas_corecoder_enc_reconfig( mvr2r( input_buff[sce_id], st_ivas->hSCE[sce_id]->hCoreCoder[0]->input_buff, len_inp_memory ); } - /* prepare bitstream buffers */ + /* allocate buffer of indices */ +#ifdef IND_LIST_DYN + //if ( ( ind_list = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) + //{ + // return IVAS_ERR_FAILED_ALLOC; + //} + + //st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list; +#else st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list + sce_id * MAX_NUM_INDICES; +#endif /* only reset indices if it is not the first index list, this already contains the IVAS format bits */ if ( sce_id > 0 ) @@ -268,6 +307,24 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->last_ind = last_ind; st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->nb_bits_tot = nb_bits_tot; st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->next_ind = next_ind; +#ifdef IND_LIST_DYN + i = 0; + nb_bits = 0; + while ( nb_bits < nb_bits_tot && i < 10 ) + { + if ( temp_ind_list[i].nb_bits > 0 ) + { + st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].value = temp_ind_list[i].value; + st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; + } + + nb_bits += temp_ind_list[i].nb_bits; + i++; + } +#ifdef DEBUGGING + assert( ( nb_bits == nb_bits_tot ) && "Error restoring bitstream information during core-coder reconfiguration!\n" ); +#endif +#endif } st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata + sce_id * MAX_BITS_METADATA; @@ -282,13 +339,23 @@ ivas_error ivas_corecoder_enc_reconfig( for ( cpe_id = 0; cpe_id < nCPE_existing; cpe_id++ ) { st_ivas->hCPE[cpe_id]->element_brate = brate_CPE; - /* prepare bitstream buffers */ + + /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { copy_encoder_config( st_ivas, st_ivas->hCPE[cpe_id]->hCoreCoder[n], 0 ); st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ +#ifdef IND_LIST_DYN + //if ( ( ind_list = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) + //{ + // return IVAS_ERR_FAILED_ALLOC; + //} + + //st_ivas->hSCE[cpe_id]->hCoreCoder[0]->hBstr->ind_list = ind_list; +#else st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list + ( cpe_id * CPE_CHANNELS + n + st_ivas->nSCE ) * MAX_NUM_INDICES; +#endif if ( cpe_id * CPE_CHANNELS + n > 0 || ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->nSCE > 0 ) ) { reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); @@ -298,6 +365,24 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->last_ind = last_ind; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_bits_tot = nb_bits_tot; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->next_ind = next_ind; +#ifdef IND_LIST_DYN + i = 0; + nb_bits = 0; + while ( nb_bits < nb_bits_tot && i < 10 ) + { + if ( temp_ind_list[i].nb_bits > 0 ) + { + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].value = temp_ind_list[i].value; + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; + } + + nb_bits += temp_ind_list[i].nb_bits; + i++; + } +#ifdef DEBUGGING + assert( ( nb_bits == nb_bits_tot ) && "Error restoring bitstream information during core-coder reconfiguration!\n" ); +#endif +#endif } } } @@ -326,7 +411,9 @@ ivas_error ivas_corecoder_enc_reconfig( /* prepare bitstream buffers */ for ( n = 0; n < CPE_CHANNELS; n++ ) { +#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list + ( cpe_id * CPE_CHANNELS + n + st_ivas->nSCE ) * MAX_NUM_INDICES; +#endif if ( cpe_id * CPE_CHANNELS + n > 0 || ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->nSCE > 0 ) ) { reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); @@ -336,6 +423,25 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->last_ind = last_ind; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_bits_tot = nb_bits_tot; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->next_ind = next_ind; +#ifdef IND_LIST_DYN + i = 0; + nb_bits = 0; + while ( nb_bits < nb_bits_tot && i < 10 ) + { + if ( temp_ind_list[i].nb_bits > 0 ) + { + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].value = temp_ind_list[i].value; + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; + } + + nb_bits += temp_ind_list[i].nb_bits; + i++; + } +#ifdef DEBUGGING + assert( ( nb_bits == nb_bits_tot ) && "Error restoring bitstream information during core-coder reconfiguration!\n" ); +#endif +#endif + } if ( hEncoderConfig->Opt_DTX_ON ) diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index fd92453980..26809f733d 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -311,7 +311,11 @@ void ivas_initialize_handles_enc( ivas_error ivas_init_encoder( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ +#ifdef IND_LIST_DYN + //Indice *ind_list[], /* i : list of indices */ +#else Indice ind_list[][MAX_NUM_INDICES], /* o : bitstream indices */ +#endif Indice ind_list_metadata[][MAX_BITS_METADATA] /* o : bitstream indices metadata */ ) { @@ -363,9 +367,17 @@ ivas_error ivas_init_encoder( return error; } - /* prepare bitstream buffers */ +#ifdef IND_LIST_DYN + ///* allocate buffer of indices */ + //if ( ( ind_list[sce_id] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) + //{ + // return IVAS_ERR_FAILED_ALLOC; + //} +#endif +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); +#endif /* prepare stereo downmix for EVS */ if ( hEncoderConfig->stereo_dmx_evs == 1 ) @@ -388,11 +400,20 @@ ivas_error ivas_init_encoder( return error; } - /* prepare bitstream buffers */ + /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { +#ifdef IND_LIST_DYN + //if ( ( ind_list[n] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) + //{ + // return IVAS_ERR_FAILED_ALLOC; + //} +#endif + +#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); +#endif } /* MetaData for DFT stereo */ @@ -417,9 +438,18 @@ ivas_error ivas_init_encoder( return error; } - /* prepare bitstream buffers */ +#ifdef IND_LIST_DYN + /* allocate buffer of indices */ + //if ( ( ind_list[sce_id] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) + //{ + // return IVAS_ERR_FAILED_ALLOC; + //} +#endif + +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); +#endif st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); @@ -475,9 +505,18 @@ ivas_error ivas_init_encoder( return error; } - /* prepare bitstream buffers */ +#ifdef IND_LIST_DYN + /* allocate buffer of indices */ + //if ( ( ind_list[sce_id] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) + //{ + // return IVAS_ERR_FAILED_ALLOC; + //} +#endif + +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); +#endif st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); @@ -495,11 +534,20 @@ ivas_error ivas_init_encoder( return error; } - /* prepare bitstream buffers */ + /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { +#ifdef IND_LIST_DYN + //if ( ( ind_list[cpe_id * CPE_CHANNELS + n] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) + //{ + // return IVAS_ERR_FAILED_ALLOC; + //} +#endif + +#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); +#endif if ( hEncoderConfig->Opt_DTX_ON ) { @@ -541,13 +589,23 @@ ivas_error ivas_init_encoder( return error; } + /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { +#ifdef IND_LIST_DYN + //if ( ( ind_list[cpe_id * CPE_CHANNELS + n] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) + //{ + // return IVAS_ERR_FAILED_ALLOC; + //} +#endif /* we need the correct bitstream also for the LFE channel since it might become a proper coded channel when switching to ParamMC and ind_list is only visible here, can't be done later */ +#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); +#endif } + /* Metadata only initialized for the last CPE index*/ if ( cpe_id == st_ivas->nCPE - 1 ) { @@ -582,12 +640,19 @@ ivas_error ivas_init_encoder( return error; } - - /* prepare bitstream buffers */ + /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { +#ifdef IND_LIST_DYN + //if ( ( ind_list[cpe_id * CPE_CHANNELS + n] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) + //{ + // return IVAS_ERR_FAILED_ALLOC; + //} +#endif +#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); +#endif } /* Metadata only initialized for the last CPE index*/ @@ -636,9 +701,18 @@ ivas_error ivas_init_encoder( return error; } - /* prepare bitstream buffers */ + /* allocate buffer of indices */ +#ifdef IND_LIST_DYN + //if ( ( ind_list[sce_id] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) + //{ + // return IVAS_ERR_FAILED_ALLOC; + //} +#endif + +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); +#endif st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); @@ -653,11 +727,19 @@ ivas_error ivas_init_encoder( return error; } - /* prepare bitstream buffers */ + /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { +#ifdef IND_LIST_DYN + //if ( ( ind_list[cpe_id * CPE_CHANNELS + n + st_ivas->nSCE] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) + //{ + // return IVAS_ERR_FAILED_ALLOC; + //} +#endif +#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n + st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); +#endif } /* Metadata only initialized for the last CPE index*/ @@ -729,6 +811,14 @@ void destroy_core_enc( if ( hCoreCoder->hBstr != NULL ) { +#ifdef IND_LIST_DYN + /* deallocate buffer of indices */ + if ( hCoreCoder->hBstr->ind_list != NULL ) + { + free( hCoreCoder->hBstr->ind_list ); + } +#endif + free( hCoreCoder->hBstr ); hCoreCoder->hBstr = NULL; } diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 8049f5215c..c9c664f7c7 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -48,7 +48,11 @@ struct IVAS_ENC { Encoder_Struct *st_ivas; +#ifdef IND_LIST_DYN + //Indice *ind_list[MAX_NUM_DATA]; /* list of indices */ +#else Indice ind_list[MAX_NUM_DATA][MAX_NUM_INDICES]; /* list of indices */ +#endif Indice ind_list_metadata[MAX_NUM_METADATA][MAX_BITS_METADATA]; /* list of indices for metadata */ ENC_CORE_HANDLE hCoreCoder; bool isConfigured; @@ -134,6 +138,19 @@ ivas_error IVAS_ENC_Open( * Initialize indices *-----------------------------------------------------------------*/ +#ifdef IND_LIST_DYN + /* allocate ind_list[0] - for the first transport channel */ + //if ( ( ( *phIvasEnc )->ind_list[0] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) + //{ + // return IVAS_ERR_FAILED_ALLOC; + //} + + //for ( i = 0; i < MAX_NUM_DATA; ++i ) + //{ + // ( *phIvasEnc )->ind_list[i] = NULL; + //} +#else + for ( i = 0; i < MAX_NUM_DATA; ++i ) { for ( j = 0; j < MAX_NUM_INDICES; ++j ) @@ -142,6 +159,7 @@ ivas_error IVAS_ENC_Open( ( *phIvasEnc )->ind_list[i][j].value = 0; } } +#endif for ( i = 0; i < MAX_NUM_METADATA; ++i ) { @@ -198,6 +216,10 @@ void IVAS_ENC_Close( IVAS_ENC_HANDLE *phIvasEnc /* i/o: pointer to IVAS encoder handle */ ) { +#ifdef IND_LIST_DYN + //int16_t i; +#endif + /* Free all memory */ if ( phIvasEnc == NULL || *phIvasEnc == NULL ) { @@ -220,6 +242,20 @@ void IVAS_ENC_Close( ( *phIvasEnc )->st_ivas = NULL; +#ifdef IND_LIST_DYN + //for ( i = 0; i < MAX_NUM_DATA; ++i ) + //{ + // if ( ( *phIvasEnc )->ind_list[i] != NULL ) + // { + // free( ( *phIvasEnc )->ind_list[i] ); + // } + // else + // { + // break; + // } + //} +#endif + #ifdef BITSTREAM_INDICES_MEMORY #define WMC_TOOL_SKIP free( *phIvasEnc ); @@ -228,6 +264,7 @@ void IVAS_ENC_Close( free( *phIvasEnc ); #endif + *phIvasEnc = NULL; phIvasEnc = NULL; @@ -904,7 +941,11 @@ static ivas_error configureEncoder( * Finalize initialization *-----------------------------------------------------------------*/ - if ( ( error = ivas_init_encoder( st_ivas, hIvasEnc->ind_list, hIvasEnc->ind_list_metadata ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_init_encoder( st_ivas, +#ifndef IND_LIST_DYN + hIvasEnc->ind_list, +#endif + hIvasEnc->ind_list_metadata ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index ec7fb594d1..3fe7f6b019 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -51,11 +51,19 @@ * Indice *------------------------------------------------------------------------------------------*/ +#ifdef IND_LIST_DYN +typedef struct +{ + uint16_t value; /* value of the quantized indice */ + int16_t nb_bits; /* number of bits used for the quantization of the indice */ +} Indice, *INDICE_HANDLE; +#else typedef struct { uint16_t value; /* value of the quantized indice */ int16_t nb_bits; /* number of bits used for the quantization of the indice */ } Indice; +#endif /*----------------------------------------------------------------------------------* * Bitstream structure -- GitLab From fa905e29d2a1b87e7aa649bf901bd150c9b4eae5 Mon Sep 17 00:00:00 2001 From: malenov Date: Fri, 10 Feb 2023 17:08:45 +0100 Subject: [PATCH 02/43] dynamical allocation of ind_list[] --- apps/encoder.c | 6 +- lib_com/bitstream.c | 222 +++++++++++++++++++++++++- lib_com/prot.h | 18 ++- lib_enc/acelp_core_switch_enc.c | 17 ++ lib_enc/cng_enc.c | 8 + lib_enc/eval_pit_contr.c | 8 + lib_enc/igf_enc.c | 85 ++++++++++ lib_enc/ivas_corecoder_enc_reconfig.c | 7 + lib_enc/ivas_lfe_enc.c | 16 ++ lib_enc/ivas_sba_enc.c | 10 ++ lib_enc/stat_enc.h | 4 + lib_rend/lib_rend.c | 13 +- 12 files changed, 398 insertions(+), 16 deletions(-) diff --git a/apps/encoder.c b/apps/encoder.c index b7bc8b6433..37388677dc 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -720,9 +720,9 @@ int main( #ifdef DEBUG_IND { - int16_t tmp_i = -1; - - dbgwrite( &tmp_i, sizeof( int16_t ), 1, 960 - total_num_id, "res/ind_list.x" ); + //int16_t tmp_i = -1; + //dbgwrite( &tmp_i, sizeof( int16_t ), 1, 960 - total_num_id, "res/ind_list.x" ); + dbgwrite( &total_num_id, sizeof( int16_t ), 1, 1, "res/ind_total_num.x" ); } #endif diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 5f7be30f67..7db451ae9d 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -66,6 +66,7 @@ int16_t total_num_id = 0; FILE *FEC_pattern = NULL; /* FEC pattern file (for simulation of FEC) */ #endif +#ifndef IND_LIST_DYN /*-------------------------------------------------------------------* * pack_bit() * @@ -119,6 +120,7 @@ static Word16 unpack_bit( return bit; } +#endif /*-------------------------------------------------------------------* * rate2AMRWB_IOmode() @@ -241,6 +243,9 @@ ivas_error push_indice( ) { int16_t i; +#ifdef IND_LIST_DYN + int16_t j; +#endif ivas_error error; error = IVAS_ERR_OK; @@ -271,8 +276,35 @@ ivas_error push_indice( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice ID = %d exceeds the total number of indices: %d (frame %d) !\n", id, MAX_NUM_INDICES, frame ); } + +#ifdef IND_LIST_DYN + /* check, if max number of indices has not been exceeded */ + if ( hBstr->nb_ind_tot >= MAX_NUM_INDICES ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Maximum number of indices %d has been exceeded (frame %d) !\n", MAX_NUM_INDICES, frame ); + } +#endif #endif +#ifdef IND_LIST_DYN + /* find the location in the list of indices */ + i = hBstr->nb_ind_tot; + while ( i > 0 && id < hBstr->ind_list[i - 1].id ) + { + i--; + } + + /* shift indices, if the new id is to be written somewhere inside the list */ + if ( i < hBstr->nb_ind_tot ) + { + for ( j = hBstr->nb_ind_tot; j > i; j-- ) + { + hBstr->ind_list[j].id = hBstr->ind_list[j - 1].id; + hBstr->ind_list[j].nb_bits = hBstr->ind_list[j - 1].nb_bits; + hBstr->ind_list[j].value = hBstr->ind_list[j - 1].value; + } + } +#else if ( hBstr->last_ind == id ) { /* indice with the same name as the previous one */ @@ -287,20 +319,31 @@ ivas_error push_indice( i++; } } +#endif +#ifndef IND_LIST_DYN #ifdef DEBUGGING if ( hBstr->ind_list[i].nb_bits > 0 ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice ID = %d with value %d is trying to re-write an existing indice (frame %d) !\n", id, value, frame ); } +#endif #endif /* store the new indice in the list */ +#ifdef IND_LIST_DYN + hBstr->ind_list[i].id = id; +#endif hBstr->ind_list[i].value = value; hBstr->ind_list[i].nb_bits = nb_bits; /* updates */ +#ifdef IND_LIST_DYN + hBstr->nb_ind_tot++; + hBstr->next_ind++; +#else hBstr->next_ind = i + 1; +#endif hBstr->last_ind = id; hBstr->nb_bits_tot += nb_bits; @@ -333,6 +376,9 @@ ivas_error push_next_indice( #endif ) { +#ifdef IND_LIST_DYN + int16_t prev_id; +#endif ivas_error error; error = IVAS_ERR_OK; @@ -356,20 +402,47 @@ ivas_error push_next_indice( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Total number of indices exceeded: %d !\n", MAX_NUM_INDICES ); } +#ifndef IND_LIST_DYN if ( hBstr->ind_list[hBstr->next_ind].nb_bits > 0 ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice with value %d is trying to re-write an existing indice (frame %d) !\n", value, frame ); } #endif +#endif + +#ifdef IND_LIST_DYN + /* get the id of the previous indice -> it will be re-used */ + if ( hBstr->nb_ind_tot > 0 ) + { + prev_id = hBstr->ind_list[hBstr->nb_ind_tot - 1].id; + } + else + { + prev_id = 0; + } +#endif /* store the values in the list */ - hBstr->ind_list[hBstr->next_ind].value = value; - hBstr->ind_list[hBstr->next_ind].nb_bits = nb_bits; +#ifdef IND_LIST_DYN + hBstr->ind_list[hBstr->nb_ind_tot].id = prev_id; +#endif + hBstr->ind_list[hBstr->nb_ind_tot].value = value; + hBstr->ind_list[hBstr->nb_ind_tot].nb_bits = nb_bits; + + /* updates */ +#ifdef IND_LIST_DYN + hBstr->nb_ind_tot++; + hBstr->next_ind = hBstr->nb_ind_tot; +#else hBstr->next_ind++; +#endif - /* update the total number of bits already written */ hBstr->nb_bits_tot += nb_bits; +#ifdef DEBUG_IND + dbgwrite( &hBstr->last_ind, sizeof( int16_t ), 1, 1, "res/ind_list.x" ); + total_num_id++; +#endif return error; } @@ -398,10 +471,27 @@ void push_next_bits( uint16_t code; int16_t i, nb_bits_m15; Indice *ptr; +#ifdef IND_LIST_DYN + int16_t prev_id; +#endif #ifdef DEBUG_BS_READ_WRITE printf( "%s: %d: %d\n", func, line, nb_bits ); #endif +#ifdef IND_LIST_DYN + ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; + + /* get the id of the previous indice -> will be re-used here as well */ + if ( hBstr->nb_ind_tot > 0 ) + { + prev_id = hBstr->ind_list[hBstr->nb_ind_tot - 1].id; + } + else + { + prev_id = 0; + } +#else ptr = &hBstr->ind_list[hBstr->next_ind]; +#endif nb_bits_m15 = nb_bits - 15; for ( i = 0; i < nb_bits_m15; i += 16 ) @@ -413,8 +503,18 @@ void push_next_bits( printf( "code: %d\n", code ); #endif ptr->nb_bits = 16; +#ifdef IND_LIST_DYN + ptr->id = prev_id; + hBstr->nb_ind_tot++; +#endif ++ptr; + +#ifdef DEBUG_IND + dbgwrite( &hBstr->last_ind, sizeof( int16_t ), 1, 1, "res/ind_list.x" ); + total_num_id++; +#endif } + for ( ; i < nb_bits; ++i ) { ptr->value = bits[i]; @@ -422,15 +522,104 @@ void push_next_bits( printf( "value: %d\n", ptr->value ); #endif ptr->nb_bits = 1; +#ifdef IND_LIST_DYN + ptr->id = prev_id; + hBstr->nb_ind_tot++; +#endif ++ptr; + +#ifdef DEBUG_IND + dbgwrite( &hBstr->last_ind, sizeof( int16_t ), 1, 1, "res/ind_list.x" ); + total_num_id++; +#endif } + hBstr->next_ind = (int16_t) ( ptr - hBstr->ind_list ); hBstr->nb_bits_tot = hBstr->nb_bits_tot + nb_bits; + return; } +#ifdef IND_LIST_DYN +/*-------------------------------------------------------------------* + * find_indice() + * + * Find indice based on its id + *-------------------------------------------------------------------*/ + +/*! r: result: index of the indice in the list, -1 if not found */ +int16_t find_indice( + BSTR_ENC_HANDLE hBstr, /* i : encoder bitstream handle */ + int16_t id, /* i : ID of the indice */ + uint16_t *value, /* o : value of the quantized indice */ + int16_t *nb_bits /* o : number of bits used to quantize the indice */ +) +{ + int16_t i; + + for ( i = 0; i < hBstr->nb_ind_tot; i++ ) + { + if ( hBstr->ind_list[i].id == id && hBstr->ind_list[i].nb_bits > 0 ) + { + *value = hBstr->ind_list[i].value; + *nb_bits = hBstr->ind_list[i].nb_bits; + return i; + } + } + + return -1; +} + +/*-------------------------------------------------------------------* + * delete_indice() + * + * Delete indice based on its id (note, that nb_ind_tot and nb_bits_tot are updated) + *-------------------------------------------------------------------*/ + +/*! r: number of deleted indices */ +uint16_t delete_indice( + BSTR_ENC_HANDLE hBstr, /* i : encoder bitstream handle */ + int16_t id /* i : ID of the indice */ +) +{ + int16_t i, j; + + j = 0; + for ( i = 0; i < hBstr->nb_ind_tot; i++ ) + { + if ( hBstr->ind_list[i].id == id ) + { + hBstr->nb_bits_tot -= hBstr->ind_list[i].nb_bits; + continue; + } + + if ( j < i ) + { + /* shift the indice left */ + hBstr->ind_list[j].id = hBstr->ind_list[i].id; + hBstr->ind_list[j].value = hBstr->ind_list[i].value; + hBstr->ind_list[j].nb_bits = hBstr->ind_list[i].nb_bits; + } + + j++; + } + + hBstr->nb_ind_tot = j; + hBstr->next_ind = j; + + for ( ; j < i; j++ ) + { + /* reset the shifted indices at the end of the list */ + hBstr->ind_list[j].nb_bits = -1; + } + + return i - j; +} +#endif + + /*-------------------------------------------------------------------* * get_next_indice() * @@ -647,6 +836,9 @@ void reset_indices_enc( int16_t i; hBstr->nb_bits_tot = 0; +#ifdef IND_LIST_DYN + hBstr->nb_ind_tot = 0; +#endif hBstr->next_ind = 0; hBstr->last_ind = -1; @@ -679,7 +871,11 @@ void reset_indices_dec( *-------------------------------------------------------------------*/ static int16_t write_indices_to_stream( +#ifdef IND_LIST_DYN + Indice *ind_list, +#else Indice *ind_list_metadata, +#endif uint16_t **pt_stream, const int16_t inc, const int16_t num_indices ) @@ -693,8 +889,13 @@ static int16_t write_indices_to_stream( for ( i = 0; i < num_indices; i++ ) { +#ifdef IND_LIST_DYN + value = ind_list[i].value; + nb_bits = ind_list[i].nb_bits; +#else value = ind_list_metadata[i].value; nb_bits = ind_list_metadata[i].nb_bits; +#endif if ( nb_bits > 0 ) { @@ -726,6 +927,10 @@ static int16_t write_indices_to_stream( { /* fprintf( stderr, "Warning: %s: nb_bits == 0!\n", __func__ ); */ } + else + { + /* fprintf( stderr, "Warning: %s: nb_bits == %d!\n", __func__, nb_bits ); */ + } #endif } #ifdef ENABLE_BITRATE_VERIFICATION @@ -851,7 +1056,13 @@ static ivas_error write_indices_element( #ifdef ENABLE_BITRATE_VERIFICATION total_nb_bits = #endif - write_indices_to_stream( sts[n]->hBstr->ind_list, &pt_stream_loc, 1, MAX_NUM_INDICES ); + write_indices_to_stream( sts[n]->hBstr->ind_list, &pt_stream_loc, 1, +#ifdef IND_LIST_DYN + sts[n]->hBstr->nb_ind_tot +#else + MAX_NUM_INDICES +#endif + ); #ifdef ENABLE_BITRATE_VERIFICATION if ( total_nb_bits != sts[n]->hBstr->nb_bits_tot ) @@ -984,7 +1195,7 @@ ivas_error write_indices_ivas( return error; } - +#ifndef IND_LIST_DYN /*-------------------------------------------------------------------* * indices_to_serial_generic() * @@ -1034,6 +1245,7 @@ void indices_to_serial_generic( return; } +#endif /*---------------------------------------------------------------------* * convertSerialToBytestream( ) diff --git a/lib_com/prot.h b/lib_com/prot.h index 784527e1bf..a94c2a7441 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -515,6 +515,21 @@ void push_next_bits( #endif ); +#ifdef IND_LIST_DYN +int16_t find_indice( /* o : index of the indice in the list, -1 if not found */ + BSTR_ENC_HANDLE hBstr, /* i : encoder bitstream handle */ + int16_t id, /* i : ID of the indice */ + uint16_t *value, /* o : value of the quantized indice */ + int16_t *nb_bits /* o : number of bits used to quantize the indice */ +); + +uint16_t delete_indice( /* o : number of deleted indices */ + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + int16_t id /* i : ID of the indice */ +); +#endif + + /*! r: value of the indice */ #ifdef DEBUG_BS_READ_WRITE #define get_next_indice( ... ) get_next_indice_( __VA_ARGS__, __LINE__, __func__ ) @@ -612,13 +627,14 @@ Decoder_State **reset_elements( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); - +#ifndef IND_LIST_DYN void indices_to_serial_generic( const Indice *ind_list, /* i : indices list */ const Word16 num_indices, /* i : number of indices to write */ UWord8 *pFrame, /* o : byte array with bit packet and byte aligned coded speech data */ Word16 *pFrame_size /* o : size of the binary encoded access unit [bits] */ ); +#endif void convertSerialToBytestream( const uint16_t *const serial, /* i : input serial bitstream with values 0 and 1 */ diff --git a/lib_enc/acelp_core_switch_enc.c b/lib_enc/acelp_core_switch_enc.c index 291c2128a1..1a3488d92d 100644 --- a/lib_enc/acelp_core_switch_enc.c +++ b/lib_enc/acelp_core_switch_enc.c @@ -73,6 +73,10 @@ void acelp_core_switch_enc( const float *inp; int32_t cbrate; float Aq[2 * ( M + 1 )]; +#ifdef IND_LIST_DYN + uint16_t value; + int16_t nb_bits; +#endif BSTR_ENC_HANDLE hBstr = st->hBstr; /* initializations */ @@ -159,12 +163,25 @@ void acelp_core_switch_enc( * Manipulate ACELP subframe indices (move them to their proper place) *----------------------------------------------------------------*/ +#ifdef IND_LIST_DYN + i = find_indice( hBstr, TAG_ACELP_SUBFR_LOOP_START, &value, &nb_bits ); +#ifdef DEBUGGING + assert( i >= 0 && "Internal error in ACELP core switching - unable to find ACELP subframe indices!" ); +#endif + while ( hBstr->ind_list[i].id == TAG_ACELP_SUBFR_LOOP_START ) + { + push_indice( hBstr, IND_CORE_SWITCHING_CELP_SUBFRAME, hBstr->ind_list[i].value, hBstr->ind_list[i].nb_bits ); + i++; + } + delete_indice( hBstr, TAG_ACELP_SUBFR_LOOP_START ); +#else for ( i = 0; i < 20; i++ ) { hBstr->ind_list[IND_CORE_SWITCHING_CELP_SUBFRAME + i].value = hBstr->ind_list[TAG_ACELP_SUBFR_LOOP_START + i].value; hBstr->ind_list[IND_CORE_SWITCHING_CELP_SUBFRAME + i].nb_bits = hBstr->ind_list[TAG_ACELP_SUBFR_LOOP_START + i].nb_bits; hBstr->ind_list[TAG_ACELP_SUBFR_LOOP_START + i].nb_bits = -1; } +#endif /*----------------------------------------------------------------* * BWE encoding diff --git a/lib_enc/cng_enc.c b/lib_enc/cng_enc.c index 04d9e41166..0f17b82923 100644 --- a/lib_enc/cng_enc.c +++ b/lib_enc/cng_enc.c @@ -885,8 +885,12 @@ void swb_CNG_enc( else if ( st->element_mode == IVAS_CPE_DFT && st->core_brate == SID_2k40 ) { /* LF-boost not used in DFT-stereo, instead the bandwidth is transmitted */ +#ifdef IND_LIST_DYN + delete_indice( st->hBstr, IND_CNG_ENV1 ); +#else st->hBstr->nb_bits_tot = st->hBstr->nb_bits_tot - st->hBstr->ind_list[IND_CNG_ENV1].nb_bits; st->hBstr->ind_list[IND_CNG_ENV1].nb_bits = -1; +#endif push_indice( st->hBstr, IND_BWIDTH, st->bwidth, 2 ); push_indice( st->hBstr, IND_UNUSED, 0, 4 ); push_indice( st->hBstr, IND_SID_BW, 1, 1 ); @@ -962,8 +966,12 @@ static void shb_CNG_encod( push_indice( hBstr, IND_SHB_CNG_GAIN, idx_ener, 4 ); push_indice( hBstr, IND_SID_BW, 1, 1 ); +#ifdef IND_LIST_DYN + delete_indice( hBstr, IND_CNG_ENV1 ); +#else hBstr->nb_bits_tot = hBstr->nb_bits_tot - hBstr->ind_list[IND_CNG_ENV1].nb_bits; hBstr->ind_list[IND_CNG_ENV1].nb_bits = -1; +#endif if ( st->element_mode == IVAS_CPE_DFT ) { push_indice( st->hBstr, IND_BWIDTH, st->bwidth, 2 ); diff --git a/lib_enc/eval_pit_contr.c b/lib_enc/eval_pit_contr.c index 5dd3101772..76bf54b025 100644 --- a/lib_enc/eval_pit_contr.c +++ b/lib_enc/eval_pit_contr.c @@ -326,18 +326,26 @@ int16_t Pit_exc_contribution_len( /* pitch contribution useless - delete all previously written indices belonging to pitch contribution */ for ( i = TAG_ACELP_SUBFR_LOOP_START; i < TAG_ACELP_SUBFR_LOOP_END; i++ ) { +#ifdef IND_LIST_DYN + delete_indice( hBstr, i ); +#else if ( hBstr->ind_list[i].nb_bits != -1 ) { hBstr->nb_bits_tot -= hBstr->ind_list[i].nb_bits; hBstr->ind_list[i].nb_bits = -1; } +#endif } +#ifdef IND_LIST_DYN + delete_indice( hBstr, IND_ES_PRED ); +#else if ( hBstr->ind_list[IND_ES_PRED].nb_bits != -1 ) { hBstr->nb_bits_tot -= hBstr->ind_list[IND_ES_PRED].nb_bits; hBstr->ind_list[IND_ES_PRED].nb_bits = -1; } +#endif } if ( st->core_brate < CFREQ_BITRATE ) diff --git a/lib_enc/igf_enc.c b/lib_enc/igf_enc.c index 9c68e3fcc7..1f18bb8d13 100644 --- a/lib_enc/igf_enc.c +++ b/lib_enc/igf_enc.c @@ -1707,6 +1707,41 @@ void IGFEncSetMode( return; } +#ifdef IND_LIST_DYN + +/*-------------------------------------------------------------------* + * pack_bit() + * + * insert a bit into packed octet + *-------------------------------------------------------------------*/ + +static void pack_bit( + const int16_t bit, /* i : bit to be packed */ + uint8_t **pt, /* i/o: pointer to octet array into which bit will be placed */ + uint8_t *omask /* i/o: output mask to indicate where in the octet the bit is to be written */ +) +{ + if ( *omask == 0x80 ) + { + **pt = 0; + } + + if ( bit != 0 ) + { + **pt = **pt | *omask; + } + + *omask >>= 1; + if ( *omask == 0 ) + { + *omask = 0x80; + ( *pt )++; + } + + return; +} + +#endif /*-------------------------------------------------------------------* * IGFEncConcatenateBitstream() @@ -1722,9 +1757,58 @@ void IGFEncConcatenateBitstream( { int16_t i; IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; +#ifdef IND_LIST_DYN + Indice *ind_list; + uint8_t *pFrame; /* byte array with bit packet and byte aligned coded speech data */ + int16_t *pFrame_size; /* number of bits in the binary encoded access unit [bits] */ + int16_t k, nb_bits_written; + int32_t imask; + uint8_t omask; +#endif hPrivateData = &hIGFEnc->igfData; +#ifndef IND_LIST_DYN hBstr->next_ind -= bsBits; +#endif + +#ifdef IND_LIST_DYN + ind_list = &hBstr->ind_list[hBstr->nb_ind_tot - bsBits]; /* here, we assume that each bit has been written as a single indice */ + pFrame = hPrivateData->igfBitstream; + pFrame_size = &hPrivateData->igfBitstreamBits; + nb_bits_written = 0; + + omask = ( 0x80 >> ( *pFrame_size & 0x7 ) ); + pFrame += *pFrame_size >> 3; + + /* bitstream packing (conversion of individual indices into a serial stream) */ + for ( i = 0; i < bsBits; i++ ) + { + if ( ind_list[i].nb_bits > 0 ) + { + /* mask from MSB to LSB */ + imask = 1 << ( ind_list[i].nb_bits - 1 ); + + /* write bit by bit */ + for ( k = 0; k < ind_list[i].nb_bits; k++ ) + { + pack_bit( ind_list[i].value & imask, &pFrame, &omask ); + imask >>= 1; + } + nb_bits_written += ind_list[i].nb_bits; + + /* delete the indice */ + ind_list[i].nb_bits = -1; + } + } + + *pFrame_size += nb_bits_written; + + /* update list of indices */ + hBstr->nb_ind_tot -= bsBits; + hBstr->nb_bits_tot -= nb_bits_written; + hBstr->next_ind -= bsBits; + +#else indices_to_serial_generic( &hBstr->ind_list[hBstr->next_ind], bsBits, hPrivateData->igfBitstream, &hPrivateData->igfBitstreamBits ); @@ -1735,6 +1819,7 @@ void IGFEncConcatenateBitstream( } hBstr->nb_bits_tot -= hIGFEnc->infoTotalBitsPerFrameWritten; +#endif return; } diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index 233f7681f7..a2428a0630 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -177,6 +177,7 @@ ivas_error ivas_corecoder_enc_reconfig( { if ( hBstr->ind_list[i].nb_bits > 0 ) { + temp_ind_list[i].id = hBstr->ind_list[i].id; temp_ind_list[i].value = hBstr->ind_list[i].value; temp_ind_list[i].nb_bits = hBstr->ind_list[i].nb_bits; } @@ -314,6 +315,7 @@ ivas_error ivas_corecoder_enc_reconfig( { if ( temp_ind_list[i].nb_bits > 0 ) { + st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].id = temp_ind_list[i].id; st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].value = temp_ind_list[i].value; st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; } @@ -321,6 +323,7 @@ ivas_error ivas_corecoder_enc_reconfig( nb_bits += temp_ind_list[i].nb_bits; i++; } + st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->nb_ind_tot = i; #ifdef DEBUGGING assert( ( nb_bits == nb_bits_tot ) && "Error restoring bitstream information during core-coder reconfiguration!\n" ); #endif @@ -372,6 +375,7 @@ ivas_error ivas_corecoder_enc_reconfig( { if ( temp_ind_list[i].nb_bits > 0 ) { + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].id = temp_ind_list[i].id; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].value = temp_ind_list[i].value; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; } @@ -379,6 +383,7 @@ ivas_error ivas_corecoder_enc_reconfig( nb_bits += temp_ind_list[i].nb_bits; i++; } + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_ind_tot = i; #ifdef DEBUGGING assert( ( nb_bits == nb_bits_tot ) && "Error restoring bitstream information during core-coder reconfiguration!\n" ); #endif @@ -430,6 +435,7 @@ ivas_error ivas_corecoder_enc_reconfig( { if ( temp_ind_list[i].nb_bits > 0 ) { + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].id = temp_ind_list[i].id; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].value = temp_ind_list[i].value; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; } @@ -437,6 +443,7 @@ ivas_error ivas_corecoder_enc_reconfig( nb_bits += temp_ind_list[i].nb_bits; i++; } + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_ind_tot = i; #ifdef DEBUGGING assert( ( nb_bits == nb_bits_tot ) && "Error restoring bitstream information during core-coder reconfiguration!\n" ); #endif diff --git a/lib_enc/ivas_lfe_enc.c b/lib_enc/ivas_lfe_enc.c index fc16c279ee..4cdf46640a 100644 --- a/lib_enc/ivas_lfe_enc.c +++ b/lib_enc/ivas_lfe_enc.c @@ -259,11 +259,20 @@ static void ivas_lfe_enc_quant( { if ( quant_strategy == ( num_quant_strategies - 1 ) || ( ( target_bits + IVAS_LFE_ID_BITS ) >= base2_num_bits_tot ) ) { +#ifdef IND_LIST_DYN + /* reset bits buffer and code the indices with base 2 coding */ + for ( j = hBstr->nb_ind_tot - 1; j >= next_ind_pos_arith_enc; j-- ) + { + hBstr->ind_list[j].nb_bits = -1; + } + hBstr->nb_ind_tot = next_ind_pos_arith_enc; +#else /* reset bits buffer and code the indices with base 2 coding */ for ( j = hBstr->next_ind - 1; j >= next_ind_pos_arith_enc; j-- ) { hBstr->ind_list[j].nb_bits = -1; } +#endif hBstr->nb_bits_tot = bits_written_arith_enc; hBstr->next_ind = next_ind_pos_arith_enc; coding_strategy = 1; @@ -298,12 +307,19 @@ static void ivas_lfe_enc_quant( if ( quant_strategy < ( num_quant_strategies - 1 ) ) { /* reset all indices that were already written - TODO: maybe better store them temporarily first and write at the very end? */ +#ifdef IND_LIST_DYN + for ( j = hBstr->nb_ind_tot - 1; j >= next_ind_pos; j-- ) +#else for ( j = hBstr->next_ind - 1; j >= next_ind_pos; j-- ) +#endif { hBstr->ind_list[j].nb_bits = -1; } hBstr->nb_bits_tot = bits_written; +#ifdef IND_LIST_DYN + hBstr->nb_ind_tot = next_ind_pos; +#endif hBstr->next_ind = next_ind_pos; } } diff --git a/lib_enc/ivas_sba_enc.c b/lib_enc/ivas_sba_enc.c index eda030cebe..c6d6abd3b8 100644 --- a/lib_enc/ivas_sba_enc.c +++ b/lib_enc/ivas_sba_enc.c @@ -115,7 +115,9 @@ ivas_error ivas_sba_enc_reinit( ivas_error error; ENCODER_CONFIG_HANDLE hEncoderConfig; +#ifndef IND_LIST_DYN Indice *ind_list; +#endif BSTR_ENC_HANDLE hBstr; BSTR_ENC_HANDLE hMetaData; hEncoderConfig = st_ivas->hEncoderConfig; @@ -146,7 +148,9 @@ ivas_error ivas_sba_enc_reinit( } /* save bitstream information */ +#ifndef IND_LIST_DYN ind_list = hBstr->ind_list; +#endif ind_list_metadata = hMetaData->ind_list; /*------------------------------------------------------------------------------------------* @@ -240,9 +244,11 @@ ivas_error ivas_sba_enc_reinit( return error; } +#ifndef IND_LIST_DYN /* prepare bitstream buffers */ st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list + sce_id * MAX_NUM_INDICES; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); +#endif st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata + sce_id * MAX_BITS_METADATA; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); @@ -260,11 +266,15 @@ ivas_error ivas_sba_enc_reinit( return error; } +#ifndef IND_LIST_DYN /* prepare bitstream buffers */ +#endif for ( n = 0; n < CPE_CHANNELS; n++ ) { +#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list + ( cpe_id * CPE_CHANNELS + n ) * MAX_NUM_INDICES; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); +#endif if ( hEncoderConfig->Opt_DTX_ON ) { diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index 3fe7f6b019..0da30af73d 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -54,6 +54,7 @@ #ifdef IND_LIST_DYN typedef struct { + int16_t id; /* id of the indice */ uint16_t value; /* value of the quantized indice */ int16_t nb_bits; /* number of bits used for the quantization of the indice */ } Indice, *INDICE_HANDLE; @@ -71,6 +72,9 @@ typedef struct typedef struct bitstream_enc_data_structure { +#ifdef IND_LIST_DYN + int16_t nb_ind_tot; /* total number of indices already written */ +#endif int16_t nb_bits_tot; /* total number of bits already written */ Indice *ind_list; /* list of indices */ int16_t next_ind; /* pointer to the next empty slot in the list of indices */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index c3b3ef07c2..3da85f14fe 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -30,6 +30,12 @@ *******************************************************************************************************/ +#include +#include +#include +#include +#include +#include #include "options.h" #include "ivas_cnst.h" #include "lib_rend.h" @@ -44,13 +50,6 @@ #include "prot.h" #include "wmc_auto.h" -#include -#include -#include -#include -#include -#include - /* Maximum buffer length (per channel) in samples. * Keep this separate from L_FRAME48k in case we want to support different size later */ #define MAX_BUFFER_LENGTH_PER_CHANNEL ( L_FRAME48k ) -- GitLab From 5c9b1761d795daa44f0a731d7c60b1741bdcfd36 Mon Sep 17 00:00:00 2001 From: malenov Date: Tue, 14 Feb 2023 13:30:42 +0100 Subject: [PATCH 03/43] fixes within IND_LIST_DYN --- apps/encoder.c | 21 +++--- lib_com/bitstream.c | 94 +++++++++++++++++++-------- lib_com/cnst.h | 2 + lib_com/options.h | 2 +- lib_com/prot.h | 3 + lib_enc/dtx.c | 8 ++- lib_enc/enc_ppp.c | 8 ++- lib_enc/fd_cng_enc.c | 16 ++++- lib_enc/init_enc.c | 87 ++++++++++++++++++++++++- lib_enc/ivas_corecoder_enc_reconfig.c | 36 +++++++++- lib_enc/ivas_cpe_enc.c | 6 +- lib_enc/ivas_init_enc.c | 24 +++++++ lib_enc/ivas_ism_metadata_enc.c | 3 + lib_enc/ivas_sba_enc.c | 6 ++ lib_enc/ivas_sce_enc.c | 6 +- lib_enc/ivas_spar_encoder.c | 6 +- lib_enc/ivas_spar_md_enc.c | 3 + lib_enc/stat_enc.h | 2 +- 18 files changed, 278 insertions(+), 55 deletions(-) diff --git a/apps/encoder.c b/apps/encoder.c index 37388677dc..dec934b511 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -48,8 +48,9 @@ #define WMC_TOOL_SKIP -#ifdef DEBUG_IND -extern int16_t total_num_id; +#ifdef DEBUG_IND_LIST +extern int16_t max_total_num_ind; +extern int32_t max_at_brate; #endif /*------------------------------------------------------------------------------------------* @@ -572,9 +573,6 @@ int main( while ( 1 ) { -#ifdef DEBUG_IND - total_num_id = 0; -#endif /* Read the input data */ if ( ( error = AudioFileReader_read( audioReader, pcmBuf, pcmBufSize, &numSamplesRead ) ) != IVAS_ERR_OK ) @@ -718,14 +716,6 @@ int main( goto cleanup; } -#ifdef DEBUG_IND - { - //int16_t tmp_i = -1; - //dbgwrite( &tmp_i, sizeof( int16_t ), 1, 960 - total_num_id, "res/ind_list.x" ); - dbgwrite( &total_num_id, sizeof( int16_t ), 1, 1, "res/ind_total_num.x" ); - } -#endif - frame++; if ( !arg.quietModeEnabled ) { @@ -753,6 +743,11 @@ int main( print_snr(); #endif +#ifdef DEBUG_IND_LIST + printf( "\nMaximum total number of indices: %d at bitrate: %d\n", max_total_num_ind, max_at_brate ); +#endif + + /*------------------------------------------------------------------------------------------* * Close files and deallocate resources *------------------------------------------------------------------------------------------*/ diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 7db451ae9d..e92a86b78e 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -53,10 +53,6 @@ #ifdef DEBUGGING -#ifdef DEBUG_IND -int16_t total_num_id = 0; -#endif - #define FEC_SEED 12558 /*-------------------------------------------------------------------* @@ -66,6 +62,11 @@ int16_t total_num_id = 0; FILE *FEC_pattern = NULL; /* FEC pattern file (for simulation of FEC) */ #endif +#ifdef DEBUG_IND_LIST +int16_t max_total_num_ind = 0; +int32_t max_at_brate; +#endif + #ifndef IND_LIST_DYN /*-------------------------------------------------------------------* * pack_bit() @@ -272,16 +273,18 @@ ivas_error push_indice( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice ID = %d with value %d is trying to allocate %d bits which exceeds 16 bits (frame %d) !\n", id, value, nb_bits, frame ); } +#ifndef IND_LIST_DYN if ( id >= MAX_NUM_INDICES ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice ID = %d exceeds the total number of indices: %d (frame %d) !\n", id, MAX_NUM_INDICES, frame ); } +#endif #ifdef IND_LIST_DYN /* check, if max number of indices has not been exceeded */ - if ( hBstr->nb_ind_tot >= MAX_NUM_INDICES ) + if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Maximum number of indices %d has been exceeded (frame %d) !\n", MAX_NUM_INDICES, frame ); + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Maximum number of indices %d has been exceeded (frame %d) !\n", hBstr->max_num_indices, frame ); } #endif #endif @@ -341,17 +344,15 @@ ivas_error push_indice( #ifdef IND_LIST_DYN hBstr->nb_ind_tot++; hBstr->next_ind++; +#ifdef DEBUG_IND_LIST + assert( (hBstr->nb_ind_tot < hBstr->max_num_indices) && "Maximum number of indices has been exceeded!" ); +#endif #else hBstr->next_ind = i + 1; #endif hBstr->last_ind = id; hBstr->nb_bits_tot += nb_bits; -#ifdef DEBUG_IND - dbgwrite( &i, sizeof( int16_t ), 1, 1, "res/ind_list.x" ); - total_num_id++; -#endif - return error; } @@ -397,10 +398,12 @@ ivas_error push_next_indice( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice with value %d is trying to allocate %d bits which exceeds 16 bits !\n", value, nb_bits ); } +#ifndef IND_LIST_DYN if ( hBstr->next_ind >= MAX_NUM_INDICES ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Total number of indices exceeded: %d !\n", MAX_NUM_INDICES ); } +#endif #ifndef IND_LIST_DYN if ( hBstr->ind_list[hBstr->next_ind].nb_bits > 0 ) @@ -425,25 +428,27 @@ ivas_error push_next_indice( /* store the values in the list */ #ifdef IND_LIST_DYN hBstr->ind_list[hBstr->nb_ind_tot].id = prev_id; -#endif hBstr->ind_list[hBstr->nb_ind_tot].value = value; hBstr->ind_list[hBstr->nb_ind_tot].nb_bits = nb_bits; +#else + hBstr->ind_list[hBstr->next_ind].value = value; + hBstr->ind_list[hBstr->next_ind].nb_bits = nb_bits; +#endif /* updates */ #ifdef IND_LIST_DYN hBstr->nb_ind_tot++; hBstr->next_ind = hBstr->nb_ind_tot; +#ifdef DEBUG_IND_LIST + assert( ( hBstr->nb_ind_tot < hBstr->max_num_indices ) && "Maximum number of indices has been exceeded!" ); +#endif + #else hBstr->next_ind++; #endif hBstr->nb_bits_tot += nb_bits; -#ifdef DEBUG_IND - dbgwrite( &hBstr->last_ind, sizeof( int16_t ), 1, 1, "res/ind_list.x" ); - total_num_id++; -#endif - return error; } @@ -506,13 +511,12 @@ void push_next_bits( #ifdef IND_LIST_DYN ptr->id = prev_id; hBstr->nb_ind_tot++; +#ifdef DEBUG_IND_LIST + assert( ( hBstr->nb_ind_tot < hBstr->max_num_indices ) && "Maximum number of indices has been exceeded!" ); +#endif #endif ++ptr; -#ifdef DEBUG_IND - dbgwrite( &hBstr->last_ind, sizeof( int16_t ), 1, 1, "res/ind_list.x" ); - total_num_id++; -#endif } for ( ; i < nb_bits; ++i ) @@ -525,19 +529,17 @@ void push_next_bits( #ifdef IND_LIST_DYN ptr->id = prev_id; hBstr->nb_ind_tot++; +#ifdef DEBUG_IND_LIST + assert( ( hBstr->nb_ind_tot < hBstr->max_num_indices ) && "Maximum number of indices has been exceeded!" ); +#endif #endif ++ptr; -#ifdef DEBUG_IND - dbgwrite( &hBstr->last_ind, sizeof( int16_t ), 1, 1, "res/ind_list.x" ); - total_num_id++; -#endif } hBstr->next_ind = (int16_t) ( ptr - hBstr->ind_list ); hBstr->nb_bits_tot = hBstr->nb_bits_tot + nb_bits; - return; } @@ -1086,20 +1088,56 @@ static ivas_error write_indices_element( if ( st_ivas->hSCE[element_id]->hMetaData != NULL ) { reset_indices_enc( st_ivas->hSCE[element_id]->hMetaData, MAX_BITS_METADATA ); +#ifdef IND_LIST_DYN + st_ivas->hSCE[element_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; +#endif } - reset_indices_enc( sts[0]->hBstr, MAX_NUM_INDICES ); +#ifdef DEBUG_IND_LIST + /* find the maximum number of core-coder indices */ + if ( sts[0]->hBstr->nb_ind_tot > max_total_num_ind ) + { + max_total_num_ind = sts[0]->hBstr->nb_ind_tot; + max_at_brate = sts[0]->total_brate; + } +#endif + + reset_indices_enc( sts[0]->hBstr, +#ifdef IND_LIST_DYN + sts[0]->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); } else { if ( st_ivas->hCPE[element_id]->hMetaData != NULL ) { reset_indices_enc( st_ivas->hCPE[element_id]->hMetaData, MAX_BITS_METADATA ); +#ifdef IND_LIST_DYN + st_ivas->hCPE[element_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; +#endif } for ( n = 0; n < n_channels; n++ ) { - reset_indices_enc( sts[n]->hBstr, MAX_NUM_INDICES ); +#ifdef DEBUG_IND_LIST + /* find the maximum number of core-coder indices */ + if ( sts[n]->hBstr->nb_ind_tot > max_total_num_ind ) + { + max_total_num_ind = sts[n]->hBstr->nb_ind_tot; + max_at_brate = sts[0]->total_brate; + } +#endif + + reset_indices_enc( sts[n]->hBstr, +#ifdef IND_LIST_DYN + sts[n]->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); } } diff --git a/lib_com/cnst.h b/lib_com/cnst.h index db1dc3d898..4f03276837 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -449,7 +449,9 @@ enum IND_STEREO_2ND_CODER_T, IND_UNUSED, +#ifndef IND_LIST_DYN MAX_NUM_INDICES = IND_UNUSED + 772 /* Total 2640 in line with MAX_BITS_METADATA */ +#endif }; /*----------------------------------------------------------------------------------* diff --git a/lib_com/options.h b/lib_com/options.h index 2096942f81..603a041ded 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -57,8 +57,8 @@ /*#define MEM_COUNT_DETAILS*/ /* Output detailed memory analysis for the worst-case frame (writes to the file "mem_analysis.csv") */ /*#define BITSTREAM_INDICES_MEMORY*/ /* Don't count memory for bitstream Indice at the encoder - it is a temporary solution for development only */ -#define DEBUG_IND #define IND_LIST_DYN /* dynamic allocation of ind_list based on transport channels */ +#define DEBUG_IND_LIST #ifdef DEBUGGING diff --git a/lib_com/prot.h b/lib_com/prot.h index a94c2a7441..cb7f02cabe 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -2238,6 +2238,9 @@ void read_next_force( #endif ivas_error init_encoder( Encoder_State *st, /* i/o: state structure */ +#ifdef IND_LIST_DYN + ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : encoder configuration handle */ +#endif const int16_t idchan, /* i : channel ID */ const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ const int16_t interval_SID, /* i : interval for SID update */ diff --git a/lib_enc/dtx.c b/lib_enc/dtx.c index 3aa78adb65..5916e94288 100644 --- a/lib_enc/dtx.c +++ b/lib_enc/dtx.c @@ -260,7 +260,13 @@ void dtx( /* reset the bitstream (IVAS format signaling was already written) */ if ( st->element_mode != IVAS_CPE_MDCT && st->hBstr != NULL ) { - reset_indices_enc( st->hBstr, MAX_NUM_INDICES ); + reset_indices_enc( st->hBstr, +#ifdef IND_LIST_DYN + st->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); } } diff --git a/lib_enc/enc_ppp.c b/lib_enc/enc_ppp.c index 823d6cf3cd..8d1ffcecd7 100644 --- a/lib_enc/enc_ppp.c +++ b/lib_enc/enc_ppp.c @@ -169,7 +169,13 @@ ivas_error encod_ppp( } /* delete previous indices */ - reset_indices_enc( hBstr, MAX_NUM_INDICES ); + reset_indices_enc( hBstr, +#ifdef IND_LIST_DYN + hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); /* signaling matrix (writing of signaling bits) */ signaling_enc( st ); diff --git a/lib_enc/fd_cng_enc.c b/lib_enc/fd_cng_enc.c index 20aa31f3ca..414749aa83 100644 --- a/lib_enc/fd_cng_enc.c +++ b/lib_enc/fd_cng_enc.c @@ -893,8 +893,20 @@ void stereoFdCngCoherence( else if ( sts[0]->core_brate <= SID_2k40 && sts[1]->core_brate <= SID_2k40 ) { /* case: no VAD for both channels -> INACTIVE FRAME */ - reset_indices_enc( sts[0]->hBstr, MAX_NUM_INDICES ); - reset_indices_enc( sts[1]->hBstr, MAX_NUM_INDICES ); + reset_indices_enc( sts[0]->hBstr, +#ifdef IND_LIST_DYN + sts[0]->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); + reset_indices_enc( sts[1]->hBstr, +#ifdef IND_LIST_DYN + sts[1]->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); /* synchronize SID sending for variable SID rate */ if ( sts[0]->core_brate != sts[1]->core_brate ) diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index dbd5693f1c..194c11907b 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -55,6 +55,9 @@ ivas_error init_encoder( Encoder_State *st, /* i/o: state structure */ +#ifdef IND_LIST_DYN + ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : encoder configuration handle */ +#endif const int16_t idchan, /* i : channel ID */ const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ const int16_t interval_SID, /* i : interval for SID update */ @@ -113,13 +116,93 @@ ivas_error init_encoder( } #ifdef IND_LIST_DYN + /* set the maximum required number of indices */ + if ( hEncoderConfig->ivas_format == MONO_FORMAT ) + { + if ( st->total_brate < IVAS_24k4 ) + { + st->hBstr->max_num_indices = 450; + } + else + { + st->hBstr->max_num_indices = 450; + } + } + else if ( hEncoderConfig->ivas_format == STEREO_FORMAT ) + { + if ( st->total_brate < IVAS_24k4 ) + { + st->hBstr->max_num_indices = 240; + } + else + { + st->hBstr->max_num_indices = 350; + } + } + else if ( hEncoderConfig->ivas_format == ISM_FORMAT ) + { + if ( st->total_brate < IVAS_24k4 ) + { + st->hBstr->max_num_indices = 150; + } + else + { + st->hBstr->max_num_indices = 350; + } + } + else if ( hEncoderConfig->ivas_format == SBA_FORMAT ) + { + if ( st->total_brate < IVAS_24k4 ) + { + st->hBstr->max_num_indices = 250; + } + else if ( st->total_brate < IVAS_128k ) + { + st->hBstr->max_num_indices = 450; + } + else + { + st->hBstr->max_num_indices = 700; + } + } + else if ( hEncoderConfig->ivas_format == MASA_FORMAT ) + { + if ( st->total_brate < IVAS_24k4 ) + { + st->hBstr->max_num_indices = 250; + } + else if ( st->total_brate < IVAS_160k ) + { + st->hBstr->max_num_indices = 450; + } + else + { + st->hBstr->max_num_indices = 700; + } + } + else if ( hEncoderConfig->ivas_format == MC_FORMAT ) + { + if ( st->total_brate < IVAS_24k4 ) + { + st->hBstr->max_num_indices = 550; + } + else + { + st->hBstr->max_num_indices = 1050; + } + } + else + { + st->hBstr->max_num_indices = 1050; + } + /* allocate buffer of indices */ - if ( ( st->hBstr->ind_list = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) + if ( ( st->hBstr->ind_list = (INDICE_HANDLE) malloc( st->hBstr->max_num_indices * sizeof( Indice ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); } - reset_indices_enc( st->hBstr, MAX_NUM_INDICES ); + reset_indices_enc( st->hBstr, st->hBstr->max_num_indices ); #endif } else diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index a2428a0630..9189ce3876 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -301,7 +301,13 @@ ivas_error ivas_corecoder_enc_reconfig( /* only reset indices if it is not the first index list, this already contains the IVAS format bits */ if ( sce_id > 0 ) { - reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); + reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, +#ifdef IND_LIST_DYN + st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); } else { @@ -332,6 +338,10 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata + sce_id * MAX_BITS_METADATA; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); +#ifdef IND_LIST_DYN + st_ivas->hSCE[sce_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; +#endif + } } @@ -361,7 +371,13 @@ ivas_error ivas_corecoder_enc_reconfig( #endif if ( cpe_id * CPE_CHANNELS + n > 0 || ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->nSCE > 0 ) ) { - reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); + reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, +#ifdef IND_LIST_DYN + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); } else { @@ -421,7 +437,13 @@ ivas_error ivas_corecoder_enc_reconfig( #endif if ( cpe_id * CPE_CHANNELS + n > 0 || ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->nSCE > 0 ) ) { - reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); + reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, +#ifdef IND_LIST_DYN + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); } else { @@ -526,8 +548,16 @@ ivas_error ivas_corecoder_enc_reconfig( } } +#ifdef IND_LIST_DYN + /* VM: Check, if this is correct */ + st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ind_list = ind_list_metadata + st_ivas->nSCE * MAX_BITS_METADATA; +#else st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ind_list = ind_list_metadata + st_ivas->nSCE * MAX_NUM_INDICES; +#endif reset_indices_enc( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData, MAX_BITS_METADATA ); +#ifdef IND_LIST_DYN + st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->max_num_indices = MAX_BITS_METADATA; +#endif for ( cpe_id = 0; cpe_id < st_ivas->nCPE - 1; cpe_id++ ) { diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 9aec652f05..25b74bba1c 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -831,7 +831,11 @@ ivas_error create_cpe_enc( st->mct_chan_mode = MCT_CHAN_MODE_LFE; } - if ( ( error = init_encoder( st, n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0 ) ) != IVAS_ERR_OK ) + if ( ( error = init_encoder( st, +#ifdef IND_LIST_DYN + hEncoderConfig, +#endif + n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0 ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 26809f733d..a2c38b109f 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -419,6 +419,9 @@ ivas_error ivas_init_encoder( /* MetaData for DFT stereo */ st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[0]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); +#ifdef IND_LIST_DYN + st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; +#endif } else if ( ivas_format == ISM_FORMAT ) { @@ -453,6 +456,9 @@ ivas_error ivas_init_encoder( st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); +#ifdef IND_LIST_DYN + st_ivas->hSCE[sce_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; +#endif } if ( st_ivas->ism_mode == ISM_MODE_PARAM ) @@ -520,6 +526,9 @@ ivas_error ivas_init_encoder( st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); +#ifdef IND_LIST_DYN + st_ivas->hSCE[sce_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; +#endif if ( st_ivas->sba_mode == SBA_MODE_SPAR && st_ivas->hEncoderConfig->Opt_DTX_ON ) { @@ -560,6 +569,9 @@ ivas_error ivas_init_encoder( { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); +#ifdef IND_LIST_DYN + st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; +#endif } } @@ -611,6 +623,9 @@ ivas_error ivas_init_encoder( { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); +#ifdef IND_LIST_DYN + st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; +#endif } } @@ -660,6 +675,9 @@ ivas_error ivas_init_encoder( { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); +#ifdef IND_LIST_DYN + st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; +#endif } } @@ -716,6 +734,9 @@ ivas_error ivas_init_encoder( st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); +#ifdef IND_LIST_DYN + st_ivas->hSCE[sce_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; +#endif } for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) @@ -747,6 +768,9 @@ ivas_error ivas_init_encoder( { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); +#ifdef IND_LIST_DYN + st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; +#endif } } } diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 970a54b665..d735777baa 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -714,6 +714,9 @@ ivas_error ivas_ism_metadata_enc( if ( hSCE[0]->hCoreCoder[0]->core_brate > SID_2k40 ) { reset_indices_enc( hSCE[ch]->hMetaData, MAX_BITS_METADATA ); +#ifdef IND_LIST_DYN + hSCE[ch]->hMetaData->max_num_indices = MAX_BITS_METADATA; +#endif } } diff --git a/lib_enc/ivas_sba_enc.c b/lib_enc/ivas_sba_enc.c index c6d6abd3b8..a04d1d4cc2 100644 --- a/lib_enc/ivas_sba_enc.c +++ b/lib_enc/ivas_sba_enc.c @@ -252,6 +252,9 @@ ivas_error ivas_sba_enc_reinit( st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata + sce_id * MAX_BITS_METADATA; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); +#ifdef IND_LIST_DYN + st_ivas->hSCE[sce_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; +#endif if ( st_ivas->sba_mode == SBA_MODE_SPAR && st_ivas->hEncoderConfig->Opt_DTX_ON ) { @@ -287,6 +290,9 @@ ivas_error ivas_sba_enc_reinit( { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata + sce_id * MAX_BITS_METADATA; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); +#ifdef IND_LIST_DYN + st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; +#endif } } diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 0134efc0f0..d19c3f5460 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -329,7 +329,11 @@ ivas_error create_sce_enc( st->total_brate = hSCE->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; - if ( ( error = init_encoder( st, 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0 ) ) != IVAS_ERR_OK ) + if ( ( error = init_encoder( st, +#ifdef IND_LIST_DYN + st_ivas->hEncoderConfig, +#endif + 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0 ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 5e9dd6400c..cb53616e43 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -189,7 +189,11 @@ ivas_error ivas_spar_enc_open( hSpar->hCoreCoderVAD->total_brate = hEncoderConfig->ivas_total_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ hSpar->hCoreCoderVAD->mct_chan_mode = MCT_CHAN_MODE_IGNORE; - if ( ( error = init_encoder( hSpar->hCoreCoderVAD, 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1 ) ) != IVAS_ERR_OK ) + if ( ( error = init_encoder( hSpar->hCoreCoderVAD, +#ifdef IND_LIST_DYN + hEncoderConfig, +#endif + 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1 ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 20a3e4322b..3602c2be68 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -880,6 +880,9 @@ ivas_error ivas_spar_md_enc_process( if ( strat != NO_STRAT ) { reset_indices_enc( &hMetaData_tmp, MAX_BITS_METADATA ); +#ifdef IND_LIST_DYN + hMetaData_tmp.max_num_indices = MAX_BITS_METADATA; +#endif ivas_write_spar_md_bitstream( hMdEnc, num_bands, bands_bw, &hMetaData_tmp, hEncoderConfig->ivas_total_brate, strat, qsi, planarCP ); diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index 0da30af73d..7b51714831 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -79,7 +79,7 @@ typedef struct bitstream_enc_data_structure Indice *ind_list; /* list of indices */ int16_t next_ind; /* pointer to the next empty slot in the list of indices */ int16_t last_ind; /* last written indice */ - + int16_t max_num_indices; /* maximum number of indices in the list */ } BSTR_ENC_DATA, *BSTR_ENC_HANDLE; /*----------------------------------------------------------------------------------* -- GitLab From beda0f087504b85206efd3bfe64b90a0cbfbeafc Mon Sep 17 00:00:00 2001 From: malenov Date: Tue, 14 Feb 2023 13:36:01 +0100 Subject: [PATCH 04/43] cleanup within IND_LIST_DYN --- lib_com/ivas_prot.h | 4 +- lib_enc/ivas_corecoder_enc_reconfig.c | 18 +------ lib_enc/ivas_init_enc.c | 72 ++------------------------- lib_enc/lib_enc.c | 36 +------------- 4 files changed, 9 insertions(+), 121 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 142f6a0059..3a30c59b50 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -285,9 +285,7 @@ void ivas_initialize_handles_enc( ivas_error ivas_init_encoder( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ -#ifdef IND_LIST_DYN - //Indice *ind_list[], /* i : list of indices */ -#else +#ifndef IND_LIST_DYN Indice ind_list[][MAX_NUM_INDICES], /* i : indices list */ #endif Indice ind_list_metadata[][MAX_BITS_METADATA] /* i : indices list metadata */ diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index 9189ce3876..293462d501 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -287,14 +287,7 @@ ivas_error ivas_corecoder_enc_reconfig( } /* allocate buffer of indices */ -#ifdef IND_LIST_DYN - //if ( ( ind_list = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) - //{ - // return IVAS_ERR_FAILED_ALLOC; - //} - - //st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list; -#else +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list + sce_id * MAX_NUM_INDICES; #endif @@ -359,14 +352,7 @@ ivas_error ivas_corecoder_enc_reconfig( copy_encoder_config( st_ivas, st_ivas->hCPE[cpe_id]->hCoreCoder[n], 0 ); st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ -#ifdef IND_LIST_DYN - //if ( ( ind_list = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) - //{ - // return IVAS_ERR_FAILED_ALLOC; - //} - - //st_ivas->hSCE[cpe_id]->hCoreCoder[0]->hBstr->ind_list = ind_list; -#else +#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list + ( cpe_id * CPE_CHANNELS + n + st_ivas->nSCE ) * MAX_NUM_INDICES; #endif if ( cpe_id * CPE_CHANNELS + n > 0 || ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->nSCE > 0 ) ) diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index a2c38b109f..692c410f32 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -311,9 +311,7 @@ void ivas_initialize_handles_enc( ivas_error ivas_init_encoder( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ -#ifdef IND_LIST_DYN - //Indice *ind_list[], /* i : list of indices */ -#else +#ifndef IND_LIST_DYN Indice ind_list[][MAX_NUM_INDICES], /* o : bitstream indices */ #endif Indice ind_list_metadata[][MAX_BITS_METADATA] /* o : bitstream indices metadata */ @@ -367,13 +365,6 @@ ivas_error ivas_init_encoder( return error; } -#ifdef IND_LIST_DYN - ///* allocate buffer of indices */ - //if ( ( ind_list[sce_id] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) - //{ - // return IVAS_ERR_FAILED_ALLOC; - //} -#endif #ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); @@ -403,13 +394,6 @@ ivas_error ivas_init_encoder( /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { -#ifdef IND_LIST_DYN - //if ( ( ind_list[n] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) - //{ - // return IVAS_ERR_FAILED_ALLOC; - //} -#endif - #ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); @@ -441,14 +425,6 @@ ivas_error ivas_init_encoder( return error; } -#ifdef IND_LIST_DYN - /* allocate buffer of indices */ - //if ( ( ind_list[sce_id] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) - //{ - // return IVAS_ERR_FAILED_ALLOC; - //} -#endif - #ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); @@ -511,14 +487,6 @@ ivas_error ivas_init_encoder( return error; } -#ifdef IND_LIST_DYN - /* allocate buffer of indices */ - //if ( ( ind_list[sce_id] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) - //{ - // return IVAS_ERR_FAILED_ALLOC; - //} -#endif - #ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); @@ -546,13 +514,6 @@ ivas_error ivas_init_encoder( /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { -#ifdef IND_LIST_DYN - //if ( ( ind_list[cpe_id * CPE_CHANNELS + n] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) - //{ - // return IVAS_ERR_FAILED_ALLOC; - //} -#endif - #ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); @@ -604,12 +565,6 @@ ivas_error ivas_init_encoder( /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { -#ifdef IND_LIST_DYN - //if ( ( ind_list[cpe_id * CPE_CHANNELS + n] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) - //{ - // return IVAS_ERR_FAILED_ALLOC; - //} -#endif /* we need the correct bitstream also for the LFE channel since it might become a proper coded channel when switching to ParamMC and ind_list is only visible here, can't be done later */ #ifndef IND_LIST_DYN @@ -658,12 +613,6 @@ ivas_error ivas_init_encoder( /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { -#ifdef IND_LIST_DYN - //if ( ( ind_list[cpe_id * CPE_CHANNELS + n] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) - //{ - // return IVAS_ERR_FAILED_ALLOC; - //} -#endif #ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); @@ -719,15 +668,8 @@ ivas_error ivas_init_encoder( return error; } - /* allocate buffer of indices */ -#ifdef IND_LIST_DYN - //if ( ( ind_list[sce_id] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) - //{ - // return IVAS_ERR_FAILED_ALLOC; - //} -#endif - #ifndef IND_LIST_DYN + /* allocate buffer of indices */ st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); #endif @@ -748,20 +690,14 @@ ivas_error ivas_init_encoder( return error; } +#ifndef IND_LIST_DYN /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { -#ifdef IND_LIST_DYN - //if ( ( ind_list[cpe_id * CPE_CHANNELS + n + st_ivas->nSCE] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) - //{ - // return IVAS_ERR_FAILED_ALLOC; - //} -#endif -#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n + st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); -#endif } +#endif /* Metadata only initialized for the last CPE index*/ if ( cpe_id == st_ivas->nCPE - 1 ) diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index c9c664f7c7..686e6393ac 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -48,9 +48,7 @@ struct IVAS_ENC { Encoder_Struct *st_ivas; -#ifdef IND_LIST_DYN - //Indice *ind_list[MAX_NUM_DATA]; /* list of indices */ -#else +#ifndef IND_LIST_DYN Indice ind_list[MAX_NUM_DATA][MAX_NUM_INDICES]; /* list of indices */ #endif Indice ind_list_metadata[MAX_NUM_METADATA][MAX_BITS_METADATA]; /* list of indices for metadata */ @@ -138,19 +136,7 @@ ivas_error IVAS_ENC_Open( * Initialize indices *-----------------------------------------------------------------*/ -#ifdef IND_LIST_DYN - /* allocate ind_list[0] - for the first transport channel */ - //if ( ( ( *phIvasEnc )->ind_list[0] = (INDICE_HANDLE) malloc( MAX_NUM_INDICES * sizeof( Indice ) ) ) == NULL ) - //{ - // return IVAS_ERR_FAILED_ALLOC; - //} - - //for ( i = 0; i < MAX_NUM_DATA; ++i ) - //{ - // ( *phIvasEnc )->ind_list[i] = NULL; - //} -#else - +#ifndef IND_LIST_DYN for ( i = 0; i < MAX_NUM_DATA; ++i ) { for ( j = 0; j < MAX_NUM_INDICES; ++j ) @@ -216,10 +202,6 @@ void IVAS_ENC_Close( IVAS_ENC_HANDLE *phIvasEnc /* i/o: pointer to IVAS encoder handle */ ) { -#ifdef IND_LIST_DYN - //int16_t i; -#endif - /* Free all memory */ if ( phIvasEnc == NULL || *phIvasEnc == NULL ) { @@ -242,20 +224,6 @@ void IVAS_ENC_Close( ( *phIvasEnc )->st_ivas = NULL; -#ifdef IND_LIST_DYN - //for ( i = 0; i < MAX_NUM_DATA; ++i ) - //{ - // if ( ( *phIvasEnc )->ind_list[i] != NULL ) - // { - // free( ( *phIvasEnc )->ind_list[i] ); - // } - // else - // { - // break; - // } - //} -#endif - #ifdef BITSTREAM_INDICES_MEMORY #define WMC_TOOL_SKIP free( *phIvasEnc ); -- GitLab From 2aaf10bc06a54095c8c778093beb7f8f37761b76 Mon Sep 17 00:00:00 2001 From: malenov Date: Thu, 16 Feb 2023 08:52:29 +0100 Subject: [PATCH 05/43] auxiliary function for realllocation of ind_list --- lib_com/bitstream.c | 158 ++++++++++++++++++++++++++ lib_com/ivas_cnst.h | 3 + lib_com/ivas_prot.h | 3 + lib_com/prot.h | 11 ++ lib_enc/init_enc.c | 83 +------------- lib_enc/ivas_core_enc.c | 14 ++- lib_enc/ivas_corecoder_enc_reconfig.c | 124 ++++++++++++++++++-- lib_enc/ivas_stereo_mdct_core_enc.c | 9 ++ 8 files changed, 316 insertions(+), 89 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index e92a86b78e..eaca61a681 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -221,6 +221,164 @@ Word16 rate2EVSmode( return rate2AMRWB_IOmode( brate ); } +#ifdef IND_LIST_DYN +/*-------------------------------------------------------------------* + * ind_list_realloc() + * + * Re-allocate list of indices if the maximum number of allowed indices has changed + *-------------------------------------------------------------------*/ + +ivas_error ind_list_realloc( + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t total_brate /* i : total bitrate */ +) +{ + int16_t i, max_num_indices; + INDICE_HANDLE new_ind_list; + + /* get the maximum allowed number of indices in the list */ + max_num_indices = set_max_num_indices( ivas_format, total_brate ); + + /* check, if the maximum number of allowed indices has changed */ + if ( max_num_indices != hBstr->max_num_indices ) + { + /* allocate new buffer of indices */ + if ( ( new_ind_list = (INDICE_HANDLE) malloc( max_num_indices * sizeof( Indice ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); + } + + /* move indices from the old list to the new list */ + i = 0; + while ( hBstr->ind_list[i].nb_bits > 0 ) + { + new_ind_list[i].id = hBstr->ind_list[i].id; + new_ind_list[i].value = hBstr->ind_list[i].value; + new_ind_list[i].nb_bits = hBstr->ind_list[i].nb_bits; + i++; + } + + /* reset nb_bits of all other indices to -1 */ + for ( ; i < max_num_indices; i++ ) + { + new_ind_list[i].nb_bits = -1; + } + + /* free the old list */ + free( hBstr->ind_list ); + + /* set pointer to the new list */ + hBstr->ind_list = new_ind_list; + + /* set the new maximum for the allowed number of indices */ + hBstr->max_num_indices = max_num_indices; + } + + return IVAS_ERR_OK; +} + +#ifdef IND_LIST_DYN +/*-----------------------------------------------------------------------* + * set_max_num_indices() + * + * Set the maximum allowed number of indices in the list + *-----------------------------------------------------------------------*/ + +int16_t set_max_num_indices( /* o : maximum number of indices */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t total_brate /* i : total bitrate */ +) +{ + /* set the maximum required number of indices */ + if ( ivas_format == MONO_FORMAT ) + { + if ( total_brate < IVAS_24k4 ) + { + return 450; + } + else + { + return 450; + } + } + else if ( ivas_format == STEREO_FORMAT ) + { + if ( total_brate < IVAS_24k4 ) + { + return 250; + } + else if ( total_brate < IVAS_128k ) + { + return 450; + } + else + { + return 550; + } + } + else if ( ivas_format == ISM_FORMAT ) + { + if ( total_brate < IVAS_24k4 ) + { + return 250; + } + else if ( total_brate < IVAS_128k ) + { + return 450; + } + else + { + return 700; + } + } + else if ( ivas_format == SBA_FORMAT ) + { + if ( total_brate < IVAS_24k4 ) + { + return 250; + } + else if ( total_brate < IVAS_128k ) + { + return 450; + } + else + { + return 700; + } + } + else if ( ivas_format == MASA_FORMAT ) + { + if ( total_brate < IVAS_24k4 ) + { + return 250; + } + else if ( total_brate < IVAS_160k ) + { + return 450; + } + else + { + return 700; + } + } + else if ( ivas_format == MC_FORMAT ) + { + if ( total_brate < IVAS_24k4 ) + { + return 450; + } + else + { + return 1050; + } + } + + return 1050; +} +#endif +#endif + /*-------------------------------------------------------------------* * push_indice() * diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index e625095817..62848e5066 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -179,6 +179,9 @@ typedef enum #define MAX_BITS_METADATA 2640 /* max. bit-budget of metadata, one channel */ /* IVAS_fmToDo: to be confirmed for final value once mature */ #define MAX_NUM_METADATA max( 2, MAX_NUM_OBJECTS ) /* number of max. metadata (now only 2 for DirAC) */ +#ifdef IND_LIST_DYN +#define MAX_NUM_IND_TEMP_LIST 10 /* maximum number of indices in the temporary list */ +#endif #define IVAS_ENC_DELAY_NS ACELP_LOOK_NS #define IVAS_DEC_DELAY_NS 3250000L /* 3.25 ms: IVAS decoder delay (without renderer delay) */ diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 3a30c59b50..29aa795a56 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -1979,6 +1979,9 @@ void InternalTCXDecoder( void stereo_mdct_core_enc( CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ +#ifdef IND_LIST_DYN + const int16_t ivas_format, /* i : IVAS format */ +#endif float new_samples[CPE_CHANNELS][L_INP], /* i : new samples */ float old_wsp[CPE_CHANNELS][L_WSP], /* i : 12.8kHz weighted speech (for LTP */ float pitch_buf[CPE_CHANNELS][NB_SUBFR16k] /* o : floating pitch for each subframe */ diff --git a/lib_com/prot.h b/lib_com/prot.h index cb7f02cabe..2740a305fd 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -516,6 +516,17 @@ void push_next_bits( ); #ifdef IND_LIST_DYN +int16_t set_max_num_indices( /* o : maximum number of indices */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t total_brate /* i : total bitrate */ +); + +ivas_error ind_list_realloc( + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t total_brate /* i : total bitrate */ +); + int16_t find_indice( /* o : index of the indice in the list, -1 if not found */ BSTR_ENC_HANDLE hBstr, /* i : encoder bitstream handle */ int16_t id, /* i : ID of the indice */ diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index 194c11907b..10be4e86f4 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -116,85 +116,8 @@ ivas_error init_encoder( } #ifdef IND_LIST_DYN - /* set the maximum required number of indices */ - if ( hEncoderConfig->ivas_format == MONO_FORMAT ) - { - if ( st->total_brate < IVAS_24k4 ) - { - st->hBstr->max_num_indices = 450; - } - else - { - st->hBstr->max_num_indices = 450; - } - } - else if ( hEncoderConfig->ivas_format == STEREO_FORMAT ) - { - if ( st->total_brate < IVAS_24k4 ) - { - st->hBstr->max_num_indices = 240; - } - else - { - st->hBstr->max_num_indices = 350; - } - } - else if ( hEncoderConfig->ivas_format == ISM_FORMAT ) - { - if ( st->total_brate < IVAS_24k4 ) - { - st->hBstr->max_num_indices = 150; - } - else - { - st->hBstr->max_num_indices = 350; - } - } - else if ( hEncoderConfig->ivas_format == SBA_FORMAT ) - { - if ( st->total_brate < IVAS_24k4 ) - { - st->hBstr->max_num_indices = 250; - } - else if ( st->total_brate < IVAS_128k ) - { - st->hBstr->max_num_indices = 450; - } - else - { - st->hBstr->max_num_indices = 700; - } - } - else if ( hEncoderConfig->ivas_format == MASA_FORMAT ) - { - if ( st->total_brate < IVAS_24k4 ) - { - st->hBstr->max_num_indices = 250; - } - else if ( st->total_brate < IVAS_160k ) - { - st->hBstr->max_num_indices = 450; - } - else - { - st->hBstr->max_num_indices = 700; - } - } - else if ( hEncoderConfig->ivas_format == MC_FORMAT ) - { - if ( st->total_brate < IVAS_24k4 ) - { - st->hBstr->max_num_indices = 550; - } - else - { - st->hBstr->max_num_indices = 1050; - } - } - else - { - st->hBstr->max_num_indices = 1050; - } + /* set the maximum allowed number of indices in the list */ + st->hBstr->max_num_indices = set_max_num_indices( hEncoderConfig->ivas_format, st->total_brate ); /* allocate buffer of indices */ if ( ( st->hBstr->ind_list = (INDICE_HANDLE) malloc( st->hBstr->max_num_indices * sizeof( Indice ) ) ) == NULL ) @@ -928,6 +851,8 @@ ivas_error init_encoder( } + + /*-----------------------------------------------------------------------* * LPDmem_enc_init() * diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index e53033ab98..d1bc85d759 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -195,6 +195,14 @@ ivas_error ivas_core_enc( { st = sts[n]; +#ifdef IND_LIST_DYN + /*---------------------------------------------------------------------* + * Re-allocate list of indices, if needed + *---------------------------------------------------------------------*/ + + ind_list_realloc( st->hBstr, ivas_format, st->total_brate ); +#endif + /*---------------------------------------------------------------------* * Write signaling info into the bitstream *---------------------------------------------------------------------*/ @@ -263,7 +271,11 @@ ivas_error ivas_core_enc( } else { - stereo_mdct_core_enc( hCPE, old_inp_16k, old_wsp, pitch_buf ); + stereo_mdct_core_enc( hCPE, +#ifdef IND_LIST_DYN + ivas_format, +#endif + old_inp_16k, old_wsp, pitch_buf ); } } else if ( sts[0]->core_brate == SID_2k40 && sts[1]->core_brate == SID_2k40 ) diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index 293462d501..758dd73575 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -42,7 +42,6 @@ #endif #include "wmc_auto.h" - /*-------------------------------------------------------------------* * ivas_corecoder_enc_reconfig() * @@ -69,7 +68,8 @@ ivas_error ivas_corecoder_enc_reconfig( Indice *ind_list_metadata; #ifdef IND_LIST_DYN int16_t i, nb_bits; - Indice temp_ind_list[10]; + //int16_t max_num_indices; + Indice temp_ind_list[MAX_NUM_IND_TEMP_LIST]; #endif int16_t nb_bits_tot, next_ind, last_ind; ENCODER_CONFIG_HANDLE hEncoderConfig; @@ -173,7 +173,7 @@ ivas_error ivas_corecoder_enc_reconfig( #ifdef IND_LIST_DYN i = 0; nb_bits = 0; - while ( nb_bits < nb_bits_tot && i < 10 ) + while ( nb_bits < nb_bits_tot && i < MAX_NUM_IND_TEMP_LIST ) { if ( hBstr->ind_list[i].nb_bits > 0 ) { @@ -186,6 +186,12 @@ ivas_error ivas_corecoder_enc_reconfig( i++; } + for ( ; i < MAX_NUM_IND_TEMP_LIST; i++ ) + { + /* reset nb_bits of all other indices to -1 */ + temp_ind_list[i].nb_bits = -1; + } + #ifdef DEBUGGING assert( (nb_bits == nb_bits_tot) && "Error saving bitstream information during core-coder reconfiguration!\n" ); #endif @@ -271,6 +277,30 @@ ivas_error ivas_corecoder_enc_reconfig( copy_encoder_config( st_ivas, st_ivas->hSCE[sce_id]->hCoreCoder[0], 0 ); st_ivas->hSCE[sce_id]->element_brate = brate_SCE; st_ivas->hSCE[sce_id]->hCoreCoder[0]->total_brate = st_ivas->hSCE[sce_id]->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ +#ifdef IND_LIST_DYN + ///* set the maximum allowed number of indices in the list */ + //max_num_indices = set_max_num_indices( hEncoderConfig->ivas_format, st_ivas->hSCE[sce_id]->hCoreCoder[0]->total_brate ); + //if ( max_num_indices != st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->max_num_indices ) + //{ + // /* Maximum number of indices has increased -> reallocate buffer of indices */ + // free( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list ); + // st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->max_num_indices = max_num_indices; + // if ( ( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = (INDICE_HANDLE) malloc( max_num_indices * sizeof( Indice ) ) ) == NULL ) + // { + // return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); + // } + + // /* re-fill the buffer of indices with already written indices */ + // i = 0; + // while ( sce_id == 0 && temp_ind_list[i].nb_bits > 0 && i < MAX_NUM_IND_TEMP_LIST ) + // { + // st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].id = temp_ind_list[i].id; + // st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].value = temp_ind_list[i].value; + // st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; + // i++; + // } + //} +#endif } for ( sce_id = nSCE_existing; sce_id < st_ivas->nSCE; sce_id++ ) @@ -286,8 +316,8 @@ ivas_error ivas_corecoder_enc_reconfig( mvr2r( input_buff[sce_id], st_ivas->hSCE[sce_id]->hCoreCoder[0]->input_buff, len_inp_memory ); } - /* allocate buffer of indices */ #ifndef IND_LIST_DYN + /* allocate buffer of indices */ st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list + sce_id * MAX_NUM_INDICES; #endif @@ -308,9 +338,10 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->nb_bits_tot = nb_bits_tot; st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->next_ind = next_ind; #ifdef IND_LIST_DYN + /* re-fill the buffer of indices with already written indices */ i = 0; nb_bits = 0; - while ( nb_bits < nb_bits_tot && i < 10 ) + while ( nb_bits < nb_bits_tot && i < MAX_NUM_IND_TEMP_LIST ) { if ( temp_ind_list[i].nb_bits > 0 ) { @@ -352,6 +383,31 @@ ivas_error ivas_corecoder_enc_reconfig( copy_encoder_config( st_ivas, st_ivas->hCPE[cpe_id]->hCoreCoder[n], 0 ); st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ +#ifdef IND_LIST_DYN + ///* set the maximum allowed number of indices in the list */ + //max_num_indices = set_max_num_indices( hEncoderConfig->ivas_format, st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate ); + //if ( max_num_indices != st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->max_num_indices ) + //{ + // /* Maximum number of indices has increased -> reallocate buffer of indices */ + // free( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list ); + // st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->max_num_indices = max_num_indices; + // if ( ( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = (INDICE_HANDLE) malloc( max_num_indices * sizeof( Indice ) ) ) == NULL ) + // { + // return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); + // } + + // /* re-fill the buffer of indices with already written indices */ + // i = 0; + // while ( n == 0 && temp_ind_list[i].nb_bits > 0 && i < MAX_NUM_IND_TEMP_LIST ) + // { + // st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].id = temp_ind_list[i].id; + // st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].value = temp_ind_list[i].value; + // st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; + // i++; + // } + //} +#endif + #ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list + ( cpe_id * CPE_CHANNELS + n + st_ivas->nSCE ) * MAX_NUM_INDICES; #endif @@ -373,7 +429,7 @@ ivas_error ivas_corecoder_enc_reconfig( #ifdef IND_LIST_DYN i = 0; nb_bits = 0; - while ( nb_bits < nb_bits_tot && i < 10 ) + while ( nb_bits < nb_bits_tot && i < MAX_NUM_IND_TEMP_LIST ) { if ( temp_ind_list[i].nb_bits > 0 ) { @@ -415,12 +471,12 @@ ivas_error ivas_corecoder_enc_reconfig( } } - /* prepare bitstream buffers */ for ( n = 0; n < CPE_CHANNELS; n++ ) { #ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list + ( cpe_id * CPE_CHANNELS + n + st_ivas->nSCE ) * MAX_NUM_INDICES; #endif + /* only reset indices if it is not the first index list, this already contains the IVAS format bits */ if ( cpe_id * CPE_CHANNELS + n > 0 || ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->nSCE > 0 ) ) { reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, @@ -439,7 +495,7 @@ ivas_error ivas_corecoder_enc_reconfig( #ifdef IND_LIST_DYN i = 0; nb_bits = 0; - while ( nb_bits < nb_bits_tot && i < 10 ) + while ( nb_bits < nb_bits_tot && i < MAX_NUM_IND_TEMP_LIST ) { if ( temp_ind_list[i].nb_bits > 0 ) { @@ -491,6 +547,31 @@ ivas_error ivas_corecoder_enc_reconfig( for ( n = 0; n < CPE_CHANNELS; n++ ) { st_ivas->hCPE[0]->hCoreCoder[n]->total_brate = st_ivas->hCPE[0]->element_brate; +#ifdef IND_LIST_DYN + ///* set the maximum allowed number of indices in the list */ + //max_num_indices = set_max_num_indices( hEncoderConfig->ivas_format, st_ivas->hCPE[0]->hCoreCoder[n]->total_brate ); + //if ( max_num_indices != st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->max_num_indices ) + //{ + // /* Maximum number of indices has increased -> reallocate buffer of indices */ + // free( st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list ); + // st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->max_num_indices = max_num_indices; + // if ( ( st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list = (INDICE_HANDLE) malloc( max_num_indices * sizeof( Indice ) ) ) == NULL ) + // { + // return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); + // } + + // /* re-fill the buffer of indices with already written indices */ + // i = 0; + // while ( n == 0 && temp_ind_list[i].nb_bits > 0 && i < MAX_NUM_IND_TEMP_LIST ) + // { + // st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list[i].id = temp_ind_list[i].id; + // st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list[i].value = temp_ind_list[i].value; + // st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; + // i++; + // } + + //} +#endif st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal = (int16_t) ( st_ivas->hCPE[0]->element_brate / FRAMES_PER_SEC ); st_ivas->hCPE[0]->hCoreCoder[n]->igf = getIgfPresent( st_ivas->hCPE[0]->hCoreCoder[n]->element_mode, @@ -535,7 +616,7 @@ ivas_error ivas_corecoder_enc_reconfig( } #ifdef IND_LIST_DYN - /* VM: Check, if this is correct */ + /* TODO VoiceAge: check, if the last multiplication is really * MAX_BITS_METADATA and not MAX_NUM_INDICES */ st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ind_list = ind_list_metadata + st_ivas->nSCE * MAX_BITS_METADATA; #else st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ind_list = ind_list_metadata + st_ivas->nSCE * MAX_NUM_INDICES; @@ -568,6 +649,31 @@ ivas_error ivas_corecoder_enc_reconfig( { st_ivas->hCPE[0]->hCoreCoder[n]->total_brate = st_ivas->hCPE[0]->element_brate; +#ifdef IND_LIST_DYN + ///* set the maximum allowed number of indices in the list */ + //max_num_indices = set_max_num_indices( hEncoderConfig->ivas_format, st_ivas->hCPE[0]->hCoreCoder[n]->total_brate ); + //if ( max_num_indices != st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->max_num_indices ) + //{ + // /* Maximum number of indices has increased -> reallocate buffer of indices */ + // free( st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list ); + // st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->max_num_indices = max_num_indices; + // if ( ( st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list = (INDICE_HANDLE) malloc( max_num_indices * sizeof( Indice ) ) ) == NULL ) + // { + // return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); + // } + + // /* re-fill the buffer of indices with already written indices */ + // i = 0; + // while ( n == 0 && temp_ind_list[i].nb_bits > 0 && i < MAX_NUM_IND_TEMP_LIST ) + // { + // st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list[i].id = temp_ind_list[i].id; + // st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list[i].value = temp_ind_list[i].value; + // st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; + // i++; + // } + //} +#endif + st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal = (int16_t) ( st_ivas->hCPE[0]->element_brate / FRAMES_PER_SEC ); st_ivas->hCPE[0]->hCoreCoder[n]->igf = getIgfPresent( st_ivas->hCPE[0]->hCoreCoder[n]->element_mode, st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal * FRAMES_PER_SEC, diff --git a/lib_enc/ivas_stereo_mdct_core_enc.c b/lib_enc/ivas_stereo_mdct_core_enc.c index 9500da4fb9..79659a8f84 100644 --- a/lib_enc/ivas_stereo_mdct_core_enc.c +++ b/lib_enc/ivas_stereo_mdct_core_enc.c @@ -117,6 +117,9 @@ static void sync_tcx_mode( void stereo_mdct_core_enc( CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ +#ifdef IND_LIST_DYN + const int16_t ivas_format, /* i : IVAS format */ +#endif float new_samples[CPE_CHANNELS][L_INP], /* i : new samples */ float old_wsp[CPE_CHANNELS][L_WSP], /* i : 12.8kHz weighted speech (for LTP */ float pitch_buf[CPE_CHANNELS][NB_SUBFR16k] /* o : floating pitch for each subframe */ @@ -179,6 +182,12 @@ void stereo_mdct_core_enc( { st = sts[ch]; SetTCXModeInfo( st, st->hTranDet, &st->hTcxCfg->tcx_curr_overlap_mode ); + +#ifdef IND_LIST_DYN + /* Re-allocate list of indices, if needed (note that st->total_brate is modified later in this function) */ + ind_list_realloc( st->hBstr, ivas_format, st->total_brate ); +#endif + } /* adaptively sync tcx modes*/ -- GitLab From 388c180cebd67ad86e386116bfa89103c3e20aa7 Mon Sep 17 00:00:00 2001 From: malenov Date: Fri, 17 Feb 2023 13:32:04 +0100 Subject: [PATCH 06/43] Allocate ind_list_metadata[] dynamically --- apps/encoder.c | 2 + lib_com/bitstream.c | 193 ++++++++++++++++++++++++-- lib_com/ivas_cnst.h | 2 + lib_com/ivas_prot.h | 8 +- lib_com/options.h | 4 +- lib_com/prot.h | 13 +- lib_enc/init_enc.c | 2 +- lib_enc/ivas_corecoder_enc_reconfig.c | 152 ++++++-------------- lib_enc/ivas_cpe_enc.c | 19 +++ lib_enc/ivas_init_enc.c | 56 ++++---- lib_enc/ivas_ism_metadata_enc.c | 5 +- lib_enc/ivas_sba_enc.c | 8 +- lib_enc/ivas_sce_enc.c | 19 +++ lib_enc/ivas_spar_md_enc.c | 4 +- lib_enc/lib_enc.c | 15 +- 15 files changed, 332 insertions(+), 170 deletions(-) diff --git a/apps/encoder.c b/apps/encoder.c index dec934b511..865b0e67dd 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -50,6 +50,7 @@ #ifdef DEBUG_IND_LIST extern int16_t max_total_num_ind; +extern int16_t max_total_num_ind_metadata; extern int32_t max_at_brate; #endif @@ -745,6 +746,7 @@ int main( #ifdef DEBUG_IND_LIST printf( "\nMaximum total number of indices: %d at bitrate: %d\n", max_total_num_ind, max_at_brate ); + printf( "\nMaximum total number of indices for metadata: %d\n", max_total_num_ind_metadata ); #endif diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index eaca61a681..3aa0f21bac 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -64,6 +64,7 @@ FILE *FEC_pattern = NULL; /* FEC pattern file (for simulation of FEC) */ #ifdef DEBUG_IND_LIST int16_t max_total_num_ind = 0; +int16_t max_total_num_ind_metadata = 0; int32_t max_at_brate; #endif @@ -238,7 +239,7 @@ ivas_error ind_list_realloc( INDICE_HANDLE new_ind_list; /* get the maximum allowed number of indices in the list */ - max_num_indices = set_max_num_indices( ivas_format, total_brate ); + max_num_indices = get_max_num_indices( ivas_format, total_brate ); /* check, if the maximum number of allowed indices has changed */ if ( max_num_indices != hBstr->max_num_indices ) @@ -278,14 +279,71 @@ ivas_error ind_list_realloc( return IVAS_ERR_OK; } -#ifdef IND_LIST_DYN +/*-------------------------------------------------------------------* + * ind_list_metadata_realloc() + * + * Re-allocate list of metadata indices if the IVAS total bitrate has changed + *-------------------------------------------------------------------*/ + +ivas_error ind_list_metadata_realloc( + BSTR_ENC_HANDLE hMetaData, /* i/o: encoder bitstream handle */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ +) +{ + int16_t i, max_num_indices_metadata; + INDICE_HANDLE new_ind_list_metadata; + + if ( hMetaData != NULL && hMetaData->ind_list != NULL ) + { + /* get the maximum allowed number of indices in the list */ + max_num_indices_metadata = get_max_num_indices_metadata( ivas_format, ivas_total_brate ); + + /* check, if the maximum number of allowed indices has changed */ + if ( max_num_indices_metadata != hMetaData->max_num_indices ) + { + /* allocate new buffer of metadata indices */ + if ( ( new_ind_list_metadata = (INDICE_HANDLE) malloc( max_num_indices_metadata * sizeof( Indice ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of metadata indices!\n" ) ); + } + + /* move indices from the old list to the new list */ + i = 0; + while ( hMetaData->ind_list[i].nb_bits > 0 ) + { + new_ind_list_metadata[i].id = hMetaData->ind_list[i].id; + new_ind_list_metadata[i].value = hMetaData->ind_list[i].value; + new_ind_list_metadata[i].nb_bits = hMetaData->ind_list[i].nb_bits; + i++; + } + + /* reset nb_bits of all other indices to -1 */ + for ( ; i < max_num_indices_metadata; i++ ) + { + new_ind_list_metadata[i].nb_bits = -1; + } + + /* free the old list */ + free( hMetaData->ind_list ); + + /* set pointer to the new list */ + hMetaData->ind_list = new_ind_list_metadata; + + /* set the new maximum for the allowed number of indices */ + hMetaData->max_num_indices = max_num_indices_metadata; + } + } + + return IVAS_ERR_OK; +} /*-----------------------------------------------------------------------* - * set_max_num_indices() + * get_max_num_indices() * * Set the maximum allowed number of indices in the list *-----------------------------------------------------------------------*/ -int16_t set_max_num_indices( /* o : maximum number of indices */ +int16_t get_max_num_indices( /* o : maximum number of indices */ const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int32_t total_brate /* i : total bitrate */ ) @@ -376,6 +434,88 @@ int16_t set_max_num_indices( /* o : maximum number of indices */ return 1050; } + +#ifdef IND_LIST_DYN +/*-----------------------------------------------------------------------* + * set_max_set_max_num_indices_metadatanum_indices() + * + * Set the maximum allowed number of metadata indices in the list + *-----------------------------------------------------------------------*/ + +int16_t get_max_num_indices_metadata( /* o : maximum number of indices */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ +) +{ + /* set the maximum required number of metadata indices */ + if ( ivas_format == MONO_FORMAT ) + { + return 0; + } + else if ( ivas_format == STEREO_FORMAT ) + { + return 80; + } + else if ( ivas_format == ISM_FORMAT ) + { + return 60; + } + else if ( ivas_format == SBA_FORMAT ) + { + if ( ivas_total_brate < IVAS_24k4 ) + { + return 80; + } + else if ( ivas_total_brate < IVAS_48k ) + { + return 670; + } + else + { + return 1060; + } + } + else if ( ivas_format == MASA_FORMAT ) + { + if ( ivas_total_brate < IVAS_32k ) + { + return 80; + } + else if ( ivas_total_brate < IVAS_48k ) + { + return 110; + } + else if ( ivas_total_brate < IVAS_192k ) + { + return 330; + } + else if ( ivas_total_brate < IVAS_384k ) + { + return 1000; + } + else + { + return 1950; + } + } + else if ( ivas_format == MC_FORMAT ) + { + if ( ivas_total_brate == IVAS_32k || ivas_total_brate == IVAS_48k || ivas_total_brate == IVAS_64k ) + { + return 300; + } + if ( ivas_total_brate == IVAS_80k || ivas_total_brate == IVAS_96k ) + { + return 170; + } + else + { + return 90; + } + } + + return 1050; +} #endif #endif @@ -1119,6 +1259,10 @@ static ivas_error write_indices_element( uint16_t *pt_stream_backup; uint16_t *pt_stream_end; int16_t nb_bits_tot_metadata; +#ifdef IND_LIST_DYN + int16_t nb_ind_tot_metadata; +#endif + Indice *ind_list_metadata; int16_t n, n_channels; #ifdef ENABLE_BITRATE_VERIFICATION @@ -1129,6 +1273,9 @@ static ivas_error write_indices_element( error = IVAS_ERR_OK; ind_list_metadata = NULL; +#ifdef IND_LIST_DYN + nb_ind_tot_metadata = 0; +#endif if ( st_ivas->hEncoderConfig->ivas_format == MONO_FORMAT ) { @@ -1146,6 +1293,9 @@ static ivas_error write_indices_element( { nb_bits_tot_metadata = st_ivas->hSCE[element_id]->hMetaData->nb_bits_tot; ind_list_metadata = st_ivas->hSCE[element_id]->hMetaData->ind_list; +#ifdef IND_LIST_DYN + nb_ind_tot_metadata = st_ivas->hSCE[element_id]->hMetaData->nb_ind_tot; +#endif } } else if ( !is_SCE && st_ivas->hCPE[element_id] != NULL ) @@ -1156,6 +1306,9 @@ static ivas_error write_indices_element( { nb_bits_tot_metadata = st_ivas->hCPE[element_id]->hMetaData->nb_bits_tot; ind_list_metadata = st_ivas->hCPE[element_id]->hMetaData->ind_list; +#ifdef IND_LIST_DYN + nb_ind_tot_metadata = st_ivas->hCPE[element_id]->hMetaData->nb_ind_tot; +#endif } } #ifdef DEBUGGING @@ -1196,7 +1349,13 @@ static ivas_error write_indices_element( #ifdef ENABLE_BITRATE_VERIFICATION total_nb_bits = #endif - write_indices_to_stream( ind_list_metadata, &pt_stream_loc, -1, MAX_BITS_METADATA ); + write_indices_to_stream( ind_list_metadata, &pt_stream_loc, -1, +#ifdef IND_LIST_DYN + nb_ind_tot_metadata +#else + MAX_BITS_METADATA +#endif + ); #ifdef ENABLE_BITRATE_VERIFICATION if ( total_nb_bits != nb_bits_tot_metadata ) @@ -1245,9 +1404,17 @@ static ivas_error write_indices_element( { if ( st_ivas->hSCE[element_id]->hMetaData != NULL ) { - reset_indices_enc( st_ivas->hSCE[element_id]->hMetaData, MAX_BITS_METADATA ); +#ifdef DEBUG_IND_LIST + /* find the maximum number of metadata indices */ + if ( st_ivas->hSCE[element_id]->hMetaData->nb_ind_tot > max_total_num_ind_metadata ) + { + max_total_num_ind_metadata = st_ivas->hSCE[element_id]->hMetaData->nb_ind_tot; + } +#endif #ifdef IND_LIST_DYN - st_ivas->hSCE[element_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; + reset_indices_enc( st_ivas->hSCE[element_id]->hMetaData, st_ivas->hSCE[element_id]->hMetaData->max_num_indices ); +#else + reset_indices_enc( st_ivas->hSCE[element_id]->hMetaData, MAX_BITS_METADATA ); #endif } @@ -1272,9 +1439,17 @@ static ivas_error write_indices_element( { if ( st_ivas->hCPE[element_id]->hMetaData != NULL ) { - reset_indices_enc( st_ivas->hCPE[element_id]->hMetaData, MAX_BITS_METADATA ); +#ifdef DEBUG_IND_LIST + /* find the maximum number of metadata indices */ + if ( st_ivas->hCPE[element_id]->hMetaData->nb_ind_tot > max_total_num_ind_metadata ) + { + max_total_num_ind_metadata = st_ivas->hCPE[element_id]->hMetaData->nb_ind_tot; + } +#endif #ifdef IND_LIST_DYN - st_ivas->hCPE[element_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; + reset_indices_enc( st_ivas->hCPE[element_id]->hMetaData, st_ivas->hCPE[element_id]->hMetaData->max_num_indices ); +#else + reset_indices_enc( st_ivas->hCPE[element_id]->hMetaData, MAX_BITS_METADATA ); #endif } diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 62848e5066..9e81a2a32d 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -177,7 +177,9 @@ typedef enum #define MAX_CPE ( MAX_TRANSPORT_CHANNELS / CPE_CHANNELS ) /* max. number of CPEs */ #define MAX_BITS_METADATA 2640 /* max. bit-budget of metadata, one channel */ /* IVAS_fmToDo: to be confirmed for final value once mature */ +#ifndef IND_LIST_DYN #define MAX_NUM_METADATA max( 2, MAX_NUM_OBJECTS ) /* number of max. metadata (now only 2 for DirAC) */ +#endif #ifdef IND_LIST_DYN #define MAX_NUM_IND_TEMP_LIST 10 /* maximum number of indices in the temporary list */ diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 29aa795a56..70d71e0159 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -284,11 +284,13 @@ void ivas_initialize_handles_enc( ); ivas_error ivas_init_encoder( - Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ + Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ +#ifndef IND_LIST_DYN + ,Indice ind_list[][MAX_NUM_INDICES] /* i : indices list */ +#endif #ifndef IND_LIST_DYN - Indice ind_list[][MAX_NUM_INDICES], /* i : indices list */ + ,Indice ind_list_metadata[][MAX_BITS_METADATA] /* i : indices list metadata */ #endif - Indice ind_list_metadata[][MAX_BITS_METADATA] /* i : indices list metadata */ ); void destroy_core_enc( diff --git a/lib_com/options.h b/lib_com/options.h index 603a041ded..6ea15c2b48 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -56,9 +56,9 @@ /*#define WMOPS_WC_FRAME_ANALYSIS*/ /* Output detailed complexity analysis for the worst-case frame */ /*#define MEM_COUNT_DETAILS*/ /* Output detailed memory analysis for the worst-case frame (writes to the file "mem_analysis.csv") */ -/*#define BITSTREAM_INDICES_MEMORY*/ /* Don't count memory for bitstream Indice at the encoder - it is a temporary solution for development only */ +/*#define BITSTREAM_INDICES_MEMORY*/ /* Don't count memory for bitstream Indice at the encoder - it is a temporary solution for development only */ #define IND_LIST_DYN /* dynamic allocation of ind_list based on transport channels */ -#define DEBUG_IND_LIST +/*#define DEBUG_IND_LIST*/ #ifdef DEBUGGING diff --git a/lib_com/prot.h b/lib_com/prot.h index 2740a305fd..f1740e2e95 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -516,17 +516,28 @@ void push_next_bits( ); #ifdef IND_LIST_DYN -int16_t set_max_num_indices( /* o : maximum number of indices */ +int16_t get_max_num_indices( /* o : maximum number of indices */ const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int32_t total_brate /* i : total bitrate */ ); +int16_t get_max_num_indices_metadata( /* o : maximum number of indices */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ +); + ivas_error ind_list_realloc( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int32_t total_brate /* i : total bitrate */ ); +ivas_error ind_list_metadata_realloc( + BSTR_ENC_HANDLE hMetaData, /* i/o: encoder bitstream handle */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ +); + int16_t find_indice( /* o : index of the indice in the list, -1 if not found */ BSTR_ENC_HANDLE hBstr, /* i : encoder bitstream handle */ int16_t id, /* i : ID of the indice */ diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index 10be4e86f4..b7ec66ad53 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -117,7 +117,7 @@ ivas_error init_encoder( #ifdef IND_LIST_DYN /* set the maximum allowed number of indices in the list */ - st->hBstr->max_num_indices = set_max_num_indices( hEncoderConfig->ivas_format, st->total_brate ); + st->hBstr->max_num_indices = get_max_num_indices( hEncoderConfig->ivas_format, st->total_brate ); /* allocate buffer of indices */ if ( ( st->hBstr->ind_list = (INDICE_HANDLE) malloc( st->hBstr->max_num_indices * sizeof( Indice ) ) ) == NULL ) diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index 758dd73575..fe8b751166 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -61,14 +61,16 @@ ivas_error ivas_corecoder_enc_reconfig( int16_t n, sce_id, cpe_id; int16_t len_inp_memory, n_CoreCoder_existing, nSCE_existing, nCPE_existing; float input_buff[MCT_MAX_BLOCKS][L_FRAME48k + NS2SA( 48000, IVAS_FB_ENC_DELAY_NS )]; - BSTR_ENC_HANDLE hBstr, hMetaData; + BSTR_ENC_HANDLE hBstr; #ifndef IND_LIST_DYN Indice *ind_list; #endif +#ifndef IND_LIST_DYN Indice *ind_list_metadata; + BSTR_ENC_HANDLE hMetaData; +#endif #ifdef IND_LIST_DYN int16_t i, nb_bits; - //int16_t max_num_indices; Indice temp_ind_list[MAX_NUM_IND_TEMP_LIST]; #endif int16_t nb_bits_tot, next_ind, last_ind; @@ -99,6 +101,10 @@ ivas_error ivas_corecoder_enc_reconfig( copy_encoder_config( st_ivas, st_ivas->hSCE[sce_id]->hCoreCoder[0], 0 ); st_ivas->hSCE[sce_id]->element_brate = brate_SCE; st_ivas->hSCE[sce_id]->hCoreCoder[0]->total_brate = st_ivas->hSCE[sce_id]->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ +#ifdef IND_LIST_DYN + /* re-allocate list of metadata indices, if needed */ + ind_list_metadata_realloc( st_ivas->hSCE[sce_id]->hMetaData, hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); +#endif } for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) @@ -111,6 +117,10 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ } +#ifdef IND_LIST_DYN + /* re-allocate list of metadata indices, if needed */ + ind_list_metadata_realloc( st_ivas->hCPE[cpe_id]->hMetaData, hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); +#endif } if ( st_ivas->nCPE > 1 ) @@ -143,18 +153,24 @@ ivas_error ivas_corecoder_enc_reconfig( ind_list_metadata = NULL; #endif hBstr = NULL; +#ifndef IND_LIST_DYN hMetaData = NULL; +#endif /* get the index list pointers */ if ( nSCE_old ) { hBstr = st_ivas->hSCE[0]->hCoreCoder[0]->hBstr; +#ifndef IND_LIST_DYN hMetaData = st_ivas->hSCE[0]->hMetaData; +#endif } else if ( nCPE_old ) { hBstr = st_ivas->hCPE[0]->hCoreCoder[0]->hBstr; +#ifndef IND_LIST_DYN hMetaData = st_ivas->hCPE[nCPE_old - 1]->hMetaData; +#endif } #ifdef DEBUGGING else @@ -196,7 +212,9 @@ ivas_error ivas_corecoder_enc_reconfig( assert( (nb_bits == nb_bits_tot) && "Error saving bitstream information during core-coder reconfiguration!\n" ); #endif #endif +#ifndef IND_LIST_DYN ind_list_metadata = hMetaData->ind_list; /* pointer to the beginning of the global list */ +#endif if ( hEncoderConfig->ivas_format == MC_FORMAT && last_mc_mode == MC_MODE_MCMASA && st_ivas->mc_mode == MC_MODE_MCMASA ) { @@ -277,30 +295,6 @@ ivas_error ivas_corecoder_enc_reconfig( copy_encoder_config( st_ivas, st_ivas->hSCE[sce_id]->hCoreCoder[0], 0 ); st_ivas->hSCE[sce_id]->element_brate = brate_SCE; st_ivas->hSCE[sce_id]->hCoreCoder[0]->total_brate = st_ivas->hSCE[sce_id]->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ -#ifdef IND_LIST_DYN - ///* set the maximum allowed number of indices in the list */ - //max_num_indices = set_max_num_indices( hEncoderConfig->ivas_format, st_ivas->hSCE[sce_id]->hCoreCoder[0]->total_brate ); - //if ( max_num_indices != st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->max_num_indices ) - //{ - // /* Maximum number of indices has increased -> reallocate buffer of indices */ - // free( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list ); - // st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->max_num_indices = max_num_indices; - // if ( ( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = (INDICE_HANDLE) malloc( max_num_indices * sizeof( Indice ) ) ) == NULL ) - // { - // return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); - // } - - // /* re-fill the buffer of indices with already written indices */ - // i = 0; - // while ( sce_id == 0 && temp_ind_list[i].nb_bits > 0 && i < MAX_NUM_IND_TEMP_LIST ) - // { - // st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].id = temp_ind_list[i].id; - // st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].value = temp_ind_list[i].value; - // st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; - // i++; - // } - //} -#endif } for ( sce_id = nSCE_existing; sce_id < st_ivas->nSCE; sce_id++ ) @@ -360,12 +354,10 @@ ivas_error ivas_corecoder_enc_reconfig( #endif } +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata + sce_id * MAX_BITS_METADATA; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); -#ifdef IND_LIST_DYN - st_ivas->hSCE[sce_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; #endif - } } @@ -383,31 +375,6 @@ ivas_error ivas_corecoder_enc_reconfig( copy_encoder_config( st_ivas, st_ivas->hCPE[cpe_id]->hCoreCoder[n], 0 ); st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ -#ifdef IND_LIST_DYN - ///* set the maximum allowed number of indices in the list */ - //max_num_indices = set_max_num_indices( hEncoderConfig->ivas_format, st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate ); - //if ( max_num_indices != st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->max_num_indices ) - //{ - // /* Maximum number of indices has increased -> reallocate buffer of indices */ - // free( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list ); - // st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->max_num_indices = max_num_indices; - // if ( ( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = (INDICE_HANDLE) malloc( max_num_indices * sizeof( Indice ) ) ) == NULL ) - // { - // return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); - // } - - // /* re-fill the buffer of indices with already written indices */ - // i = 0; - // while ( n == 0 && temp_ind_list[i].nb_bits > 0 && i < MAX_NUM_IND_TEMP_LIST ) - // { - // st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].id = temp_ind_list[i].id; - // st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].value = temp_ind_list[i].value; - // st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; - // i++; - // } - //} -#endif - #ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list + ( cpe_id * CPE_CHANNELS + n + st_ivas->nSCE ) * MAX_NUM_INDICES; #endif @@ -547,32 +514,6 @@ ivas_error ivas_corecoder_enc_reconfig( for ( n = 0; n < CPE_CHANNELS; n++ ) { st_ivas->hCPE[0]->hCoreCoder[n]->total_brate = st_ivas->hCPE[0]->element_brate; -#ifdef IND_LIST_DYN - ///* set the maximum allowed number of indices in the list */ - //max_num_indices = set_max_num_indices( hEncoderConfig->ivas_format, st_ivas->hCPE[0]->hCoreCoder[n]->total_brate ); - //if ( max_num_indices != st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->max_num_indices ) - //{ - // /* Maximum number of indices has increased -> reallocate buffer of indices */ - // free( st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list ); - // st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->max_num_indices = max_num_indices; - // if ( ( st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list = (INDICE_HANDLE) malloc( max_num_indices * sizeof( Indice ) ) ) == NULL ) - // { - // return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); - // } - - // /* re-fill the buffer of indices with already written indices */ - // i = 0; - // while ( n == 0 && temp_ind_list[i].nb_bits > 0 && i < MAX_NUM_IND_TEMP_LIST ) - // { - // st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list[i].id = temp_ind_list[i].id; - // st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list[i].value = temp_ind_list[i].value; - // st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; - // i++; - // } - - //} -#endif - st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal = (int16_t) ( st_ivas->hCPE[0]->element_brate / FRAMES_PER_SEC ); st_ivas->hCPE[0]->hCoreCoder[n]->igf = getIgfPresent( st_ivas->hCPE[0]->hCoreCoder[n]->element_mode, st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal * FRAMES_PER_SEC, @@ -604,7 +545,7 @@ ivas_error ivas_corecoder_enc_reconfig( } } - /* metadata handling for CPEs */ + /* alllocate buffer for metadata indices */ if ( st_ivas->nCPE > 0 ) { if ( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData == NULL ) @@ -613,23 +554,36 @@ ivas_error ivas_corecoder_enc_reconfig( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MetaData structure\n" ) ); } + +#ifdef IND_LIST_DYN + /* set the maximum allowed number of metadata indices in the list */ + st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->max_num_indices = get_max_num_indices_metadata( hEncoderConfig->ivas_total_brate, hEncoderConfig->ivas_format ); + + /* allocate buffer of metadata indices */ + if ( ( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ind_list = (INDICE_HANDLE) malloc( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->max_num_indices * sizeof( Indice ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); + } +#endif } #ifdef IND_LIST_DYN - /* TODO VoiceAge: check, if the last multiplication is really * MAX_BITS_METADATA and not MAX_NUM_INDICES */ - st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ind_list = ind_list_metadata + st_ivas->nSCE * MAX_BITS_METADATA; + reset_indices_enc( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData, st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->max_num_indices ); #else st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ind_list = ind_list_metadata + st_ivas->nSCE * MAX_NUM_INDICES; -#endif reset_indices_enc( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData, MAX_BITS_METADATA ); -#ifdef IND_LIST_DYN - st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->max_num_indices = MAX_BITS_METADATA; #endif for ( cpe_id = 0; cpe_id < st_ivas->nCPE - 1; cpe_id++ ) { if ( st_ivas->hCPE[cpe_id]->hMetaData != NULL ) { +#ifdef IND_LIST_DYN + if ( st_ivas->hCPE[cpe_id]->hMetaData->ind_list != NULL ) + { + free( st_ivas->hCPE[cpe_id]->hMetaData->ind_list ); + } +#endif free( st_ivas->hCPE[cpe_id]->hMetaData ); st_ivas->hCPE[cpe_id]->hMetaData = NULL; } @@ -648,32 +602,6 @@ ivas_error ivas_corecoder_enc_reconfig( for ( n = 0; n < CPE_CHANNELS; n++ ) { st_ivas->hCPE[0]->hCoreCoder[n]->total_brate = st_ivas->hCPE[0]->element_brate; - -#ifdef IND_LIST_DYN - ///* set the maximum allowed number of indices in the list */ - //max_num_indices = set_max_num_indices( hEncoderConfig->ivas_format, st_ivas->hCPE[0]->hCoreCoder[n]->total_brate ); - //if ( max_num_indices != st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->max_num_indices ) - //{ - // /* Maximum number of indices has increased -> reallocate buffer of indices */ - // free( st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list ); - // st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->max_num_indices = max_num_indices; - // if ( ( st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list = (INDICE_HANDLE) malloc( max_num_indices * sizeof( Indice ) ) ) == NULL ) - // { - // return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); - // } - - // /* re-fill the buffer of indices with already written indices */ - // i = 0; - // while ( n == 0 && temp_ind_list[i].nb_bits > 0 && i < MAX_NUM_IND_TEMP_LIST ) - // { - // st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list[i].id = temp_ind_list[i].id; - // st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list[i].value = temp_ind_list[i].value; - // st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; - // i++; - // } - //} -#endif - st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal = (int16_t) ( st_ivas->hCPE[0]->element_brate / FRAMES_PER_SEC ); st_ivas->hCPE[0]->hCoreCoder[n]->igf = getIgfPresent( st_ivas->hCPE[0]->hCoreCoder[n]->element_mode, st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal * FRAMES_PER_SEC, diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 25b74bba1c..01bb3a6171 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -810,6 +810,19 @@ ivas_error create_cpe_enc( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MetaData structure\n" ) ); } + +#ifdef IND_LIST_DYN + /* set the maximum allowed number of indices in the list */ + hCPE->hMetaData->max_num_indices = get_max_num_indices_metadata( hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); + + /* allocate buffer of metadata indices */ + if ( ( hCPE->hMetaData->ind_list = (INDICE_HANDLE) malloc( hCPE->hMetaData->max_num_indices * sizeof( Indice ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); + } + + reset_indices_enc( hCPE->hMetaData, hCPE->hMetaData->max_num_indices ); +#endif } /*-----------------------------------------------------------------* @@ -1007,6 +1020,12 @@ void destroy_cpe_enc( if ( hCPE->hMetaData != NULL ) { +#ifdef IND_LIST_DYN + if ( hCPE->hMetaData->ind_list != NULL ) + { + free( hCPE->hMetaData->ind_list ); + } +#endif free( hCPE->hMetaData ); hCPE->hMetaData = NULL; } diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 692c410f32..fbaa1ad65d 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -310,11 +310,13 @@ void ivas_initialize_handles_enc( *-------------------------------------------------------------------*/ ivas_error ivas_init_encoder( - Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ + Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ #ifndef IND_LIST_DYN - Indice ind_list[][MAX_NUM_INDICES], /* o : bitstream indices */ + ,Indice ind_list[][MAX_NUM_INDICES] /* o : bitstream indices */ +#endif +#ifndef IND_LIST_DYN + ,Indice ind_list_metadata[][MAX_BITS_METADATA] /* o : bitstream indices metadata */ #endif - Indice ind_list_metadata[][MAX_BITS_METADATA] /* o : bitstream indices metadata */ ) { int16_t i, n; @@ -391,20 +393,19 @@ ivas_error ivas_init_encoder( return error; } +#ifndef IND_LIST_DYN /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { -#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); -#endif } +#endif +#ifndef IND_LIST_DYN /* MetaData for DFT stereo */ st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[0]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); -#ifdef IND_LIST_DYN - st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; #endif } else if ( ivas_format == ISM_FORMAT ) @@ -425,15 +426,15 @@ ivas_error ivas_init_encoder( return error; } + /* MetaData for ISMs */ #ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); #endif +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); -#ifdef IND_LIST_DYN - st_ivas->hSCE[sce_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; #endif } @@ -487,15 +488,15 @@ ivas_error ivas_init_encoder( return error; } + /* MetaData for SBA */ #ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); #endif +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); -#ifdef IND_LIST_DYN - st_ivas->hSCE[sce_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; #endif if ( st_ivas->sba_mode == SBA_MODE_SPAR && st_ivas->hEncoderConfig->Opt_DTX_ON ) @@ -511,7 +512,6 @@ ivas_error ivas_init_encoder( return error; } - /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { #ifndef IND_LIST_DYN @@ -525,15 +525,14 @@ ivas_error ivas_init_encoder( } } +#ifndef IND_LIST_DYN /* Metadata only initialized for the last CPE index */ if ( cpe_id == st_ivas->nCPE - 1 ) { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); -#ifdef IND_LIST_DYN - st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; -#endif } +#endif } if ( st_ivas->nCPE > 1 ) @@ -562,26 +561,25 @@ ivas_error ivas_init_encoder( return error; } +#ifndef IND_LIST_DYN /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { /* we need the correct bitstream also for the LFE channel since it might become a proper coded channel when switching to ParamMC and ind_list is only visible here, can't be done later */ -#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); -#endif } +#endif +#ifndef IND_LIST_DYN /* Metadata only initialized for the last CPE index*/ if ( cpe_id == st_ivas->nCPE - 1 ) { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); -#ifdef IND_LIST_DYN - st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; -#endif } +#endif } if ( ( error = create_mct_enc( st_ivas ) ) != IVAS_ERR_OK ) @@ -610,24 +608,23 @@ ivas_error ivas_init_encoder( return error; } +#ifndef IND_LIST_DYN /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { -#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); -#endif } +#endif +#ifndef IND_LIST_DYN /* Metadata only initialized for the last CPE index*/ if ( cpe_id == st_ivas->nCPE - 1 ) { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); -#ifdef IND_LIST_DYN - st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; -#endif } +#endif } if ( st_ivas->nCPE > 1 ) @@ -673,11 +670,9 @@ ivas_error ivas_init_encoder( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); #endif - +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); -#ifdef IND_LIST_DYN - st_ivas->hSCE[sce_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; #endif } @@ -699,15 +694,14 @@ ivas_error ivas_init_encoder( } #endif +#ifndef IND_LIST_DYN /* Metadata only initialized for the last CPE index*/ if ( cpe_id == st_ivas->nCPE - 1 ) { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); -#ifdef IND_LIST_DYN - st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; -#endif } +#endif } } } diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index d735777baa..1e3c3af723 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -713,9 +713,10 @@ ivas_error ivas_ism_metadata_enc( /* write metadata only in active frames */ if ( hSCE[0]->hCoreCoder[0]->core_brate > SID_2k40 ) { - reset_indices_enc( hSCE[ch]->hMetaData, MAX_BITS_METADATA ); #ifdef IND_LIST_DYN - hSCE[ch]->hMetaData->max_num_indices = MAX_BITS_METADATA; + reset_indices_enc( hSCE[ch]->hMetaData, hSCE[ch]->hMetaData->max_num_indices ); +#else + reset_indices_enc( hSCE[ch]->hMetaData, MAX_BITS_METADATA ); #endif } } diff --git a/lib_enc/ivas_sba_enc.c b/lib_enc/ivas_sba_enc.c index a04d1d4cc2..01098f45d3 100644 --- a/lib_enc/ivas_sba_enc.c +++ b/lib_enc/ivas_sba_enc.c @@ -250,10 +250,9 @@ ivas_error ivas_sba_enc_reinit( reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); #endif +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata + sce_id * MAX_BITS_METADATA; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); -#ifdef IND_LIST_DYN - st_ivas->hSCE[sce_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; #endif if ( st_ivas->sba_mode == SBA_MODE_SPAR && st_ivas->hEncoderConfig->Opt_DTX_ON ) @@ -285,15 +284,14 @@ ivas_error ivas_sba_enc_reinit( } } +#ifndef IND_LIST_DYN /* Metadata only initialized for the last CPE index */ if ( cpe_id == st_ivas->nCPE - 1 ) { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata + sce_id * MAX_BITS_METADATA; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); -#ifdef IND_LIST_DYN - st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices = MAX_BITS_METADATA; -#endif } +#endif } if ( st_ivas->nCPE > 1 ) diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index d19c3f5460..b156ba05c9 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -309,6 +309,19 @@ ivas_error create_sce_enc( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MetaData structure\n" ) ); } + +#ifdef IND_LIST_DYN + /* set the maximum allowed number of indices in the list */ + hSCE->hMetaData->max_num_indices = get_max_num_indices_metadata( st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); + + /* allocate buffer of metadata indices */ + if ( ( hSCE->hMetaData->ind_list = (INDICE_HANDLE) malloc( hSCE->hMetaData->max_num_indices * sizeof( Indice ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); + } + + reset_indices_enc( hSCE->hMetaData, hSCE->hMetaData->max_num_indices ); +#endif } else { @@ -368,6 +381,12 @@ void destroy_sce_enc( if ( hSCE->hMetaData != NULL ) { +#ifdef IND_LIST_DYN + if ( hSCE->hMetaData->ind_list != NULL ) + { + free( hSCE->hMetaData->ind_list ); + } +#endif free( hSCE->hMetaData ); hSCE->hMetaData = NULL; } diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 3602c2be68..77c0c9c063 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -879,9 +879,11 @@ ivas_error ivas_spar_md_enc_process( strat = cs[i]; if ( strat != NO_STRAT ) { - reset_indices_enc( &hMetaData_tmp, MAX_BITS_METADATA ); #ifdef IND_LIST_DYN hMetaData_tmp.max_num_indices = MAX_BITS_METADATA; + reset_indices_enc( &hMetaData_tmp, hMetaData_tmp.max_num_indices ); +#else + reset_indices_enc( &hMetaData_tmp, MAX_BITS_METADATA ); #endif ivas_write_spar_md_bitstream( hMdEnc, num_bands, bands_bw, &hMetaData_tmp, hEncoderConfig->ivas_total_brate, strat, qsi, planarCP ); diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 686e6393ac..55186f1ecc 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -51,7 +51,9 @@ struct IVAS_ENC #ifndef IND_LIST_DYN Indice ind_list[MAX_NUM_DATA][MAX_NUM_INDICES]; /* list of indices */ #endif +#ifndef IND_LIST_DYN Indice ind_list_metadata[MAX_NUM_METADATA][MAX_BITS_METADATA]; /* list of indices for metadata */ +#endif ENC_CORE_HANDLE hCoreCoder; bool isConfigured; #ifdef DEBUGGING @@ -101,7 +103,9 @@ ivas_error IVAS_ENC_Open( ) { Encoder_Struct *st_ivas; +#ifndef IND_LIST_DYN int16_t i, j; +#endif if ( phIvasEnc == NULL ) { @@ -147,6 +151,7 @@ ivas_error IVAS_ENC_Open( } #endif +#ifndef IND_LIST_DYN for ( i = 0; i < MAX_NUM_METADATA; ++i ) { for ( j = 0; j < MAX_BITS_METADATA; ++j ) @@ -155,6 +160,7 @@ ivas_error IVAS_ENC_Open( ( *phIvasEnc )->ind_list_metadata[i][j].value = 0; } } +#endif /*-----------------------------------------------------------------* * Allocate IVAS-codec encoder state @@ -909,11 +915,14 @@ static ivas_error configureEncoder( * Finalize initialization *-----------------------------------------------------------------*/ - if ( ( error = ivas_init_encoder( st_ivas, + if ( ( error = ivas_init_encoder( st_ivas #ifndef IND_LIST_DYN - hIvasEnc->ind_list, + ,hIvasEnc->ind_list #endif - hIvasEnc->ind_list_metadata ) ) != IVAS_ERR_OK ) +#ifndef IND_LIST_DYN + ,hIvasEnc->ind_list_metadata +#endif + ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From eb1bd85cd40d52202e41a5f77fc841060f348f87 Mon Sep 17 00:00:00 2001 From: malenov Date: Mon, 6 Mar 2023 13:43:35 +0100 Subject: [PATCH 07/43] add debugging output message when writing indices out-of-order --- lib_com/bitstream.c | 3 +++ lib_com/options.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 3aa0f21bac..c7a62da2c2 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -598,6 +598,9 @@ ivas_error push_indice( /* shift indices, if the new id is to be written somewhere inside the list */ if ( i < hBstr->nb_ind_tot ) { +#ifdef DEBUG_IND_LIST + printf( "Indice ID=%d is written before the last indice with ID=%d!\n", id, hBstr->ind_list[hBstr->nb_ind_tot - 1].id ); +#endif for ( j = hBstr->nb_ind_tot; j > i; j-- ) { hBstr->ind_list[j].id = hBstr->ind_list[j - 1].id; diff --git a/lib_com/options.h b/lib_com/options.h index 6ea15c2b48..995b693a3f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -58,7 +58,7 @@ /*#define BITSTREAM_INDICES_MEMORY*/ /* Don't count memory for bitstream Indice at the encoder - it is a temporary solution for development only */ #define IND_LIST_DYN /* dynamic allocation of ind_list based on transport channels */ -/*#define DEBUG_IND_LIST*/ +#define DEBUG_IND_LIST #ifdef DEBUGGING -- GitLab From aee15bfc298177585b74adfdf52154af02cc35be Mon Sep 17 00:00:00 2001 From: malenov Date: Mon, 6 Mar 2023 14:30:52 +0100 Subject: [PATCH 08/43] deactive DEBUG_IND_LIST by default --- .gitignore | 22 ++++++++++++++++++++++ lib_com/options.h | 2 +- scripts/IvasBuildAndRun.py | 1 + scripts/pyivastest/IvasModeAnalyzer.py | 5 ++++- scripts/pyivastest/IvasScriptsCommon.py | 3 +++ scripts/pyivastest/IvasSvnBuilder.py | 2 ++ 6 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c87c691a4a..6a8896ad76 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,25 @@ Externals/ # coan output files that are created when cleaning out switches coan_out_* +/ci/complexity_measurements/__zaloha +/COMPLEXITY +/scripts/ivas_pytests/tests/unit_tests/crend/tv +/scripts/wmops +/scripts/__zaloha +/tv +/scripts/td_object_renderer/object_renderer_standalone +/scripts/ivas_pytests/tests/unit_tests/crend +/scripts/config/short_test.prm +/NTT_critical_data.pwv +/IvasBuilder.txt +/ind_list.pwv +/I18-comments.c +/build.txt +/__zaloha +/Workspace_msvc/decoder.args.json +/Workspace_msvc/encoder.args.json +/Workspace_msvc/lib_dec.args.json +/scripts/Vlad_mergeNewsletters.py +/scripts/Vlad_extract_max_num_ind.py +/scripts/max_num_indices.xlsx +/res diff --git a/lib_com/options.h b/lib_com/options.h index 85762417ed..9249366ad5 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -58,7 +58,7 @@ /*#define BITSTREAM_INDICES_MEMORY*/ /* Don't count memory for bitstream Indice at the encoder - it is a temporary solution for development only */ #define IND_LIST_DYN /* dynamic allocation of ind_list based on transport channels */ -#define DEBUG_IND_LIST +/*#define DEBUG_IND_LIST*/ #ifdef DEBUGGING diff --git a/scripts/IvasBuildAndRun.py b/scripts/IvasBuildAndRun.py index 554c216b18..77c0e3ad60 100755 --- a/scripts/IvasBuildAndRun.py +++ b/scripts/IvasBuildAndRun.py @@ -32,6 +32,7 @@ import os.path import sys +import pdb from pyivastest.IvasSvnBuilder import * from pyivastest import IvasScriptsCommon diff --git a/scripts/pyivastest/IvasModeAnalyzer.py b/scripts/pyivastest/IvasModeAnalyzer.py index fed4f29ecd..3562837e34 100644 --- a/scripts/pyivastest/IvasModeAnalyzer.py +++ b/scripts/pyivastest/IvasModeAnalyzer.py @@ -36,6 +36,7 @@ import operator from copy import deepcopy import logging import functools +import pdb from pyivastest.IvasModeCollector import IvasModeCollector from pyivastest.constants import LOG_FILE_EXT @@ -44,7 +45,7 @@ from pyivastest.IvasBaseClass import IvasBaseClass INSTRUMENTED_RESULTS = { "WMOPS": { - "keyword": "total", + "keyword": " total", "number_format": "{:.5g}", "position": 2, "max_or_add": "add", @@ -938,6 +939,8 @@ class IvasModeAnalyzer(IvasModeCollector): """ + # pdb.set_trace() + if not os.path.exists(os.path.dirname(csv_file_name)): os.makedirs(os.path.dirname(csv_file_name)) diff --git a/scripts/pyivastest/IvasScriptsCommon.py b/scripts/pyivastest/IvasScriptsCommon.py index 3df9994170..dcbd08c146 100644 --- a/scripts/pyivastest/IvasScriptsCommon.py +++ b/scripts/pyivastest/IvasScriptsCommon.py @@ -39,6 +39,7 @@ from pyivastest.IvasBaseClass import * import pyivastest.constants as constants import logging import platform +import pdb # make sure we have colored output using shell escapes correctly on windows if platform.system() == "Windows": # Only if we are running on Windows @@ -303,6 +304,8 @@ class IvasScriptArgParser(argparse.ArgumentParser): args["loglevel"] = args["loglevel"].upper() # do some sanity checks here + # pdb.set_trace() + # check if config file exists if ( "config" in args.keys() diff --git a/scripts/pyivastest/IvasSvnBuilder.py b/scripts/pyivastest/IvasSvnBuilder.py index 0d7cc9c847..edcea1bb18 100644 --- a/scripts/pyivastest/IvasSvnBuilder.py +++ b/scripts/pyivastest/IvasSvnBuilder.py @@ -42,6 +42,7 @@ import logging from getpass import getpass import urllib.parse from multiprocessing import cpu_count +import pdb from pyivastest.IvasModeRunner import * from pyivastest.IvasModeAnalyzer import * @@ -1110,6 +1111,7 @@ class IvasBuilderAndRunner(IvasBaseClass): self.build_and_run_dict[cfg_name]["runner"].dir_name = run_dir self.build_and_run_dict[cfg_name]["analyzer"].dir = run_dir self.build_and_run_dict[cfg_name]["runner"].run() + if self.build_and_run_dict[cfg_name]["analyzer"].get_errors: failed_modes = self.build_and_run_dict[cfg_name]["runner"].failed_modes self.build_and_run_dict[cfg_name]["analyzer"].get_errors(failed_modes) -- GitLab From 0f2085bb5ad2a01298da2df40e3b874315c2d942 Mon Sep 17 00:00:00 2001 From: malenov Date: Mon, 6 Mar 2023 14:45:47 +0100 Subject: [PATCH 09/43] fixing auto-merge problems in SPAR reconfig --- lib_enc/ivas_ism_dtx_enc.c | 8 +++++- lib_enc/ivas_sba_enc.c | 51 ++++++++++++-------------------------- 2 files changed, 23 insertions(+), 36 deletions(-) diff --git a/lib_enc/ivas_ism_dtx_enc.c b/lib_enc/ivas_ism_dtx_enc.c index 2fea85e44a..f8eebe6d61 100644 --- a/lib_enc/ivas_ism_dtx_enc.c +++ b/lib_enc/ivas_ism_dtx_enc.c @@ -170,7 +170,13 @@ int16_t ivas_ism_dtx_enc( if ( ( st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == -1 ) && ( st_ivas->hSCE[0]->hCoreCoder[0]->last_core_brate == SID_2k40 || st_ivas->hSCE[0]->hCoreCoder[0]->last_core_brate == FRAME_NO_DATA ) ) { st_ivas->hSCE[0]->hCoreCoder[0]->core_brate = st_ivas->hSCE[0]->hCoreCoder[0]->last_core_brate; - reset_indices_enc( st_ivas->hSCE[0]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); + reset_indices_enc( st_ivas->hSCE[0]->hCoreCoder[0]->hBstr, +#ifdef IND_LIST_DYN + st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); } st_ivas->hSCE[1]->hCoreCoder[0]->core_brate = st_ivas->hSCE[0]->hCoreCoder[0]->core_brate; diff --git a/lib_enc/ivas_sba_enc.c b/lib_enc/ivas_sba_enc.c index 8591ff91df..7181684367 100644 --- a/lib_enc/ivas_sba_enc.c +++ b/lib_enc/ivas_sba_enc.c @@ -111,11 +111,7 @@ ivas_error ivas_sba_enc_reconfigure( ivas_error error; ENCODER_CONFIG_HANDLE hEncoderConfig; -#ifndef IND_LIST_DYN - Indice *ind_list; -#endif - BSTR_ENC_HANDLE hBstr; - BSTR_ENC_HANDLE hMetaData; + error = IVAS_ERR_OK; hEncoderConfig = st_ivas->hEncoderConfig; ivas_total_brate = hEncoderConfig->ivas_total_brate; @@ -143,11 +139,8 @@ ivas_error ivas_sba_enc_reconfigure( int16_t n, i, n_old; float **old_mem_hp20_in; - /* save bitstream information */ -#ifndef IND_LIST_DYN - ind_list = hBstr->ind_list; -#endif - ind_list_metadata = hMetaData->ind_list; + n_old = ivas_sba_get_nchan_metadata( analysis_order_old ); + n = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order ); if ( n > n_old ) { @@ -173,34 +166,19 @@ ivas_error ivas_sba_enc_reconfigure( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) ); } -#ifndef IND_LIST_DYN - /* prepare bitstream buffers */ -#endif - for ( n = 0; n < CPE_CHANNELS; n++ ) - { -#ifndef IND_LIST_DYN - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list + ( cpe_id * CPE_CHANNELS + n ) * MAX_NUM_INDICES; - reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); -#endif + set_f( st_ivas->mem_hp20_in[i], 0.0f, L_HP20_MEM ); + } - if ( hEncoderConfig->Opt_DTX_ON ) - { - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->cng_sba_flag = 1; + free( old_mem_hp20_in ); + old_mem_hp20_in = NULL; } - } - -#ifndef IND_LIST_DYN - /* Metadata only initialized for the last CPE index */ - if ( cpe_id == st_ivas->nCPE - 1 ) - { - st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata + sce_id * MAX_BITS_METADATA; - reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); - } -#endif - } + else if ( n < n_old ) + { + /* save old mem_hp_20 pointer */ + old_mem_hp20_in = st_ivas->mem_hp20_in; + st_ivas->mem_hp20_in = NULL; - if ( st_ivas->nCPE > 1 ) - { + if ( ( st_ivas->mem_hp20_in = (float **) malloc( n * sizeof( float * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) ); } @@ -289,8 +267,10 @@ ivas_error ivas_sba_enc_reconfigure( { return error; } + /*Initialization*/ hSpar->hMdEnc->table_idx = -1; + /* FB mixer handle */ ivas_FB_mixer_close( &hSpar->hFbMixer, hEncoderConfig->input_Fs ); @@ -377,6 +357,7 @@ ivas_error ivas_sba_enc_reconfigure( mvs2s( hDirAC->dirac_to_spar_md_bands, hSpar->dirac_to_spar_md_bands, DIRAC_MAX_NBANDS ); hSpar->enc_param_start_band = hDirAC->hConfig->enc_param_start_band; } + /*-----------------------------------------------------------------* * Allocate, initalize, and configure SCE/CPE/MCT handles *-----------------------------------------------------------------*/ -- GitLab From 970d9ef68aac045743ab41038a4d50c855b31981 Mon Sep 17 00:00:00 2001 From: malenov Date: Mon, 6 Mar 2023 16:09:37 +0100 Subject: [PATCH 10/43] fixing re-allocation of the buffer of indices in case of MASA bitrate switching --- lib_enc/ivas_masa_enc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 3a7ac61038..3091d62d1c 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -1688,6 +1688,11 @@ void ivas_masa_enc_reconfigure( copy_encoder_config( st_ivas, st_ivas->hSCE[sce_id]->hCoreCoder[0], 0 ); st_ivas->hSCE[sce_id]->element_brate = ivas_total_brate / st_ivas->nchan_transport; st_ivas->hSCE[sce_id]->hCoreCoder[0]->total_brate = st_ivas->hSCE[sce_id]->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ + +#ifdef IND_LIST_DYN + /* re-allocate list of metadata indices, if needed */ + ind_list_metadata_realloc( st_ivas->hSCE[sce_id]->hMetaData, st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); +#endif } for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) @@ -1699,6 +1704,11 @@ void ivas_masa_enc_reconfigure( { copy_encoder_config( st_ivas, st_ivas->hCPE[cpe_id]->hCoreCoder[n], 0 ); st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ + +#ifdef IND_LIST_DYN + /* re-allocate list of metadata indices, if needed */ + ind_list_metadata_realloc( st_ivas->hCPE[cpe_id]->hMetaData, st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); +#endif } if ( ivas_total_brate < MASA_STEREO_MIN_BITRATE ) -- GitLab From 2d51151810ee20bb43b8118f101dcbc87c0d931a Mon Sep 17 00:00:00 2001 From: malenov Date: Mon, 6 Mar 2023 16:10:14 +0100 Subject: [PATCH 11/43] increasiing maximum number of indices in MASA modes --- lib_com/bitstream.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index c7a62da2c2..ee68ba60f3 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -479,11 +479,11 @@ int16_t get_max_num_indices_metadata( /* o : maximum number of indices */ { if ( ivas_total_brate < IVAS_32k ) { - return 80; + return 90; } else if ( ivas_total_brate < IVAS_48k ) { - return 110; + return 130; } else if ( ivas_total_brate < IVAS_192k ) { @@ -598,7 +598,7 @@ ivas_error push_indice( /* shift indices, if the new id is to be written somewhere inside the list */ if ( i < hBstr->nb_ind_tot ) { -#ifdef DEBUG_IND_LIST +#ifdef DEBUG_IND_LIST_OUT_OF_ORDER printf( "Indice ID=%d is written before the last indice with ID=%d!\n", id, hBstr->ind_list[hBstr->nb_ind_tot - 1].id ); #endif for ( j = hBstr->nb_ind_tot; j > i; j-- ) -- GitLab From d1cadd3419f94d21542b3e30e40f28ed6917788a Mon Sep 17 00:00:00 2001 From: malenov Date: Thu, 9 Mar 2023 10:55:24 +0100 Subject: [PATCH 12/43] removal of the next_ind parameter -> it is replaced by nb_ind_tot --- lib_com/bitstream.c | 11 ++-- lib_enc/igf_enc.c | 3 -- lib_enc/ivas_corecoder_enc_reconfig.c | 13 ++++- lib_enc/ivas_lfe_enc.c | 21 ++++++-- lib_enc/ivas_qmetadata_enc.c | 75 +++++++++++++++++++++++++-- lib_enc/ivas_spar_md_enc.c | 8 +++ lib_enc/stat_enc.h | 4 +- lib_enc/tcx_utils_enc.c | 16 ++++++ 8 files changed, 136 insertions(+), 15 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index ee68ba60f3..043ec48761 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -644,7 +644,6 @@ ivas_error push_indice( /* updates */ #ifdef IND_LIST_DYN hBstr->nb_ind_tot++; - hBstr->next_ind++; #ifdef DEBUG_IND_LIST assert( (hBstr->nb_ind_tot < hBstr->max_num_indices) && "Maximum number of indices has been exceeded!" ); #endif @@ -739,7 +738,6 @@ ivas_error push_next_indice( /* updates */ #ifdef IND_LIST_DYN hBstr->nb_ind_tot++; - hBstr->next_ind = hBstr->nb_ind_tot; #ifdef DEBUG_IND_LIST assert( ( hBstr->nb_ind_tot < hBstr->max_num_indices ) && "Maximum number of indices has been exceeded!" ); #endif @@ -838,7 +836,9 @@ void push_next_bits( } - hBstr->next_ind = (int16_t) ( ptr - hBstr->ind_list ); +#ifndef IND_LIST_DYN + hBstr->next_ind = ( int16_t )( ptr - hBstr->ind_list ); +#endif hBstr->nb_bits_tot = hBstr->nb_bits_tot + nb_bits; return; @@ -910,7 +910,9 @@ uint16_t delete_indice( } hBstr->nb_ind_tot = j; +#ifndef IND_LIST_DYN hBstr->next_ind = j; +#endif for ( ; j < i; j++ ) { @@ -1141,8 +1143,9 @@ void reset_indices_enc( hBstr->nb_bits_tot = 0; #ifdef IND_LIST_DYN hBstr->nb_ind_tot = 0; -#endif +#else hBstr->next_ind = 0; +#endif hBstr->last_ind = -1; for ( i = 0; i < max_num_indices; i++ ) diff --git a/lib_enc/igf_enc.c b/lib_enc/igf_enc.c index 1f18bb8d13..d01ca40057 100644 --- a/lib_enc/igf_enc.c +++ b/lib_enc/igf_enc.c @@ -1806,10 +1806,7 @@ void IGFEncConcatenateBitstream( /* update list of indices */ hBstr->nb_ind_tot -= bsBits; hBstr->nb_bits_tot -= nb_bits_written; - hBstr->next_ind -= bsBits; - #else - indices_to_serial_generic( &hBstr->ind_list[hBstr->next_ind], bsBits, hPrivateData->igfBitstream, &hPrivateData->igfBitstreamBits ); /* make sure there are no leftovers from the temporary bitstream writing */ diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index fe8b751166..b49771b93a 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -73,7 +73,10 @@ ivas_error ivas_corecoder_enc_reconfig( int16_t i, nb_bits; Indice temp_ind_list[MAX_NUM_IND_TEMP_LIST]; #endif - int16_t nb_bits_tot, next_ind, last_ind; + int16_t nb_bits_tot, last_ind; +#ifndef IND_LIST_DYN + int16_t next_ind; +#endif ENCODER_CONFIG_HANDLE hEncoderConfig; ivas_error error; @@ -184,7 +187,9 @@ ivas_error ivas_corecoder_enc_reconfig( ind_list = hBstr->ind_list; /* pointer to the beginning of the global list */ #endif nb_bits_tot = hBstr->nb_bits_tot; +#ifndef IND_LIST_DYN next_ind = hBstr->next_ind; +#endif last_ind = hBstr->last_ind; #ifdef IND_LIST_DYN i = 0; @@ -330,7 +335,9 @@ ivas_error ivas_corecoder_enc_reconfig( { st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->last_ind = last_ind; st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->nb_bits_tot = nb_bits_tot; +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->next_ind = next_ind; +#endif #ifdef IND_LIST_DYN /* re-fill the buffer of indices with already written indices */ i = 0; @@ -392,7 +399,9 @@ ivas_error ivas_corecoder_enc_reconfig( { st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->last_ind = last_ind; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_bits_tot = nb_bits_tot; +#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->next_ind = next_ind; +#endif #ifdef IND_LIST_DYN i = 0; nb_bits = 0; @@ -458,7 +467,9 @@ ivas_error ivas_corecoder_enc_reconfig( { st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->last_ind = last_ind; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_bits_tot = nb_bits_tot; +#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->next_ind = next_ind; +#endif #ifdef IND_LIST_DYN i = 0; nb_bits = 0; diff --git a/lib_enc/ivas_lfe_enc.c b/lib_enc/ivas_lfe_enc.c index 4cdf46640a..fe2e0d3c02 100644 --- a/lib_enc/ivas_lfe_enc.c +++ b/lib_enc/ivas_lfe_enc.c @@ -98,7 +98,11 @@ static void ivas_lfe_enc_quant( BSTR_ENC_HANDLE hBstr ) { int16_t bits_written; +#ifdef IND_LIST_DYN + int16_t nb_ind_tot; +#else int16_t next_ind_pos; +#endif uint16_t quant_strategy, write_bit; int16_t num_quant_strategies; int16_t shift_bits; @@ -117,7 +121,11 @@ static void ivas_lfe_enc_quant( num_quant_strategies = IVAS_MAX_NUM_QUANT_STRATS; shift_bits = IVAS_LFE_SHIFT_BITS; bits_written = hBstr->nb_bits_tot; +#ifdef IND_LIST_DYN + nb_ind_tot = hBstr->nb_ind_tot; +#else next_ind_pos = hBstr->next_ind; +#endif for ( quant_strategy = 0; quant_strategy < num_quant_strategies; quant_strategy++ ) @@ -243,7 +251,11 @@ static void ivas_lfe_enc_quant( } bits_written_arith_enc = hBstr->nb_bits_tot; +#ifdef IND_LIST_DYN + next_ind_pos_arith_enc = hBstr->nb_ind_tot; +#else next_ind_pos_arith_enc = hBstr->next_ind; +#endif push_next_indice( hBstr, coding_strategy, 1 ); base2_num_bits_tot = hBstr->nb_bits_tot - bits_written; @@ -274,7 +286,9 @@ static void ivas_lfe_enc_quant( } #endif hBstr->nb_bits_tot = bits_written_arith_enc; +#ifndef IND_LIST_DYN hBstr->next_ind = next_ind_pos_arith_enc; +#endif coding_strategy = 1; push_next_indice( hBstr, coding_strategy, 1 ); @@ -308,7 +322,7 @@ static void ivas_lfe_enc_quant( { /* reset all indices that were already written - TODO: maybe better store them temporarily first and write at the very end? */ #ifdef IND_LIST_DYN - for ( j = hBstr->nb_ind_tot - 1; j >= next_ind_pos; j-- ) + for ( j = hBstr->nb_ind_tot - 1; j >= nb_ind_tot; j-- ) #else for ( j = hBstr->next_ind - 1; j >= next_ind_pos; j-- ) #endif @@ -318,9 +332,10 @@ static void ivas_lfe_enc_quant( hBstr->nb_bits_tot = bits_written; #ifdef IND_LIST_DYN - hBstr->nb_ind_tot = next_ind_pos; -#endif + hBstr->nb_ind_tot = nb_ind_tot; +#else hBstr->next_ind = next_ind_pos; +#endif } } } diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index ac4f83a657..01bd0a3bca 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -403,7 +403,11 @@ ivas_error ivas_qmetadata_enc_encode( /* Save state of metadata bitstream buffer after writing energy ratios, number of dirs and save space for coherence*/ bit_pos_start = hMetaData->nb_bits_tot; +#ifdef IND_LIST_DYN + next_ind_start = hMetaData->nb_ind_tot; +#else next_ind_start = hMetaData->next_ind; +#endif last_ind_start = hMetaData->last_ind; /* Encode quantized directions with EC frame-wise*/ @@ -413,7 +417,11 @@ ivas_error ivas_qmetadata_enc_encode( bits_signaling[d]++; } +#ifdef IND_LIST_DYN + next_ind_raw_flag = hMetaData->nb_ind_tot; +#else next_ind_raw_flag = hMetaData->next_ind; +#endif push_next_indice( hMetaData, 0, 1 ); /* Raw coding flag*/ bits_dir_bands[0] = ivas_qmetadata_raw_encode_dir( NULL, q_direction, q_direction->cfg.nbands, q_direction->cfg.start_band ); @@ -453,7 +461,11 @@ ivas_error ivas_qmetadata_enc_encode( bits_signaling[d] = 3; /* Write raw flags */ +#ifdef IND_LIST_DYN + next_ind_raw_flag = hMetaData->nb_ind_tot; +#else next_ind_raw_flag = hMetaData->next_ind; +#endif for ( i = start_band; i < nbands; i++ ) { push_next_indice( hMetaData, 0, 1 ); /* Raw coding flag*/ @@ -908,15 +920,19 @@ void ivas_qmetadata_enc_sid_encode( void reset_metadata_spatial( const IVAS_FORMAT ivas_format, /* i : IVAS format */ - BSTR_ENC_HANDLE hMetaData, /* i/o: Metadata bitstream handle */ + BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ const int32_t element_brate, /* i : element bitrate */ int32_t *total_brate, /* o : total bitrate */ const int32_t core_brate, /* i : core bitrate */ - const int16_t nb_bits_metadata, /* i : number of meatdata bits */ + const int16_t nb_bits_metadata, /* i : number of metadata bits */ const SBA_MODE sba_mode /* i : SBA mode */ ) { int16_t i, next_ind_sid, last_ind_sid; +#ifdef IND_LIST_DYN + int16_t j; +#endif + int16_t metadata_sid_bits; if ( core_brate == SID_2k40 || core_brate == FRAME_NO_DATA ) @@ -925,7 +941,9 @@ void reset_metadata_spatial( { if ( sba_mode == SBA_MODE_SPAR ) { +#ifdef DEBUGGING assert( hMetaData->ind_list[0].nb_bits == 1 ); +#endif hMetaData->ind_list[0].value = 1; metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS; while ( hMetaData->nb_bits_tot < metadata_sid_bits ) @@ -936,15 +954,22 @@ void reset_metadata_spatial( else { /* Reset metadata and keep only SID metadata*/ +#ifdef IND_LIST_DYN + last_ind_sid = hMetaData->nb_ind_tot; + next_ind_sid = hMetaData->nb_ind_tot; +#else last_ind_sid = hMetaData->next_ind; next_ind_sid = hMetaData->next_ind; +#endif while ( hMetaData->nb_bits_tot > nb_bits_metadata ) { next_ind_sid--; hMetaData->nb_bits_tot -= hMetaData->ind_list[next_ind_sid].nb_bits; } +#ifndef IND_LIST_DYN hMetaData->next_ind = 0; +#endif hMetaData->nb_bits_tot = 0; for ( i = 0; i < next_ind_sid; i++ ) @@ -952,6 +977,18 @@ void reset_metadata_spatial( hMetaData->ind_list[i].nb_bits = -1; } +#ifdef IND_LIST_DYN + for ( j = 0, i = next_ind_sid; i < last_ind_sid; i++, j++ ) + { + hMetaData->ind_list[j].value = hMetaData->ind_list[i].value; + hMetaData->ind_list[j].nb_bits = hMetaData->ind_list[i].nb_bits; + hMetaData->nb_bits_tot += hMetaData->ind_list[j].nb_bits; + hMetaData->ind_list[i].nb_bits = -1; + } + + hMetaData->nb_ind_tot = j; + hMetaData->last_ind = j - 1; +#else for ( i = next_ind_sid; i < last_ind_sid; i++ ) { hMetaData->ind_list[hMetaData->next_ind].value = hMetaData->ind_list[i].value; @@ -960,13 +997,20 @@ void reset_metadata_spatial( hMetaData->next_ind++; hMetaData->ind_list[i].nb_bits = -1; } + hMetaData->last_ind = hMetaData->next_ind; +#endif +#ifdef DEBUGGING assert( ( hMetaData->nb_bits_tot == ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS ) && "Problem of SID metadata in SCE" ); +#endif } } else { /*Reset metadata*/ +#ifdef IND_LIST_DYN + reset_indices_enc( hMetaData, hMetaData->max_num_indices ); +#else for ( i = 0; i < hMetaData->next_ind; i++ ) { hMetaData->ind_list[i].nb_bits = -1; @@ -974,6 +1018,7 @@ void reset_metadata_spatial( hMetaData->nb_bits_tot = 0; hMetaData->next_ind = 0; hMetaData->last_ind = 0; +#endif } *total_brate = element_brate; @@ -983,12 +1028,24 @@ void reset_metadata_spatial( /* Reset SID metadata bits*/ while ( hMetaData->nb_bits_tot > nb_bits_metadata ) { +#ifdef IND_LIST_DYN + hMetaData->nb_ind_tot--; + hMetaData->nb_bits_tot -= hMetaData->ind_list[hMetaData->nb_ind_tot].nb_bits; + hMetaData->ind_list[hMetaData->nb_ind_tot].nb_bits = -1; +#else hMetaData->next_ind--; hMetaData->nb_bits_tot -= hMetaData->ind_list[hMetaData->next_ind].nb_bits; hMetaData->ind_list[hMetaData->next_ind].nb_bits = -1; +#endif } +#ifdef DEBUGGING assert( hMetaData->nb_bits_tot == nb_bits_metadata && "Problem in metadata for SCE" ); +#endif +#ifdef IND_LIST_DYN + hMetaData->last_ind = hMetaData->nb_ind_tot; +#else hMetaData->last_ind = hMetaData->next_ind; +#endif } return; @@ -1494,7 +1551,7 @@ static int16_t ivas_qmetadata_entropy_encode_df_ratio( /*------------------------------------------------------------------------- * restore_metadata_buffer() * - * Reset metadata buffer + * Restore metadata buffer *------------------------------------------------------------------------*/ void restore_metadata_buffer( @@ -1505,12 +1562,20 @@ void restore_metadata_buffer( { int16_t i; +#ifdef IND_LIST_DYN + for ( i = next_ind_start; i <= hMetaData->nb_ind_tot; i++ ) +#else for ( i = next_ind_start; i <= hMetaData->next_ind; i++ ) +#endif { hMetaData->ind_list[i].nb_bits = -1; } hMetaData->nb_bits_tot = bit_pos_start; +#ifdef IND_LIST_DYN + hMetaData->nb_ind_tot = next_ind_start; +#else hMetaData->next_ind = next_ind_start; +#endif hMetaData->last_ind = last_ind_start; return; @@ -4701,7 +4766,11 @@ static int16_t ivas_qmetadata_quantize_coherence( else { /* write dummy data now and save the position */ +#ifdef IND_LIST_DYN + *indice_coherence = hMetaData->nb_ind_tot; +#else *indice_coherence = hMetaData->next_ind; +#endif k = nbits; while ( k > 0 ) { diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 4936813bd7..6ec83e710b 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -520,7 +520,11 @@ static void write_metadata_buffer( restore_metadata_buffer( hMetaData, next_ind_start, last_ind_start, bit_pos_start ); } +#ifdef IND_LIST_DYN + for ( i = 0; i < hMetaData_tmp->nb_ind_tot; i++ ) +#else for ( i = 0; i < hMetaData_tmp->next_ind; i++ ) +#endif { push_next_indice( hMetaData, hMetaData_tmp->ind_list[i].value, hMetaData_tmp->ind_list[i].nb_bits ); } @@ -609,7 +613,11 @@ ivas_error ivas_spar_md_enc_process( /* Save state of metadata bitstream buffer */ bit_pos_start = hMetaData->nb_bits_tot; +#ifdef IND_LIST_DYN + next_ind_start = hMetaData->nb_ind_tot; +#else next_ind_start = hMetaData->next_ind; +#endif last_ind_start = hMetaData->last_ind; dmx_switch = 0; diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index 7b51714831..d3c1530b58 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -77,7 +77,9 @@ typedef struct bitstream_enc_data_structure #endif int16_t nb_bits_tot; /* total number of bits already written */ Indice *ind_list; /* list of indices */ - int16_t next_ind; /* pointer to the next empty slot in the list of indices */ +#ifndef IND_LIST_DYN + int16_t next_ind; /* pointer to the next empty slot in the list of indices */ +#endif int16_t last_ind; /* last written indice */ int16_t max_num_indices; /* maximum number of indices in the list */ } BSTR_ENC_DATA, *BSTR_ENC_HANDLE; diff --git a/lib_enc/tcx_utils_enc.c b/lib_enc/tcx_utils_enc.c index ba709f0158..2dd5340992 100644 --- a/lib_enc/tcx_utils_enc.c +++ b/lib_enc/tcx_utils_enc.c @@ -1486,11 +1486,19 @@ void ProcessIGF( } else { +#ifdef IND_LIST_DYN + pBsStart = hBstr->nb_ind_tot; +#else pBsStart = hBstr->next_ind; +#endif IGFEncWriteBitstream( hIGFEnc, hBstr, &hIGFEnc->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag ); +#ifdef IND_LIST_DYN + bsBits = hBstr->nb_ind_tot - pBsStart; +#else bsBits = hBstr->next_ind - pBsStart; +#endif IGFEncConcatenateBitstream( hIGFEnc, bsBits, hBstr ); } @@ -1570,11 +1578,19 @@ void ProcessStereoIGF( else { hBstr = sts[ch]->hBstr; +#ifdef IND_LIST_DYN + pBsStart = hBstr->nb_ind_tot; +#else pBsStart = hBstr->next_ind; +#endif IGFEncWriteBitstream( hIGFEnc[ch], hBstr, &hIGFEnc[ch]->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag ); +#ifdef IND_LIST_DYN + bsBits = hBstr->nb_ind_tot - pBsStart; +#else bsBits = hBstr->next_ind - pBsStart; +#endif IGFEncConcatenateBitstream( hIGFEnc[ch], bsBits, hBstr ); } } -- GitLab From 064d3e8b2837f2ef3e2f31700d3a75a7ecf9ac66 Mon Sep 17 00:00:00 2001 From: malenov Date: Fri, 10 Mar 2023 12:06:44 +0100 Subject: [PATCH 13/43] Removal of obsolete parameter hBstr->last_ind -> replaced by hBstr->nb_ind_tot --- lib_com/bitstream.c | 186 +++++++++++++------------- lib_com/ivas_prot.h | 2 + lib_enc/ivas_core_enc.c | 15 ++- lib_enc/ivas_corecoder_enc_reconfig.c | 45 +++++-- lib_enc/ivas_masa_enc.c | 31 ++++- lib_enc/ivas_qmetadata_enc.c | 28 ++-- lib_enc/ivas_spar_md_enc.c | 27 +++- lib_enc/ivas_stereo_mdct_core_enc.c | 16 ++- lib_enc/stat_enc.h | 2 +- 9 files changed, 224 insertions(+), 128 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 043ec48761..e1d24f1745 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -62,6 +62,10 @@ FILE *FEC_pattern = NULL; /* FEC pattern file (for simulation of FEC) */ #endif +#ifdef IND_LIST_DYN +#define STEP_MAX_NUM_INDICES 20 /* increase the maximum number of allowed indices in the list by this amount */ +#endif + #ifdef DEBUG_IND_LIST int16_t max_total_num_ind = 0; int16_t max_total_num_ind_metadata = 0; @@ -226,55 +230,47 @@ Word16 rate2EVSmode( /*-------------------------------------------------------------------* * ind_list_realloc() * - * Re-allocate list of indices if the maximum number of allowed indices has changed + * Re-allocate the list of indices as the maximum number of allowed indices has changed *-------------------------------------------------------------------*/ ivas_error ind_list_realloc( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t total_brate /* i : total bitrate */ + int16_t max_num_indices /* i : new maximum number of allowed indices in the list */ ) { - int16_t i, max_num_indices; + int16_t i; INDICE_HANDLE new_ind_list; - /* get the maximum allowed number of indices in the list */ - max_num_indices = get_max_num_indices( ivas_format, total_brate ); - - /* check, if the maximum number of allowed indices has changed */ - if ( max_num_indices != hBstr->max_num_indices ) + /* allocate new buffer of indices */ + if ( ( new_ind_list = (INDICE_HANDLE) malloc( max_num_indices * sizeof( Indice ) ) ) == NULL ) { - /* allocate new buffer of indices */ - if ( ( new_ind_list = (INDICE_HANDLE) malloc( max_num_indices * sizeof( Indice ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); - } + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); + } - /* move indices from the old list to the new list */ - i = 0; - while ( hBstr->ind_list[i].nb_bits > 0 ) - { - new_ind_list[i].id = hBstr->ind_list[i].id; - new_ind_list[i].value = hBstr->ind_list[i].value; - new_ind_list[i].nb_bits = hBstr->ind_list[i].nb_bits; - i++; - } + /* move indices from the old list to the new list */ + i = 0; + while ( hBstr->ind_list[i].nb_bits > 0 ) + { + new_ind_list[i].id = hBstr->ind_list[i].id; + new_ind_list[i].value = hBstr->ind_list[i].value; + new_ind_list[i].nb_bits = hBstr->ind_list[i].nb_bits; + i++; + } - /* reset nb_bits of all other indices to -1 */ - for ( ; i < max_num_indices; i++ ) - { - new_ind_list[i].nb_bits = -1; - } + /* reset nb_bits of all other indices to -1 */ + for ( ; i < max_num_indices; i++ ) + { + new_ind_list[i].nb_bits = -1; + } - /* free the old list */ - free( hBstr->ind_list ); + /* free the old list */ + free( hBstr->ind_list ); - /* set pointer to the new list */ - hBstr->ind_list = new_ind_list; + /* set pointer to the new list */ + hBstr->ind_list = new_ind_list; - /* set the new maximum for the allowed number of indices */ - hBstr->max_num_indices = max_num_indices; - } + /* set the new maximum for the allowed number of indices */ + hBstr->max_num_indices = max_num_indices; return IVAS_ERR_OK; } @@ -285,58 +281,59 @@ ivas_error ind_list_realloc( * Re-allocate list of metadata indices if the IVAS total bitrate has changed *-------------------------------------------------------------------*/ -ivas_error ind_list_metadata_realloc( - BSTR_ENC_HANDLE hMetaData, /* i/o: encoder bitstream handle */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t ivas_total_brate /* i : IVAS total bitrate */ -) -{ - int16_t i, max_num_indices_metadata; - INDICE_HANDLE new_ind_list_metadata; - - if ( hMetaData != NULL && hMetaData->ind_list != NULL ) - { - /* get the maximum allowed number of indices in the list */ - max_num_indices_metadata = get_max_num_indices_metadata( ivas_format, ivas_total_brate ); +//ivas_error ind_list_metadata_realloc( +// BSTR_ENC_HANDLE hMetaData, /* i/o: encoder bitstream handle */ +// const IVAS_FORMAT ivas_format, /* i : IVAS format */ +// const int32_t ivas_total_brate /* i : IVAS total bitrate */ +//) +//{ +// int16_t i, max_num_indices_metadata; +// INDICE_HANDLE new_ind_list_metadata; +// +// if ( hMetaData != NULL && hMetaData->ind_list != NULL ) +// { +// /* get the maximum allowed number of indices in the list */ +// max_num_indices_metadata = get_max_num_indices_metadata( ivas_format, ivas_total_brate ); +// +// /* check, if the maximum number of allowed indices has changed */ +// if ( max_num_indices_metadata != hMetaData->max_num_indices ) +// { +// /* allocate new buffer of metadata indices */ +// if ( ( new_ind_list_metadata = (INDICE_HANDLE) malloc( max_num_indices_metadata * sizeof( Indice ) ) ) == NULL ) +// { +// return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of metadata indices!\n" ) ); +// } +// +// /* move indices from the old list to the new list */ +// i = 0; +// while ( hMetaData->ind_list[i].nb_bits > 0 ) +// { +// new_ind_list_metadata[i].id = hMetaData->ind_list[i].id; +// new_ind_list_metadata[i].value = hMetaData->ind_list[i].value; +// new_ind_list_metadata[i].nb_bits = hMetaData->ind_list[i].nb_bits; +// i++; +// } +// +// /* reset nb_bits of all other indices to -1 */ +// for ( ; i < max_num_indices_metadata; i++ ) +// { +// new_ind_list_metadata[i].nb_bits = -1; +// } +// +// /* free the old list */ +// free( hMetaData->ind_list ); +// +// /* set pointer to the new list */ +// hMetaData->ind_list = new_ind_list_metadata; +// +// /* set the new maximum for the allowed number of indices */ +// hMetaData->max_num_indices = max_num_indices_metadata; +// } +// } +// +// return IVAS_ERR_OK; +//} - /* check, if the maximum number of allowed indices has changed */ - if ( max_num_indices_metadata != hMetaData->max_num_indices ) - { - /* allocate new buffer of metadata indices */ - if ( ( new_ind_list_metadata = (INDICE_HANDLE) malloc( max_num_indices_metadata * sizeof( Indice ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of metadata indices!\n" ) ); - } - - /* move indices from the old list to the new list */ - i = 0; - while ( hMetaData->ind_list[i].nb_bits > 0 ) - { - new_ind_list_metadata[i].id = hMetaData->ind_list[i].id; - new_ind_list_metadata[i].value = hMetaData->ind_list[i].value; - new_ind_list_metadata[i].nb_bits = hMetaData->ind_list[i].nb_bits; - i++; - } - - /* reset nb_bits of all other indices to -1 */ - for ( ; i < max_num_indices_metadata; i++ ) - { - new_ind_list_metadata[i].nb_bits = -1; - } - - /* free the old list */ - free( hMetaData->ind_list ); - - /* set pointer to the new list */ - hMetaData->ind_list = new_ind_list_metadata; - - /* set the new maximum for the allowed number of indices */ - hMetaData->max_num_indices = max_num_indices_metadata; - } - } - - return IVAS_ERR_OK; -} /*-----------------------------------------------------------------------* * get_max_num_indices() * @@ -577,14 +574,21 @@ ivas_error push_indice( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice ID = %d exceeds the total number of indices: %d (frame %d) !\n", id, MAX_NUM_INDICES, frame ); } #endif +#endif #ifdef IND_LIST_DYN - /* check, if max number of indices has not been exceeded */ + /* check, if the maximum number of indices has been reached and re-allocate the buffer */ + /* the re-allocation can be avoided by increasing the limits in get_max_num_indices() and get_max_num_indices_metadata() */ if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Maximum number of indices %d has been exceeded (frame %d) !\n", hBstr->max_num_indices, frame ); - } +#ifdef DEBUGGING + DEBUG_LINE( 1 ) + printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); #endif + + /* reallocate the buffer of indices with increased limit */ + ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); + } #endif #ifdef IND_LIST_DYN @@ -649,8 +653,8 @@ ivas_error push_indice( #endif #else hBstr->next_ind = i + 1; -#endif hBstr->last_ind = id; +#endif hBstr->nb_bits_tot += nb_bits; return error; @@ -1146,7 +1150,9 @@ void reset_indices_enc( #else hBstr->next_ind = 0; #endif +#ifndef IND_LIST_DYN hBstr->last_ind = -1; +#endif for ( i = 0; i < max_num_indices; i++ ) { diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index c0d3f575fe..b66c99e1aa 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -2944,7 +2944,9 @@ void ivas_qmetadata_close( void restore_metadata_buffer( BSTR_ENC_HANDLE hMetaData, const int16_t next_ind_start, +#ifndef IND_LIST_DYN const int16_t last_ind_start, +#endif const int16_t bit_pos_start ); diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index d1bc85d759..603e5b1468 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -103,6 +103,9 @@ ivas_error ivas_core_enc( int16_t last_element_mode, tdm_Pitch_reuse_flag; int32_t element_brate, last_element_brate, input_Fs; ivas_error error; +#ifdef IND_LIST_DYN + int16_t max_num_indices; +#endif push_wmops( "ivas_core_enc" ); @@ -197,10 +200,18 @@ ivas_error ivas_core_enc( #ifdef IND_LIST_DYN /*---------------------------------------------------------------------* - * Re-allocate list of indices, if needed + * Re-allocate the list of indices, if needed *---------------------------------------------------------------------*/ - ind_list_realloc( st->hBstr, ivas_format, st->total_brate ); + /* get the maximum allowed number of indices in the list */ + max_num_indices = get_max_num_indices( ivas_format, st->total_brate ); + + /* check, if the maximum number of allowed indices has changed */ + if ( max_num_indices != st->hBstr->max_num_indices ) + { + /* re-allocate the list of indices */ + ind_list_realloc( st->hBstr, max_num_indices ); + } #endif /*---------------------------------------------------------------------* diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index b49771b93a..b7403bb0fd 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -70,11 +70,12 @@ ivas_error ivas_corecoder_enc_reconfig( BSTR_ENC_HANDLE hMetaData; #endif #ifdef IND_LIST_DYN - int16_t i, nb_bits; + int16_t i, nb_bits, max_num_indices_metadata; Indice temp_ind_list[MAX_NUM_IND_TEMP_LIST]; #endif - int16_t nb_bits_tot, last_ind; + int16_t nb_bits_tot; #ifndef IND_LIST_DYN + int16_t last_ind; int16_t next_ind; #endif ENCODER_CONFIG_HANDLE hEncoderConfig; @@ -105,8 +106,18 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hSCE[sce_id]->element_brate = brate_SCE; st_ivas->hSCE[sce_id]->hCoreCoder[0]->total_brate = st_ivas->hSCE[sce_id]->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ #ifdef IND_LIST_DYN - /* re-allocate list of metadata indices, if needed */ - ind_list_metadata_realloc( st_ivas->hSCE[sce_id]->hMetaData, hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); + if ( st_ivas->hSCE[sce_id]->hMetaData != NULL ) + { + /* get the maximum allowed number of indices in the list */ + max_num_indices_metadata = get_max_num_indices_metadata( hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); + + /* check, if the maximum number of allowed indices has changed */ + if ( max_num_indices_metadata != st_ivas->hSCE[sce_id]->hMetaData->max_num_indices ) + { + /* re-allocate the list of metadata indices */ + ind_list_realloc( st_ivas->hSCE[sce_id]->hMetaData, max_num_indices_metadata ); + } + } #endif } @@ -121,8 +132,18 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ } #ifdef IND_LIST_DYN - /* re-allocate list of metadata indices, if needed */ - ind_list_metadata_realloc( st_ivas->hCPE[cpe_id]->hMetaData, hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); + if ( st_ivas->hCPE[cpe_id]->hMetaData != NULL ) + { + /* get the maximum allowed number of indices in the list */ + max_num_indices_metadata = get_max_num_indices_metadata( hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); + + /* check, if the maximum number of allowed indices has changed */ + if ( max_num_indices_metadata != st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices ) + { + /* re-allocate the list of metadata indices */ + ind_list_realloc( st_ivas->hCPE[cpe_id]->hMetaData, max_num_indices_metadata ); + } + } #endif } @@ -183,14 +204,12 @@ ivas_error ivas_corecoder_enc_reconfig( #endif /* save bitstream information */ -#ifndef IND_LIST_DYN - ind_list = hBstr->ind_list; /* pointer to the beginning of the global list */ -#endif nb_bits_tot = hBstr->nb_bits_tot; #ifndef IND_LIST_DYN + ind_list = hBstr->ind_list; /* pointer to the beginning of the global list */ next_ind = hBstr->next_ind; -#endif last_ind = hBstr->last_ind; +#endif #ifdef IND_LIST_DYN i = 0; nb_bits = 0; @@ -333,9 +352,9 @@ ivas_error ivas_corecoder_enc_reconfig( } else { - st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->last_ind = last_ind; st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->nb_bits_tot = nb_bits_tot; #ifndef IND_LIST_DYN + st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->last_ind = last_ind; st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->next_ind = next_ind; #endif #ifdef IND_LIST_DYN @@ -397,9 +416,9 @@ ivas_error ivas_corecoder_enc_reconfig( } else { - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->last_ind = last_ind; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_bits_tot = nb_bits_tot; #ifndef IND_LIST_DYN + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->last_ind = last_ind; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->next_ind = next_ind; #endif #ifdef IND_LIST_DYN @@ -465,9 +484,9 @@ ivas_error ivas_corecoder_enc_reconfig( } else { - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->last_ind = last_ind; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_bits_tot = nb_bits_tot; #ifndef IND_LIST_DYN + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->last_ind = last_ind; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->next_ind = next_ind; #endif #ifdef IND_LIST_DYN diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 3091d62d1c..0698c39fc3 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -1678,6 +1678,9 @@ void ivas_masa_enc_reconfigure( int16_t n, tmp; int16_t sce_id, cpe_id; int32_t ivas_total_brate; +#ifdef IND_LIST_DYN + int16_t max_num_indices_metadata; +#endif ivas_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; @@ -1690,8 +1693,18 @@ void ivas_masa_enc_reconfigure( st_ivas->hSCE[sce_id]->hCoreCoder[0]->total_brate = st_ivas->hSCE[sce_id]->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ #ifdef IND_LIST_DYN - /* re-allocate list of metadata indices, if needed */ - ind_list_metadata_realloc( st_ivas->hSCE[sce_id]->hMetaData, st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); + if ( st_ivas->hSCE[sce_id]->hMetaData != NULL ) + { + /* get the maximum allowed number of indices in the list */ + max_num_indices_metadata = get_max_num_indices_metadata( st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); + + /* check, if the maximum number of allowed indices has changed */ + if ( max_num_indices_metadata != st_ivas->hSCE[sce_id]->hMetaData->max_num_indices ) + { + /* re-allocate the list of metadata indices */ + ind_list_realloc( st_ivas->hSCE[sce_id]->hMetaData, max_num_indices_metadata ); + } + } #endif } @@ -1706,8 +1719,18 @@ void ivas_masa_enc_reconfigure( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ #ifdef IND_LIST_DYN - /* re-allocate list of metadata indices, if needed */ - ind_list_metadata_realloc( st_ivas->hCPE[cpe_id]->hMetaData, st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); + if ( st_ivas->hCPE[cpe_id]->hMetaData != NULL ) + { + /* get the maximum allowed number of indices in the list */ + max_num_indices_metadata = get_max_num_indices_metadata( st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); + + /* check, if the maximum number of allowed indices has changed */ + if ( max_num_indices_metadata != st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices ) + { + /* re-allocate the list of metadata indices */ + ind_list_realloc( st_ivas->hCPE[cpe_id]->hMetaData, max_num_indices_metadata ); + } + } #endif } diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 01bd0a3bca..2b969a6d76 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -130,7 +130,10 @@ ivas_error ivas_qmetadata_enc_encode( ) { int16_t i, bit_pos_start, bit_pos_start_coh; - int16_t next_ind_start, last_ind_start; + int16_t next_ind_start; +#ifndef IND_LIST_DYN + int16_t last_ind_start; +#endif uint16_t diffuseness_index_max_ec_frame; uint16_t diffuseness_index_max_ec_frame_pre[QMETADATA_MAX_NO_DIRECTIONS]; int16_t bits_dir_raw_pre[QMETADATA_MAX_NO_DIRECTIONS]; @@ -407,8 +410,8 @@ ivas_error ivas_qmetadata_enc_encode( next_ind_start = hMetaData->nb_ind_tot; #else next_ind_start = hMetaData->next_ind; -#endif last_ind_start = hMetaData->last_ind; +#endif /* Encode quantized directions with EC frame-wise*/ if ( total_bits_1dir + bits_surround_coh <= hQMetaData->qmetadata_max_bit_req ) @@ -453,7 +456,11 @@ ivas_error ivas_qmetadata_enc_encode( /* Encode quantized directions with EC band-wise */ if ( ( total_bits_1dir + bits_surround_coh <= hQMetaData->qmetadata_max_bit_req ) && ( bits_dir[d] + bits_diff[d] + bits_coherence[d] + bits_signaling[d] > total_bits_1dir ) && q_direction->cfg.nblocks > 1 ) { - restore_metadata_buffer( hMetaData, next_ind_start, last_ind_start, bit_pos_start ); + restore_metadata_buffer( hMetaData, next_ind_start, +#ifndef IND_LIST_DYN + last_ind_start, +#endif + bit_pos_start ); /* Write signaling */ push_next_indice( hMetaData, 1, 1 ); /*Write 1 bit to signal no EC frame-wise (EC1)*/ @@ -534,7 +541,11 @@ ivas_error ivas_qmetadata_enc_encode( /*Bit budget exceeded, bit reduction strategy?*/ extra_bits = 0; - restore_metadata_buffer( hMetaData, next_ind_start, last_ind_start, bit_pos_start ); + restore_metadata_buffer( hMetaData, next_ind_start, +#ifndef IND_LIST_DYN + last_ind_start, +#endif + bit_pos_start ); push_next_indice( hMetaData, 1, 1 ); /*Write 1 bit to signal no EC frame-wise (EC1)*/ if ( nblocks > 1 ) @@ -987,7 +998,6 @@ void reset_metadata_spatial( } hMetaData->nb_ind_tot = j; - hMetaData->last_ind = j - 1; #else for ( i = next_ind_sid; i < last_ind_sid; i++ ) { @@ -1041,9 +1051,7 @@ void reset_metadata_spatial( #ifdef DEBUGGING assert( hMetaData->nb_bits_tot == nb_bits_metadata && "Problem in metadata for SCE" ); #endif -#ifdef IND_LIST_DYN - hMetaData->last_ind = hMetaData->nb_ind_tot; -#else +#ifndef IND_LIST_DYN hMetaData->last_ind = hMetaData->next_ind; #endif } @@ -1557,7 +1565,9 @@ static int16_t ivas_qmetadata_entropy_encode_df_ratio( void restore_metadata_buffer( BSTR_ENC_HANDLE hMetaData, const int16_t next_ind_start, +#ifndef IND_LIST_DYN const int16_t last_ind_start, +#endif const int16_t bit_pos_start ) { int16_t i; @@ -1575,8 +1585,8 @@ void restore_metadata_buffer( hMetaData->nb_ind_tot = next_ind_start; #else hMetaData->next_ind = next_ind_start; -#endif hMetaData->last_ind = last_ind_start; +#endif return; } diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 6ec83e710b..e1bc2b0d7d 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -510,14 +510,22 @@ static void write_metadata_buffer( BSTR_ENC_HANDLE hMetaData_tmp, BSTR_ENC_HANDLE hMetaData, const int16_t bit_pos_start, - const int16_t next_ind_start, - const int16_t last_ind_start ) + const int16_t next_ind_start +#ifndef IND_LIST_DYN + , + const int16_t last_ind_start +#endif +) { int16_t i; if ( hMetaData->nb_bits_tot > 0 ) { - restore_metadata_buffer( hMetaData, next_ind_start, last_ind_start, bit_pos_start ); + restore_metadata_buffer( hMetaData, next_ind_start, +#ifndef IND_LIST_DYN + last_ind_start, +#endif + bit_pos_start ); } #ifdef IND_LIST_DYN @@ -560,7 +568,10 @@ ivas_error ivas_spar_md_enc_process( int16_t nB, bands_bw, packed_ok = 0; ivas_strats_t cs[MAX_CODING_STRATS]; int16_t code_strat; - int16_t bit_pos_start, next_ind_start, last_ind_start; + int16_t bit_pos_start, next_ind_start; +#ifndef IND_LIST_DYN + int16_t last_ind_start; +#endif BSTR_ENC_DATA hMetaData_tmp; Indice ind_list_tmp[MAX_BITS_METADATA]; // IVAS_fmToDo: size to be optimized float Wscale[IVAS_MAX_NUM_BANDS]; @@ -617,8 +628,8 @@ ivas_error ivas_spar_md_enc_process( next_ind_start = hMetaData->nb_ind_tot; #else next_ind_start = hMetaData->next_ind; -#endif last_ind_start = hMetaData->last_ind; +#endif dmx_switch = 0; @@ -890,7 +901,11 @@ ivas_error ivas_spar_md_enc_process( if ( hMetaData->nb_bits_tot == bit_pos_start || hMetaData_tmp.nb_bits_tot < ( hMetaData->nb_bits_tot - bit_pos_start ) ) { - write_metadata_buffer( &hMetaData_tmp, hMetaData, bit_pos_start, next_ind_start, last_ind_start ); + write_metadata_buffer( &hMetaData_tmp, hMetaData, bit_pos_start, next_ind_start +#ifndef IND_LIST_DYN + , last_ind_start +#endif + ); code_strat = strat; } if ( hMetaData->nb_bits_tot - bit_pos_start + ( ( ( hEncoderConfig->ivas_total_brate == IVAS_256k ) && ( sba_order == SBA_FOA_ORDER ) ) ? 1 : 0 ) <= hMdEnc->spar_md_cfg.tgt_bits_per_blk ) diff --git a/lib_enc/ivas_stereo_mdct_core_enc.c b/lib_enc/ivas_stereo_mdct_core_enc.c index 79659a8f84..ec5277925b 100644 --- a/lib_enc/ivas_stereo_mdct_core_enc.c +++ b/lib_enc/ivas_stereo_mdct_core_enc.c @@ -148,6 +148,9 @@ void stereo_mdct_core_enc( int16_t p_param[CPE_CHANNELS][2]; int16_t stereo_bits; int16_t meta_bits, signal_bits; +#ifdef IND_LIST_DYN + int16_t max_num_indices; +#endif push_wmops( "stereo_mdct_core_enc" ); @@ -184,10 +187,17 @@ void stereo_mdct_core_enc( SetTCXModeInfo( st, st->hTranDet, &st->hTcxCfg->tcx_curr_overlap_mode ); #ifdef IND_LIST_DYN - /* Re-allocate list of indices, if needed (note that st->total_brate is modified later in this function) */ - ind_list_realloc( st->hBstr, ivas_format, st->total_brate ); -#endif + /* re-allocate list of indices, if needed (note that st->total_brate is modified later in this function) */ + /* get the maximum allowed number of indices in the list */ + max_num_indices = get_max_num_indices( ivas_format, st->total_brate ); + /* check, if the maximum number of allowed indices has changed */ + if ( max_num_indices != st->hBstr->max_num_indices ) + { + /* re-allocate the list of indices */ + ind_list_realloc( st->hBstr, max_num_indices ); + } +#endif } /* adaptively sync tcx modes*/ diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index d3c1530b58..3386bc724e 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -79,8 +79,8 @@ typedef struct bitstream_enc_data_structure Indice *ind_list; /* list of indices */ #ifndef IND_LIST_DYN int16_t next_ind; /* pointer to the next empty slot in the list of indices */ + int16_t last_ind; /* last written indice */ #endif - int16_t last_ind; /* last written indice */ int16_t max_num_indices; /* maximum number of indices in the list */ } BSTR_ENC_DATA, *BSTR_ENC_HANDLE; -- GitLab From f8fafc1720dca5236363568a14cb8f2c69077ae8 Mon Sep 17 00:00:00 2001 From: malenov Date: Fri, 10 Mar 2023 12:07:02 +0100 Subject: [PATCH 14/43] add max_num_indices as a parameter to ind_list_realloc() --- lib_com/prot.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib_com/prot.h b/lib_com/prot.h index 7b6021fd00..db2da8d57e 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -528,14 +528,7 @@ int16_t get_max_num_indices_metadata( /* o : maximum number of indices */ ivas_error ind_list_realloc( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t total_brate /* i : total bitrate */ -); - -ivas_error ind_list_metadata_realloc( - BSTR_ENC_HANDLE hMetaData, /* i/o: encoder bitstream handle */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t ivas_total_brate /* i : IVAS total bitrate */ + int16_t max_num_indices /* i : new maximum number of allowed indices in the list */ ); int16_t find_indice( /* o : index of the indice in the list, -1 if not found */ -- GitLab From f2fe22b120a22c070106aba84decc10e20095211 Mon Sep 17 00:00:00 2001 From: malenov Date: Fri, 10 Mar 2023 12:16:14 +0100 Subject: [PATCH 15/43] cleanup (removal of DEBUG_IND_LIST) insert safety mechanism for ind_list reallocation also in push_next_indice() and push_next_bits() --- apps/encoder.c | 12 ----- lib_com/bitstream.c | 104 ++++++++++++++++++++------------------------ 2 files changed, 47 insertions(+), 69 deletions(-) diff --git a/apps/encoder.c b/apps/encoder.c index 19d89ef91e..cba4a26408 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -47,12 +47,6 @@ #define WMC_TOOL_SKIP -#ifdef DEBUG_IND_LIST -extern int16_t max_total_num_ind; -extern int16_t max_total_num_ind_metadata; -extern int32_t max_at_brate; -#endif - /*------------------------------------------------------------------------------------------* * Local constants, enums, structures *------------------------------------------------------------------------------------------*/ @@ -804,12 +798,6 @@ int main( print_snr(); #endif -#ifdef DEBUG_IND_LIST - printf( "\nMaximum total number of indices: %d at bitrate: %d\n", max_total_num_ind, max_at_brate ); - printf( "\nMaximum total number of indices for metadata: %d\n", max_total_num_ind_metadata ); -#endif - - /*------------------------------------------------------------------------------------------* * Close files and deallocate resources *------------------------------------------------------------------------------------------*/ diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index e1d24f1745..f40e980105 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -66,12 +66,6 @@ FILE *FEC_pattern = NULL; /* FEC pattern file (for simulation of FEC) */ #define STEP_MAX_NUM_INDICES 20 /* increase the maximum number of allowed indices in the list by this amount */ #endif -#ifdef DEBUG_IND_LIST -int16_t max_total_num_ind = 0; -int16_t max_total_num_ind_metadata = 0; -int32_t max_at_brate; -#endif - #ifndef IND_LIST_DYN /*-------------------------------------------------------------------* * pack_bit() @@ -602,9 +596,6 @@ ivas_error push_indice( /* shift indices, if the new id is to be written somewhere inside the list */ if ( i < hBstr->nb_ind_tot ) { -#ifdef DEBUG_IND_LIST_OUT_OF_ORDER - printf( "Indice ID=%d is written before the last indice with ID=%d!\n", id, hBstr->ind_list[hBstr->nb_ind_tot - 1].id ); -#endif for ( j = hBstr->nb_ind_tot; j > i; j-- ) { hBstr->ind_list[j].id = hBstr->ind_list[j - 1].id; @@ -648,9 +639,6 @@ ivas_error push_indice( /* updates */ #ifdef IND_LIST_DYN hBstr->nb_ind_tot++; -#ifdef DEBUG_IND_LIST - assert( (hBstr->nb_ind_tot < hBstr->max_num_indices) && "Maximum number of indices has been exceeded!" ); -#endif #else hBstr->next_ind = i + 1; hBstr->last_ind = id; @@ -707,9 +695,7 @@ ivas_error push_next_indice( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Total number of indices exceeded: %d !\n", MAX_NUM_INDICES ); } -#endif -#ifndef IND_LIST_DYN if ( hBstr->ind_list[hBstr->next_ind].nb_bits > 0 ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice with value %d is trying to re-write an existing indice (frame %d) !\n", value, frame ); @@ -717,6 +703,22 @@ ivas_error push_next_indice( #endif #endif +#ifdef IND_LIST_DYN + /* check, if the maximum number of indices has been reached and re-allocate the buffer */ + /* the re-allocation can be avoided by increasing the limits in get_max_num_indices() and get_max_num_indices_metadata() */ + if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) + { +#ifdef DEBUGGING + DEBUG_LINE( 1 ) + printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); +#endif + + /* reallocate the buffer of indices with increased limit */ + ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); + } +#endif + + #ifdef IND_LIST_DYN /* get the id of the previous indice -> it will be re-used */ if ( hBstr->nb_ind_tot > 0 ) @@ -742,14 +744,9 @@ ivas_error push_next_indice( /* updates */ #ifdef IND_LIST_DYN hBstr->nb_ind_tot++; -#ifdef DEBUG_IND_LIST - assert( ( hBstr->nb_ind_tot < hBstr->max_num_indices ) && "Maximum number of indices has been exceeded!" ); -#endif - #else hBstr->next_ind++; #endif - hBstr->nb_bits_tot += nb_bits; return error; @@ -785,6 +782,7 @@ void push_next_bits( #ifdef DEBUG_BS_READ_WRITE printf( "%s: %d: %d\n", func, line, nb_bits ); #endif + #ifdef IND_LIST_DYN ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; @@ -814,12 +812,24 @@ void push_next_bits( #ifdef IND_LIST_DYN ptr->id = prev_id; hBstr->nb_ind_tot++; -#ifdef DEBUG_IND_LIST - assert( ( hBstr->nb_ind_tot < hBstr->max_num_indices ) && "Maximum number of indices has been exceeded!" ); #endif + +#ifdef IND_LIST_DYN + /* check, if the maximum number of indices has been reached and re-allocate the buffer */ + /* the re-allocation can be avoided by increasing the limits in get_max_num_indices() and get_max_num_indices_metadata() */ + if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) + { +#ifdef DEBUGGING + DEBUG_LINE( 1 ) + printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); +#endif + + /* reallocate the buffer of indices with increased limit */ + ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); + } #endif - ++ptr; + ++ptr; } for ( ; i < nb_bits; ++i ) @@ -832,12 +842,24 @@ void push_next_bits( #ifdef IND_LIST_DYN ptr->id = prev_id; hBstr->nb_ind_tot++; -#ifdef DEBUG_IND_LIST - assert( ( hBstr->nb_ind_tot < hBstr->max_num_indices ) && "Maximum number of indices has been exceeded!" ); #endif + +#ifdef IND_LIST_DYN + /* check, if the maximum number of indices has been reached and re-allocate the buffer */ + /* the re-allocation can be avoided by increasing the limits in get_max_num_indices() and get_max_num_indices_metadata() */ + if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) + { +#ifdef DEBUGGING + DEBUG_LINE( 1 ) + printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); #endif - ++ptr; + /* reallocate the buffer of indices with increased limit */ + ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); + } +#endif + + ++ptr; } #ifndef IND_LIST_DYN @@ -1416,13 +1438,6 @@ static ivas_error write_indices_element( { if ( st_ivas->hSCE[element_id]->hMetaData != NULL ) { -#ifdef DEBUG_IND_LIST - /* find the maximum number of metadata indices */ - if ( st_ivas->hSCE[element_id]->hMetaData->nb_ind_tot > max_total_num_ind_metadata ) - { - max_total_num_ind_metadata = st_ivas->hSCE[element_id]->hMetaData->nb_ind_tot; - } -#endif #ifdef IND_LIST_DYN reset_indices_enc( st_ivas->hSCE[element_id]->hMetaData, st_ivas->hSCE[element_id]->hMetaData->max_num_indices ); #else @@ -1430,15 +1445,6 @@ static ivas_error write_indices_element( #endif } -#ifdef DEBUG_IND_LIST - /* find the maximum number of core-coder indices */ - if ( sts[0]->hBstr->nb_ind_tot > max_total_num_ind ) - { - max_total_num_ind = sts[0]->hBstr->nb_ind_tot; - max_at_brate = sts[0]->total_brate; - } -#endif - reset_indices_enc( sts[0]->hBstr, #ifdef IND_LIST_DYN sts[0]->hBstr->max_num_indices @@ -1451,13 +1457,6 @@ static ivas_error write_indices_element( { if ( st_ivas->hCPE[element_id]->hMetaData != NULL ) { -#ifdef DEBUG_IND_LIST - /* find the maximum number of metadata indices */ - if ( st_ivas->hCPE[element_id]->hMetaData->nb_ind_tot > max_total_num_ind_metadata ) - { - max_total_num_ind_metadata = st_ivas->hCPE[element_id]->hMetaData->nb_ind_tot; - } -#endif #ifdef IND_LIST_DYN reset_indices_enc( st_ivas->hCPE[element_id]->hMetaData, st_ivas->hCPE[element_id]->hMetaData->max_num_indices ); #else @@ -1467,15 +1466,6 @@ static ivas_error write_indices_element( for ( n = 0; n < n_channels; n++ ) { -#ifdef DEBUG_IND_LIST - /* find the maximum number of core-coder indices */ - if ( sts[n]->hBstr->nb_ind_tot > max_total_num_ind ) - { - max_total_num_ind = sts[n]->hBstr->nb_ind_tot; - max_at_brate = sts[0]->total_brate; - } -#endif - reset_indices_enc( sts[n]->hBstr, #ifdef IND_LIST_DYN sts[n]->hBstr->max_num_indices -- GitLab From 38561e92689c661231cd34aa59dd229c4d749a9f Mon Sep 17 00:00:00 2001 From: malenov Date: Fri, 10 Mar 2023 12:22:17 +0100 Subject: [PATCH 16/43] remove macro BITSTREAM_INDICES_MEMORY --- .gitignore | 22 ---------------------- lib_com/options.h | 16 ++++++++-------- lib_enc/lib_enc.c | 13 ------------- 3 files changed, 8 insertions(+), 43 deletions(-) diff --git a/.gitignore b/.gitignore index 6a8896ad76..c87c691a4a 100644 --- a/.gitignore +++ b/.gitignore @@ -72,25 +72,3 @@ Externals/ # coan output files that are created when cleaning out switches coan_out_* -/ci/complexity_measurements/__zaloha -/COMPLEXITY -/scripts/ivas_pytests/tests/unit_tests/crend/tv -/scripts/wmops -/scripts/__zaloha -/tv -/scripts/td_object_renderer/object_renderer_standalone -/scripts/ivas_pytests/tests/unit_tests/crend -/scripts/config/short_test.prm -/NTT_critical_data.pwv -/IvasBuilder.txt -/ind_list.pwv -/I18-comments.c -/build.txt -/__zaloha -/Workspace_msvc/decoder.args.json -/Workspace_msvc/encoder.args.json -/Workspace_msvc/lib_dec.args.json -/scripts/Vlad_mergeNewsletters.py -/scripts/Vlad_extract_max_num_ind.py -/scripts/max_num_indices.xlsx -/res diff --git a/lib_com/options.h b/lib_com/options.h index 9249366ad5..1c21751bfc 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -50,16 +50,12 @@ #ifndef RELEASE #define DEBUGGING /* Activate debugging part of the code */ #endif -#define WMOPS /* Activate complexity and memory counters */ +/*#define WMOPS*/ /* Activate complexity and memory counters */ /*#define WMOPS_PER_FRAME*/ /* Output per-frame complexity (writes one float value per frame to the file "wmops_analysis") */ /*#define WMOPS_DETAIL*/ /* Output detailed complexity printout for every function. Increases runtime overhead */ /*#define WMOPS_WC_FRAME_ANALYSIS*/ /* Output detailed complexity analysis for the worst-case frame */ /*#define MEM_COUNT_DETAILS*/ /* Output detailed memory analysis for the worst-case frame (writes to the file "mem_analysis.csv") */ -/*#define BITSTREAM_INDICES_MEMORY*/ /* Don't count memory for bitstream Indice at the encoder - it is a temporary solution for development only */ -#define IND_LIST_DYN /* dynamic allocation of ind_list based on transport channels */ -/*#define DEBUG_IND_LIST*/ - #ifdef DEBUGGING /*#define DEBUG_MODE_INFO*/ /* output most important parameters to the subdirectory "res/" */ @@ -136,6 +132,7 @@ /* ################# Start DEVELOPMENT switches ######################## */ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ +#define IND_LIST_DYN /* VA: Issue 18: Dynamic allocation of ind_list[] and ind_list_metadata[] based on # of transport channels */ #define LSF_RE_USE_SECONDARY_CHANNEL /* TD stereo Secondary channel LSF Q improvement */ #ifdef LSF_RE_USE_SECONDARY_CHANNEL @@ -144,10 +141,12 @@ #define DISABLE_ADAP_RES_COD_TMP /* temporary fix for IVAS-403, disables adaptive residual coding */ /*#define ITD_WINNER_GAIN_MODIFY */ /* ITD optimization - WORK IN PROGRESS */ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ - +#define SBA_BR_SWITCHING_CLEAN_UP /*Issue 114: Clean up changes for the SBA reconfiguation functions*/ #define LOW_RATE_TRANS_CORE_CODER /* Eri: Activate low-rate-encoding-of-transients contribution for core coder, affects MC, MASA and SBA */ -#define FIX_197_CREND_INTERFACE +#define FIX_197_CREND_INTERFACE #define FIX_329_ENABLE_TD_RENDERER_REVERB_MC /* Eri: Enable reverb for TD renderer for 5.1 and 7.1 with headtracking enabled for IVAS_dec */ +#define FIX_330_ENABLE_TD_RENDERER_REVERB_REND /* Eri: Enable reverb for TD renderer for ISM, 5.1 and 7.1 with headtracking enabled for IVAS_rend */ + #define FIX_347_DTX_CRASH /* FhG: Fix crash that can happen with DTX */ #define DISABLE_RES_CHANNELS_MCT /* decode only W and residual for Y when outputting to stereo */ #define FIX_107_5MS_SUBFRAME_RENDERING @@ -165,9 +164,10 @@ #define BINAURALIZATION_DELAY_REPORT /* VA: Issue 255 - Changes the way the decoder delay is reported */ #define FIX_351_HRTF_COMMAND /* VA: Issue 354 - improve "-hrtf" command-line option */ - #define FIX_94_VERIFY_WAV_NUM_CHANNELS /* FhG: Issue 94 - Check if number of channels in input wav file matches encoder/renderer configuration */ #define ISM_HIGHEST_BITRATE /* VA: Issue 284: Update highest bitrate limit in ISM format */ +#define TUNE_360_OBJECT_WITH_NOISE /* VA: issue 360: consider objects being speech+noise for active speech coding */ +#define FIX_350_MASA_DELAY_COMP /* Nokia: Issue 350: MASA audio/meta delay compensation */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 91b12d298d..d2b1fe4e84 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -116,13 +116,7 @@ ivas_error IVAS_ENC_Open( * Allocate and initialize IVAS application encoder handle *-----------------------------------------------------------------*/ -#ifdef BITSTREAM_INDICES_MEMORY -#define WMC_TOOL_SKIP if ( ( *phIvasEnc = (IVAS_ENC_HANDLE) malloc( sizeof( struct IVAS_ENC ) ) ) == NULL ) -#undef WMC_TOOL_SKIP -#else - if ( ( *phIvasEnc = (IVAS_ENC_HANDLE) malloc( sizeof( struct IVAS_ENC ) ) ) == NULL ) -#endif { return IVAS_ERR_FAILED_ALLOC; } @@ -230,14 +224,7 @@ void IVAS_ENC_Close( ( *phIvasEnc )->st_ivas = NULL; -#ifdef BITSTREAM_INDICES_MEMORY -#define WMC_TOOL_SKIP free( *phIvasEnc ); -#undef WMC_TOOL_SKIP -#else - free( *phIvasEnc ); -#endif - *phIvasEnc = NULL; phIvasEnc = NULL; -- GitLab From 7230a6caf648fc16225bcd6065ddc25d2fd2e65b Mon Sep 17 00:00:00 2001 From: malenov Date: Mon, 13 Mar 2023 09:40:54 +0100 Subject: [PATCH 17/43] clang formatting --- lib_com/bitstream.c | 126 +++++++++++++------------- lib_com/prot.h | 34 +++---- lib_enc/enc_ppp.c | 2 +- lib_enc/fd_cng_enc.c | 6 +- lib_enc/igf_enc.c | 2 +- lib_enc/init_enc.c | 4 +- lib_enc/ivas_core_enc.c | 4 +- lib_enc/ivas_corecoder_enc_reconfig.c | 9 +- lib_enc/ivas_cpe_enc.c | 12 +-- lib_enc/ivas_init_enc.c | 8 +- lib_enc/ivas_ism_dtx_enc.c | 4 +- lib_enc/ivas_qmetadata_enc.c | 8 +- lib_enc/ivas_sce_enc.c | 16 ++-- lib_enc/ivas_spar_encoder.c | 12 +-- lib_enc/ivas_spar_md_enc.c | 9 +- lib_enc/ivas_stereo_mdct_core_enc.c | 4 +- lib_enc/lib_enc.c | 12 ++- lib_enc/stat_enc.h | 4 +- 18 files changed, 139 insertions(+), 137 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index f40e980105..d0d7f442c6 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -63,7 +63,7 @@ FILE *FEC_pattern = NULL; /* FEC pattern file (for simulation of FEC) */ #endif #ifdef IND_LIST_DYN -#define STEP_MAX_NUM_INDICES 20 /* increase the maximum number of allowed indices in the list by this amount */ +#define STEP_MAX_NUM_INDICES 20 /* increase the maximum number of allowed indices in the list by this amount */ #endif #ifndef IND_LIST_DYN @@ -228,8 +228,8 @@ Word16 rate2EVSmode( *-------------------------------------------------------------------*/ ivas_error ind_list_realloc( - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - int16_t max_num_indices /* i : new maximum number of allowed indices in the list */ + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + int16_t max_num_indices /* i : new maximum number of allowed indices in the list */ ) { int16_t i; @@ -275,58 +275,58 @@ ivas_error ind_list_realloc( * Re-allocate list of metadata indices if the IVAS total bitrate has changed *-------------------------------------------------------------------*/ -//ivas_error ind_list_metadata_realloc( -// BSTR_ENC_HANDLE hMetaData, /* i/o: encoder bitstream handle */ -// const IVAS_FORMAT ivas_format, /* i : IVAS format */ -// const int32_t ivas_total_brate /* i : IVAS total bitrate */ +// ivas_error ind_list_metadata_realloc( +// BSTR_ENC_HANDLE hMetaData, /* i/o: encoder bitstream handle */ +// const IVAS_FORMAT ivas_format, /* i : IVAS format */ +// const int32_t ivas_total_brate /* i : IVAS total bitrate */ //) //{ -// int16_t i, max_num_indices_metadata; -// INDICE_HANDLE new_ind_list_metadata; +// int16_t i, max_num_indices_metadata; +// INDICE_HANDLE new_ind_list_metadata; // -// if ( hMetaData != NULL && hMetaData->ind_list != NULL ) -// { -// /* get the maximum allowed number of indices in the list */ -// max_num_indices_metadata = get_max_num_indices_metadata( ivas_format, ivas_total_brate ); +// if ( hMetaData != NULL && hMetaData->ind_list != NULL ) +// { +// /* get the maximum allowed number of indices in the list */ +// max_num_indices_metadata = get_max_num_indices_metadata( ivas_format, ivas_total_brate ); // -// /* check, if the maximum number of allowed indices has changed */ -// if ( max_num_indices_metadata != hMetaData->max_num_indices ) -// { -// /* allocate new buffer of metadata indices */ -// if ( ( new_ind_list_metadata = (INDICE_HANDLE) malloc( max_num_indices_metadata * sizeof( Indice ) ) ) == NULL ) -// { -// return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of metadata indices!\n" ) ); -// } +// /* check, if the maximum number of allowed indices has changed */ +// if ( max_num_indices_metadata != hMetaData->max_num_indices ) +// { +// /* allocate new buffer of metadata indices */ +// if ( ( new_ind_list_metadata = (INDICE_HANDLE) malloc( max_num_indices_metadata * sizeof( Indice ) ) ) == NULL ) +// { +// return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of metadata indices!\n" ) ); +// } // -// /* move indices from the old list to the new list */ -// i = 0; -// while ( hMetaData->ind_list[i].nb_bits > 0 ) -// { -// new_ind_list_metadata[i].id = hMetaData->ind_list[i].id; -// new_ind_list_metadata[i].value = hMetaData->ind_list[i].value; -// new_ind_list_metadata[i].nb_bits = hMetaData->ind_list[i].nb_bits; -// i++; -// } +// /* move indices from the old list to the new list */ +// i = 0; +// while ( hMetaData->ind_list[i].nb_bits > 0 ) +// { +// new_ind_list_metadata[i].id = hMetaData->ind_list[i].id; +// new_ind_list_metadata[i].value = hMetaData->ind_list[i].value; +// new_ind_list_metadata[i].nb_bits = hMetaData->ind_list[i].nb_bits; +// i++; +// } // -// /* reset nb_bits of all other indices to -1 */ -// for ( ; i < max_num_indices_metadata; i++ ) -// { -// new_ind_list_metadata[i].nb_bits = -1; -// } +// /* reset nb_bits of all other indices to -1 */ +// for ( ; i < max_num_indices_metadata; i++ ) +// { +// new_ind_list_metadata[i].nb_bits = -1; +// } // -// /* free the old list */ -// free( hMetaData->ind_list ); +// /* free the old list */ +// free( hMetaData->ind_list ); // -// /* set pointer to the new list */ -// hMetaData->ind_list = new_ind_list_metadata; +// /* set pointer to the new list */ +// hMetaData->ind_list = new_ind_list_metadata; // -// /* set the new maximum for the allowed number of indices */ -// hMetaData->max_num_indices = max_num_indices_metadata; -// } -// } +// /* set the new maximum for the allowed number of indices */ +// hMetaData->max_num_indices = max_num_indices_metadata; +// } +// } // -// return IVAS_ERR_OK; -//} +// return IVAS_ERR_OK; +// } /*-----------------------------------------------------------------------* * get_max_num_indices() @@ -334,9 +334,9 @@ ivas_error ind_list_realloc( * Set the maximum allowed number of indices in the list *-----------------------------------------------------------------------*/ -int16_t get_max_num_indices( /* o : maximum number of indices */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t total_brate /* i : total bitrate */ +int16_t get_max_num_indices( /* o : maximum number of indices */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t total_brate /* i : total bitrate */ ) { /* set the maximum required number of indices */ @@ -433,9 +433,9 @@ int16_t get_max_num_indices( /* o : maximum number of indices */ * Set the maximum allowed number of metadata indices in the list *-----------------------------------------------------------------------*/ -int16_t get_max_num_indices_metadata( /* o : maximum number of indices */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t ivas_total_brate /* i : IVAS total bitrate */ +int16_t get_max_num_indices_metadata( /* o : maximum number of indices */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ ) { /* set the maximum required number of metadata indices */ @@ -863,7 +863,7 @@ void push_next_bits( } #ifndef IND_LIST_DYN - hBstr->next_ind = ( int16_t )( ptr - hBstr->ind_list ); + hBstr->next_ind = (int16_t) ( ptr - hBstr->ind_list ); #endif hBstr->nb_bits_tot = hBstr->nb_bits_tot + nb_bits; @@ -1385,10 +1385,10 @@ static ivas_error write_indices_element( #endif write_indices_to_stream( ind_list_metadata, &pt_stream_loc, -1, #ifdef IND_LIST_DYN - nb_ind_tot_metadata + nb_ind_tot_metadata #else - MAX_BITS_METADATA -#endif + MAX_BITS_METADATA +#endif ); #ifdef ENABLE_BITRATE_VERIFICATION @@ -1411,10 +1411,10 @@ static ivas_error write_indices_element( #endif write_indices_to_stream( sts[n]->hBstr->ind_list, &pt_stream_loc, 1, #ifdef IND_LIST_DYN - sts[n]->hBstr->nb_ind_tot + sts[n]->hBstr->nb_ind_tot #else - MAX_NUM_INDICES -#endif + MAX_NUM_INDICES +#endif ); #ifdef ENABLE_BITRATE_VERIFICATION @@ -1447,10 +1447,10 @@ static ivas_error write_indices_element( reset_indices_enc( sts[0]->hBstr, #ifdef IND_LIST_DYN - sts[0]->hBstr->max_num_indices + sts[0]->hBstr->max_num_indices #else - MAX_NUM_INDICES -#endif + MAX_NUM_INDICES +#endif ); } else @@ -1466,12 +1466,12 @@ static ivas_error write_indices_element( for ( n = 0; n < n_channels; n++ ) { - reset_indices_enc( sts[n]->hBstr, + reset_indices_enc( sts[n]->hBstr, #ifdef IND_LIST_DYN sts[n]->hBstr->max_num_indices #else MAX_NUM_INDICES -#endif +#endif ); } } diff --git a/lib_com/prot.h b/lib_com/prot.h index cc3fb8d93b..5ffb9d0946 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -516,31 +516,31 @@ void push_next_bits( ); #ifdef IND_LIST_DYN -int16_t get_max_num_indices( /* o : maximum number of indices */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t total_brate /* i : total bitrate */ +int16_t get_max_num_indices( /* o : maximum number of indices */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t total_brate /* i : total bitrate */ ); -int16_t get_max_num_indices_metadata( /* o : maximum number of indices */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t ivas_total_brate /* i : IVAS total bitrate */ +int16_t get_max_num_indices_metadata( /* o : maximum number of indices */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ ); ivas_error ind_list_realloc( - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - int16_t max_num_indices /* i : new maximum number of allowed indices in the list */ + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + int16_t max_num_indices /* i : new maximum number of allowed indices in the list */ ); -int16_t find_indice( /* o : index of the indice in the list, -1 if not found */ - BSTR_ENC_HANDLE hBstr, /* i : encoder bitstream handle */ - int16_t id, /* i : ID of the indice */ - uint16_t *value, /* o : value of the quantized indice */ - int16_t *nb_bits /* o : number of bits used to quantize the indice */ +int16_t find_indice( /* o : index of the indice in the list, -1 if not found */ + BSTR_ENC_HANDLE hBstr, /* i : encoder bitstream handle */ + int16_t id, /* i : ID of the indice */ + uint16_t *value, /* o : value of the quantized indice */ + int16_t *nb_bits /* o : number of bits used to quantize the indice */ ); -uint16_t delete_indice( /* o : number of deleted indices */ - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - int16_t id /* i : ID of the indice */ +uint16_t delete_indice( /* o : number of deleted indices */ + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + int16_t id /* i : ID of the indice */ ); #endif @@ -2255,7 +2255,7 @@ void read_next_force( ); #endif ivas_error init_encoder( - Encoder_State *st, /* i/o: state structure */ + Encoder_State *st, /* i/o: state structure */ #ifdef IND_LIST_DYN ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : encoder configuration handle */ #endif diff --git a/lib_enc/enc_ppp.c b/lib_enc/enc_ppp.c index 8d1ffcecd7..a70d37a4dc 100644 --- a/lib_enc/enc_ppp.c +++ b/lib_enc/enc_ppp.c @@ -175,7 +175,7 @@ ivas_error encod_ppp( #else MAX_NUM_INDICES #endif - ); + ); /* signaling matrix (writing of signaling bits) */ signaling_enc( st ); diff --git a/lib_enc/fd_cng_enc.c b/lib_enc/fd_cng_enc.c index 2d81bd433f..e0341e00c3 100644 --- a/lib_enc/fd_cng_enc.c +++ b/lib_enc/fd_cng_enc.c @@ -899,20 +899,20 @@ void stereoFdCngCoherence( else if ( sts[0]->core_brate <= SID_2k40 && sts[1]->core_brate <= SID_2k40 ) { /* case: no VAD for both channels -> INACTIVE FRAME */ - reset_indices_enc( sts[0]->hBstr, + reset_indices_enc( sts[0]->hBstr, #ifdef IND_LIST_DYN sts[0]->hBstr->max_num_indices #else MAX_NUM_INDICES #endif - ); + ); reset_indices_enc( sts[1]->hBstr, #ifdef IND_LIST_DYN sts[1]->hBstr->max_num_indices #else MAX_NUM_INDICES #endif - ); + ); /* synchronize SID sending for variable SID rate */ if ( sts[0]->core_brate != sts[1]->core_brate ) diff --git a/lib_enc/igf_enc.c b/lib_enc/igf_enc.c index d01ca40057..677bc1639e 100644 --- a/lib_enc/igf_enc.c +++ b/lib_enc/igf_enc.c @@ -1759,7 +1759,7 @@ void IGFEncConcatenateBitstream( IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; #ifdef IND_LIST_DYN Indice *ind_list; - uint8_t *pFrame; /* byte array with bit packet and byte aligned coded speech data */ + uint8_t *pFrame; /* byte array with bit packet and byte aligned coded speech data */ int16_t *pFrame_size; /* number of bits in the binary encoded access unit [bits] */ int16_t k, nb_bits_written; int32_t imask; diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index fd5ae491b3..a2a168262d 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -54,7 +54,7 @@ *-----------------------------------------------------------------------*/ ivas_error init_encoder( - Encoder_State *st, /* i/o: state structure */ + Encoder_State *st, /* i/o: state structure */ #ifdef IND_LIST_DYN ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : encoder configuration handle */ #endif @@ -859,8 +859,6 @@ ivas_error init_encoder( } - - /*-----------------------------------------------------------------------* * LPDmem_enc_init() * diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 603e5b1468..d4e5e6c686 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -284,9 +284,9 @@ ivas_error ivas_core_enc( { stereo_mdct_core_enc( hCPE, #ifdef IND_LIST_DYN - ivas_format, + ivas_format, #endif - old_inp_16k, old_wsp, pitch_buf ); + old_inp_16k, old_wsp, pitch_buf ); } } else if ( sts[0]->core_brate == SID_2k40 && sts[1]->core_brate == SID_2k40 ) diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index 06cbe153ce..18d7f06e0e 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -235,7 +235,7 @@ ivas_error ivas_corecoder_enc_reconfig( } #ifdef DEBUGGING - assert( (nb_bits == nb_bits_tot) && "Error saving bitstream information during core-coder reconfiguration!\n" ); + assert( ( nb_bits == nb_bits_tot ) && "Error saving bitstream information during core-coder reconfiguration!\n" ); #endif #endif #ifndef IND_LIST_DYN @@ -344,13 +344,13 @@ ivas_error ivas_corecoder_enc_reconfig( /* only reset indices if it is not the first index list, this already contains the IVAS format bits */ if ( sce_id > 0 ) { - reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, + reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, #ifdef IND_LIST_DYN st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->max_num_indices #else MAX_NUM_INDICES #endif - ); + ); } else { @@ -408,7 +408,7 @@ ivas_error ivas_corecoder_enc_reconfig( #endif if ( cpe_id * CPE_CHANNELS + n > 0 || ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->nSCE > 0 ) ) { - reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, + reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, #ifdef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->max_num_indices #else @@ -511,7 +511,6 @@ ivas_error ivas_corecoder_enc_reconfig( assert( ( nb_bits == nb_bits_tot ) && "Error restoring bitstream information during core-coder reconfiguration!\n" ); #endif #endif - } if ( hEncoderConfig->Opt_DTX_ON ) diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 47709dc036..054804372b 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -856,15 +856,15 @@ ivas_error create_cpe_enc( #ifdef PARAM_ISM_DTX_CNG if ( ( error = init_encoder( st, #ifdef IND_LIST_DYN - hEncoderConfig, -#endif - n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) + hEncoderConfig, +#endif + n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) #else if ( ( error = init_encoder( st, #ifdef IND_LIST_DYN - hEncoderConfig, -#endif - n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0 ) ) != IVAS_ERR_OK ) + hEncoderConfig, +#endif + n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0 ) ) != IVAS_ERR_OK ) #endif { return error; diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 2b976761f2..9af3c7e8a8 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -319,12 +319,14 @@ void ivas_initialize_handles_enc( *-------------------------------------------------------------------*/ ivas_error ivas_init_encoder( - Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ + Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ #ifndef IND_LIST_DYN - ,Indice ind_list[][MAX_NUM_INDICES] /* o : bitstream indices */ + , + Indice ind_list[][MAX_NUM_INDICES] /* o : bitstream indices */ #endif #ifndef IND_LIST_DYN - ,Indice ind_list_metadata[][MAX_BITS_METADATA] /* o : bitstream indices metadata */ + , + Indice ind_list_metadata[][MAX_BITS_METADATA] /* o : bitstream indices metadata */ #endif ) { diff --git a/lib_enc/ivas_ism_dtx_enc.c b/lib_enc/ivas_ism_dtx_enc.c index f8eebe6d61..bc8134f365 100644 --- a/lib_enc/ivas_ism_dtx_enc.c +++ b/lib_enc/ivas_ism_dtx_enc.c @@ -174,8 +174,8 @@ int16_t ivas_ism_dtx_enc( #ifdef IND_LIST_DYN st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->max_num_indices #else - MAX_NUM_INDICES -#endif + MAX_NUM_INDICES +#endif ); } diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 2b969a6d76..97bc34a9cb 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -456,11 +456,11 @@ ivas_error ivas_qmetadata_enc_encode( /* Encode quantized directions with EC band-wise */ if ( ( total_bits_1dir + bits_surround_coh <= hQMetaData->qmetadata_max_bit_req ) && ( bits_dir[d] + bits_diff[d] + bits_coherence[d] + bits_signaling[d] > total_bits_1dir ) && q_direction->cfg.nblocks > 1 ) { - restore_metadata_buffer( hMetaData, next_ind_start, + restore_metadata_buffer( hMetaData, next_ind_start, #ifndef IND_LIST_DYN last_ind_start, #endif - bit_pos_start ); + bit_pos_start ); /* Write signaling */ push_next_indice( hMetaData, 1, 1 ); /*Write 1 bit to signal no EC frame-wise (EC1)*/ @@ -541,11 +541,11 @@ ivas_error ivas_qmetadata_enc_encode( /*Bit budget exceeded, bit reduction strategy?*/ extra_bits = 0; - restore_metadata_buffer( hMetaData, next_ind_start, + restore_metadata_buffer( hMetaData, next_ind_start, #ifndef IND_LIST_DYN last_ind_start, #endif - bit_pos_start ); + bit_pos_start ); push_next_indice( hMetaData, 1, 1 ); /*Write 1 bit to signal no EC frame-wise (EC1)*/ if ( nblocks > 1 ) diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 5657eac579..03cc8d9028 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -357,17 +357,17 @@ ivas_error create_sce_enc( st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; #ifdef PARAM_ISM_DTX_CNG - if ( ( error = init_encoder( st, + if ( ( error = init_encoder( st, #ifdef IND_LIST_DYN - st_ivas->hEncoderConfig, -#endif - 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) + st_ivas->hEncoderConfig, +#endif + 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) #else - if ( ( error = init_encoder( st, + if ( ( error = init_encoder( st, #ifdef IND_LIST_DYN - st_ivas->hEncoderConfig, -#endif - 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0 ) ) != IVAS_ERR_OK ) + st_ivas->hEncoderConfig, +#endif + 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0 ) ) != IVAS_ERR_OK ) #endif { return error; diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index aca9fed994..43058148d4 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -222,15 +222,15 @@ ivas_error ivas_spar_enc_open( #ifdef PARAM_ISM_DTX_CNG if ( ( error = init_encoder( hSpar->hCoreCoderVAD, #ifdef IND_LIST_DYN - hEncoderConfig, -#endif - 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) + hEncoderConfig, +#endif + 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) #else if ( ( error = init_encoder( hSpar->hCoreCoderVAD, #ifdef IND_LIST_DYN - hEncoderConfig, -#endif - 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1 ) ) != IVAS_ERR_OK ) + hEncoderConfig, +#endif + 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1 ) ) != IVAS_ERR_OK ) #endif { return error; diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index e1bc2b0d7d..6b2492ebb4 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -513,7 +513,7 @@ static void write_metadata_buffer( const int16_t next_ind_start #ifndef IND_LIST_DYN , - const int16_t last_ind_start + const int16_t last_ind_start #endif ) { @@ -525,7 +525,7 @@ static void write_metadata_buffer( #ifndef IND_LIST_DYN last_ind_start, #endif - bit_pos_start ); + bit_pos_start ); } #ifdef IND_LIST_DYN @@ -903,8 +903,9 @@ ivas_error ivas_spar_md_enc_process( { write_metadata_buffer( &hMetaData_tmp, hMetaData, bit_pos_start, next_ind_start #ifndef IND_LIST_DYN - , last_ind_start -#endif + , + last_ind_start +#endif ); code_strat = strat; } diff --git a/lib_enc/ivas_stereo_mdct_core_enc.c b/lib_enc/ivas_stereo_mdct_core_enc.c index ec5277925b..047db979e2 100644 --- a/lib_enc/ivas_stereo_mdct_core_enc.c +++ b/lib_enc/ivas_stereo_mdct_core_enc.c @@ -116,9 +116,9 @@ static void sync_tcx_mode( *-------------------------------------------------------------------*/ void stereo_mdct_core_enc( - CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ + CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ #ifdef IND_LIST_DYN - const int16_t ivas_format, /* i : IVAS format */ + const int16_t ivas_format, /* i : IVAS format */ #endif float new_samples[CPE_CHANNELS][L_INP], /* i : new samples */ float old_wsp[CPE_CHANNELS][L_WSP], /* i : 12.8kHz weighted speech (for LTP */ diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 3103b87b30..1b771a041c 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -49,7 +49,7 @@ struct IVAS_ENC { Encoder_Struct *st_ivas; #ifndef IND_LIST_DYN - Indice ind_list[MAX_NUM_DATA][MAX_NUM_INDICES]; /* list of indices */ + Indice ind_list[MAX_NUM_DATA][MAX_NUM_INDICES]; /* list of indices */ #endif #ifndef IND_LIST_DYN Indice ind_list_metadata[MAX_NUM_METADATA][MAX_BITS_METADATA]; /* list of indices for metadata */ @@ -914,12 +914,14 @@ static ivas_error configureEncoder( if ( ( error = ivas_init_encoder( st_ivas #ifndef IND_LIST_DYN - ,hIvasEnc->ind_list + , + hIvasEnc->ind_list #endif #ifndef IND_LIST_DYN - ,hIvasEnc->ind_list_metadata -#endif - ) ) != IVAS_ERR_OK ) + , + hIvasEnc->ind_list_metadata +#endif + ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index 3386bc724e..c37ed76dc7 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -78,8 +78,8 @@ typedef struct bitstream_enc_data_structure int16_t nb_bits_tot; /* total number of bits already written */ Indice *ind_list; /* list of indices */ #ifndef IND_LIST_DYN - int16_t next_ind; /* pointer to the next empty slot in the list of indices */ - int16_t last_ind; /* last written indice */ + int16_t next_ind; /* pointer to the next empty slot in the list of indices */ + int16_t last_ind; /* last written indice */ #endif int16_t max_num_indices; /* maximum number of indices in the list */ } BSTR_ENC_DATA, *BSTR_ENC_HANDLE; -- GitLab From e1e6613a4fb0a84c9c38cace74d2991a4c5e8988 Mon Sep 17 00:00:00 2001 From: malenov Date: Tue, 28 Mar 2023 12:59:42 +0200 Subject: [PATCH 18/43] cleanup --- lib_com/bitstream.c | 58 --------------------------------------------- 1 file changed, 58 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index d0d7f442c6..c28c04112b 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -269,64 +269,6 @@ ivas_error ind_list_realloc( return IVAS_ERR_OK; } -/*-------------------------------------------------------------------* - * ind_list_metadata_realloc() - * - * Re-allocate list of metadata indices if the IVAS total bitrate has changed - *-------------------------------------------------------------------*/ - -// ivas_error ind_list_metadata_realloc( -// BSTR_ENC_HANDLE hMetaData, /* i/o: encoder bitstream handle */ -// const IVAS_FORMAT ivas_format, /* i : IVAS format */ -// const int32_t ivas_total_brate /* i : IVAS total bitrate */ -//) -//{ -// int16_t i, max_num_indices_metadata; -// INDICE_HANDLE new_ind_list_metadata; -// -// if ( hMetaData != NULL && hMetaData->ind_list != NULL ) -// { -// /* get the maximum allowed number of indices in the list */ -// max_num_indices_metadata = get_max_num_indices_metadata( ivas_format, ivas_total_brate ); -// -// /* check, if the maximum number of allowed indices has changed */ -// if ( max_num_indices_metadata != hMetaData->max_num_indices ) -// { -// /* allocate new buffer of metadata indices */ -// if ( ( new_ind_list_metadata = (INDICE_HANDLE) malloc( max_num_indices_metadata * sizeof( Indice ) ) ) == NULL ) -// { -// return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of metadata indices!\n" ) ); -// } -// -// /* move indices from the old list to the new list */ -// i = 0; -// while ( hMetaData->ind_list[i].nb_bits > 0 ) -// { -// new_ind_list_metadata[i].id = hMetaData->ind_list[i].id; -// new_ind_list_metadata[i].value = hMetaData->ind_list[i].value; -// new_ind_list_metadata[i].nb_bits = hMetaData->ind_list[i].nb_bits; -// i++; -// } -// -// /* reset nb_bits of all other indices to -1 */ -// for ( ; i < max_num_indices_metadata; i++ ) -// { -// new_ind_list_metadata[i].nb_bits = -1; -// } -// -// /* free the old list */ -// free( hMetaData->ind_list ); -// -// /* set pointer to the new list */ -// hMetaData->ind_list = new_ind_list_metadata; -// -// /* set the new maximum for the allowed number of indices */ -// hMetaData->max_num_indices = max_num_indices_metadata; -// } -// } -// -// return IVAS_ERR_OK; -// } /*-----------------------------------------------------------------------* * get_max_num_indices() -- GitLab From d9cbb3212b10341fdbe07f72baf91d832f90d3e7 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Tue, 28 Mar 2023 17:50:15 +0200 Subject: [PATCH 19/43] Revert "cleanup" This reverts commit e1e6613a4fb0a84c9c38cace74d2991a4c5e8988. --- lib_com/bitstream.c | 58 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index c28c04112b..d0d7f442c6 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -269,6 +269,64 @@ ivas_error ind_list_realloc( return IVAS_ERR_OK; } +/*-------------------------------------------------------------------* + * ind_list_metadata_realloc() + * + * Re-allocate list of metadata indices if the IVAS total bitrate has changed + *-------------------------------------------------------------------*/ + +// ivas_error ind_list_metadata_realloc( +// BSTR_ENC_HANDLE hMetaData, /* i/o: encoder bitstream handle */ +// const IVAS_FORMAT ivas_format, /* i : IVAS format */ +// const int32_t ivas_total_brate /* i : IVAS total bitrate */ +//) +//{ +// int16_t i, max_num_indices_metadata; +// INDICE_HANDLE new_ind_list_metadata; +// +// if ( hMetaData != NULL && hMetaData->ind_list != NULL ) +// { +// /* get the maximum allowed number of indices in the list */ +// max_num_indices_metadata = get_max_num_indices_metadata( ivas_format, ivas_total_brate ); +// +// /* check, if the maximum number of allowed indices has changed */ +// if ( max_num_indices_metadata != hMetaData->max_num_indices ) +// { +// /* allocate new buffer of metadata indices */ +// if ( ( new_ind_list_metadata = (INDICE_HANDLE) malloc( max_num_indices_metadata * sizeof( Indice ) ) ) == NULL ) +// { +// return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of metadata indices!\n" ) ); +// } +// +// /* move indices from the old list to the new list */ +// i = 0; +// while ( hMetaData->ind_list[i].nb_bits > 0 ) +// { +// new_ind_list_metadata[i].id = hMetaData->ind_list[i].id; +// new_ind_list_metadata[i].value = hMetaData->ind_list[i].value; +// new_ind_list_metadata[i].nb_bits = hMetaData->ind_list[i].nb_bits; +// i++; +// } +// +// /* reset nb_bits of all other indices to -1 */ +// for ( ; i < max_num_indices_metadata; i++ ) +// { +// new_ind_list_metadata[i].nb_bits = -1; +// } +// +// /* free the old list */ +// free( hMetaData->ind_list ); +// +// /* set pointer to the new list */ +// hMetaData->ind_list = new_ind_list_metadata; +// +// /* set the new maximum for the allowed number of indices */ +// hMetaData->max_num_indices = max_num_indices_metadata; +// } +// } +// +// return IVAS_ERR_OK; +// } /*-----------------------------------------------------------------------* * get_max_num_indices() -- GitLab From 9920cf1a990116abe7b2082b9b08c12294d988b6 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Tue, 28 Mar 2023 17:51:05 +0200 Subject: [PATCH 20/43] Revert "merge main to branch" This reverts commit c4d68f64840cef87f0bccad9a3c66e245040bb7b, reversing changes made to 7230a6caf648fc16225bcd6065ddc25d2fd2e65b. --- .gitlab-ci.yml | 43 - Workspace_msvc/lib_com.vcxproj | 2 +- Workspace_msvc/lib_com.vcxproj.filters | 6 +- Workspace_msvc/lib_util.vcxproj | 2 - lib_enc/acelp_core_enc.c | 4 + lib_enc/amr_wb_enc.c | 7 +- lib_enc/bw_detect.c | 51 - lib_enc/fd_cng_enc.c | 4 + lib_enc/init_enc.c | 37 +- lib_enc/ivas_agc_enc.c | 24 +- lib_enc/ivas_core_enc.c | 2 - lib_enc/ivas_core_pre_proc_front.c | 18 +- lib_enc/ivas_corecoder_enc_reconfig.c | 3 +- lib_enc/ivas_cpe_enc.c | 14 + lib_enc/ivas_decision_matrix_enc.c | 4 +- lib_enc/ivas_dirac_enc.c | 25 +- lib_enc/ivas_enc.c | 5 +- lib_enc/ivas_enc_cov_handler.c | 27 +- lib_enc/ivas_init_enc.c | 99 +- lib_enc/ivas_ism_dtx_enc.c | 226 +- lib_enc/ivas_ism_enc.c | 197 +- lib_enc/ivas_ism_metadata_enc.c | 750 +---- lib_enc/ivas_ism_param_enc.c | 135 +- lib_enc/ivas_lfe_enc.c | 22 +- lib_enc/ivas_masa_enc.c | 22 +- lib_enc/ivas_mc_param_enc.c | 30 +- lib_enc/ivas_mcmasa_enc.c | 80 +- lib_enc/ivas_mct_enc.c | 96 +- lib_enc/ivas_mdct_core_enc.c | 17 - lib_enc/ivas_sba_enc.c | 112 +- lib_enc/ivas_sce_enc.c | 17 + lib_enc/ivas_spar_encoder.c | 138 +- lib_enc/ivas_spar_md_enc.c | 14 +- lib_enc/ivas_stat_enc.h | 14 +- lib_enc/ivas_stereo_dmx_evs.c | 16 +- lib_enc/ivas_tcx_core_enc.c | 4 + lib_enc/lib_enc.c | 69 +- lib_enc/lib_enc.h | 7 +- lib_enc/pre_proc.c | 7 +- lib_enc/rst_enc.c | 4 + lib_rend/ivas_crend.c | 1432 +++++++- lib_rend/ivas_dirac_dec_binaural_functions.c | 17 +- lib_rend/ivas_hrtf.c | 36 + lib_rend/ivas_objectRenderer.c | 281 +- lib_rend/ivas_objectRenderer_hrFilt.c | 11 - lib_rend/ivas_objectRenderer_sfx.c | 12 +- lib_rend/ivas_objectRenderer_sources.c | 15 - lib_rend/ivas_objectRenderer_vec.c | 17 +- lib_rend/ivas_orient_trk.c | 620 +--- lib_rend/ivas_prot_rend.h | 167 +- lib_rend/ivas_render_config.c | 7 - lib_rend/ivas_reverb.c | 177 +- lib_rend/ivas_rom_TdBinauralRenderer.c | 3 - lib_rend/ivas_rom_binauralRenderer.c | 4 - lib_rend/ivas_rom_binaural_crend_head.c | 2 - lib_rend/ivas_rom_rend.c | 2 +- lib_rend/ivas_rotation.c | 156 +- lib_rend/ivas_stat_rend.h | 86 +- lib_rend/lib_rend.c | 842 ++--- lib_rend/lib_rend.h | 35 - lib_util/audio_file_reader.c | 46 +- lib_util/audio_file_reader.h | 10 + lib_util/audio_file_writer.c | 4 - lib_util/head_rotation_file_reader.c | 92 +- lib_util/head_rotation_file_reader.h | 18 +- lib_util/ism_file_reader.c | 47 +- lib_util/ism_file_writer.c | 19 +- lib_util/ism_file_writer.h | 2 +- lib_util/ls_custom_file_reader.c | 6 +- lib_util/ls_custom_file_reader.h | 6 +- lib_util/masa_file_writer.c | 2 - lib_util/render_config_reader.c | 9 - lib_util/vector3_pair_file_reader.c | 166 - lib_util/vector3_pair_file_reader.h | 89 - scripts/config/self_test.prm | 198 +- scripts/testv/stv16c.wav | 4 +- scripts/testv/stv16n.wav | 4 +- scripts/testv/stv1ISM48s.wav | 4 +- scripts/testv/stv1MASA1TC48c.wav | 4 +- scripts/testv/stv1MASA1TC48n.wav | 4 +- scripts/testv/stv1MASA2TC48c.wav | 4 +- scripts/testv/stv1MASA2TC48n.wav | 2 +- scripts/testv/stv2ISM48s.wav | 4 +- scripts/testv/stv2MASA1TC48c.wav | 4 +- scripts/testv/stv2MASA2TC48c.wav | 4 +- scripts/testv/stv2OA32c.wav | 4 +- scripts/testv/stv2OA48c.wav | 4 +- scripts/testv/stv32c.wav | 4 +- scripts/testv/stv32n.wav | 4 +- scripts/testv/stv3ISM48s.wav | 4 +- scripts/testv/stv3OA32c.wav | 4 +- scripts/testv/stv3OA48c.wav | 4 +- scripts/testv/stv48c.wav | 4 +- scripts/testv/stv48n.wav | 4 +- scripts/testv/stv4ISM48n.wav | 2 +- scripts/testv/stv4ISM48s.wav | 4 +- scripts/testv/stv512MC48c.wav | 4 +- scripts/testv/stv514MC48c.wav | 4 +- scripts/testv/stv51MC48c.wav | 4 +- scripts/testv/stv714MC48c.wav | 4 +- scripts/testv/stv71MC48c.wav | 4 +- scripts/testv/stv8c.wav | 4 +- scripts/testv/stv8n.wav | 4 +- scripts/testv/stvFOA16c.wav | 4 +- scripts/testv/stvFOA32c.wav | 4 +- scripts/testv/stvFOA48c.wav | 4 +- scripts/testv/stvST16c.wav | 4 +- scripts/testv/stvST16n.wav | 4 +- scripts/testv/stvST32c.wav | 4 +- scripts/testv/stvST32n.wav | 4 +- scripts/testv/stvST48c.wav | 4 +- scripts/testv/stvST48n.wav | 4 +- ...=> azi+2-ele+2-every-100-frames-Euler.csv} | 0 ...s.csv => azi+2-ele+2-every-100-frames.csv} | 0 .../azi_plus_2-ele_plus_2-every-25-rows.csv | 3000 ----------------- scripts/trajectories/const000-Vector3.csv | 4 - .../trajectories/full-circle-4s-Vector3.csv | 200 -- .../full-circle-4s-ccw-Vector3.csv | 200 -- scripts/trajectories/full-circle-4s-ccw.csv | 800 ----- scripts/trajectories/full-circle-4s.csv | 800 ----- ...ull-circle-with-up-and-down-4s-Vector3.csv | 200 -- ...circle-with-up-and-down-4s-ccw-Vector3.csv | 200 -- .../full-circle-with-up-and-down-4s-ccw.csv | 800 ----- ...p-and-down-4s-fixed-pos-offset-Vector3.csv | 200 -- .../full-circle-with-up-and-down-4s.csv | 800 ----- tests/renderer/test_renderer.py | 203 +- tests/renderer/utils.py | 43 +- 127 files changed, 3223 insertions(+), 11361 deletions(-) mode change 100755 => 100644 lib_enc/amr_wb_enc.c mode change 100755 => 100644 lib_enc/bw_detect.c mode change 100755 => 100644 lib_enc/ivas_core_pre_proc_front.c mode change 100755 => 100644 lib_enc/ivas_mdct_core_enc.c mode change 100755 => 100644 lib_enc/pre_proc.c delete mode 100644 lib_util/vector3_pair_file_reader.c delete mode 100644 lib_util/vector3_pair_file_reader.h rename scripts/trajectories/{azi_plus_2-ele_plus_2-every-100-frames-Euler.csv => azi+2-ele+2-every-100-frames-Euler.csv} (100%) rename scripts/trajectories/{azi_plus_2-ele_plus_2-every-100-frames.csv => azi+2-ele+2-every-100-frames.csv} (100%) delete mode 100644 scripts/trajectories/azi_plus_2-ele_plus_2-every-25-rows.csv delete mode 100644 scripts/trajectories/const000-Vector3.csv delete mode 100644 scripts/trajectories/full-circle-4s-Vector3.csv delete mode 100644 scripts/trajectories/full-circle-4s-ccw-Vector3.csv delete mode 100644 scripts/trajectories/full-circle-4s-ccw.csv delete mode 100644 scripts/trajectories/full-circle-4s.csv delete mode 100644 scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv delete mode 100644 scripts/trajectories/full-circle-with-up-and-down-4s-ccw-Vector3.csv delete mode 100644 scripts/trajectories/full-circle-with-up-and-down-4s-ccw.csv delete mode 100644 scripts/trajectories/full-circle-with-up-and-down-4s-fixed-pos-offset-Vector3.csv delete mode 100644 scripts/trajectories/full-circle-with-up-and-down-4s.csv diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 082cf40cab..6d00b37f0a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,13 +49,6 @@ stages: echo "Commit time was $CI_COMMIT_TIMESTAMP" date | xargs echo "System time is" -.print-common-info-windows: &print-common-info-windows - - | - echo "Printing common information for build job." - echo "Current job is run on commit $CI_COMMIT_SHA" - echo "Commit time was $CI_COMMIT_TIMESTAMP" - ("echo 'System time is'", "Get-Date -Format 'dddd dd/MM/yyyy HH:mm K'") | Invoke-Expression - .get-previous-merge-commit-sha: &get-previous-merge-commit-sha - previous_merge_commit=$(git --no-pager log --merges HEAD~1 -n 1 --pretty=format:%H) @@ -163,11 +156,6 @@ stages: tags: - ivas-linux -.build-job-windows: - stage: build - timeout: "4 minutes" - tags: - - ivas-windows # template for test jobs on linux that need the TESTV_DIR .test-job-linux-needs-testv-dir: @@ -184,12 +172,6 @@ stages: exit_codes: - 123 -.build-job-windows-with-check-for-warnings: - extends: .build-job-windows - stage: build - allow_failure: - exit_codes: - - 123 # --------------------------------------------------------------- @@ -280,31 +262,6 @@ build-codec-sanitizers-linux: - *print-common-info - bash ci/build_codec_sanitizers_linux.sh -build-codec-windows-cmake: - extends: - - .build-job-windows-with-check-for-warnings - - .rules-basis - script: - - *print-common-info-windows - - $winoutdata = $null - - cmake -G "Visual Studio 15 2017" . -Bbuild - - cmake --build build -j | tee -variable winoutdata - - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8 - - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression - - ("exit $LASTEXITCODE") | Invoke-Expression - -build-codec-windows-msbuild: - extends: - - .build-job-windows-with-check-for-warnings - - .rules-basis - script: - - *print-common-info-windows - - $winoutdata = $null - - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug | tee -variable winoutdata - - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8 - - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression - - ("exit $LASTEXITCODE") | Invoke-Expression - # --------------------------------------------------------------- # Test jobs for merge requests # --------------------------------------------------------------- diff --git a/Workspace_msvc/lib_com.vcxproj b/Workspace_msvc/lib_com.vcxproj index 23aa2ae3f0..d55896b03c 100644 --- a/Workspace_msvc/lib_com.vcxproj +++ b/Workspace_msvc/lib_com.vcxproj @@ -244,9 +244,9 @@ - + diff --git a/Workspace_msvc/lib_com.vcxproj.filters b/Workspace_msvc/lib_com.vcxproj.filters index 7b6854e718..baa1700361 100644 --- a/Workspace_msvc/lib_com.vcxproj.filters +++ b/Workspace_msvc/lib_com.vcxproj.filters @@ -379,6 +379,9 @@ common_evs_c + + common_ivas_c + common_ivas_c @@ -463,9 +466,6 @@ common_ivas_c - - common_ivas_c - diff --git a/Workspace_msvc/lib_util.vcxproj b/Workspace_msvc/lib_util.vcxproj index 5b5e5f30cc..32bebc7536 100644 --- a/Workspace_msvc/lib_util.vcxproj +++ b/Workspace_msvc/lib_util.vcxproj @@ -146,7 +146,6 @@ - @@ -168,7 +167,6 @@ - diff --git a/lib_enc/acelp_core_enc.c b/lib_enc/acelp_core_enc.c index 48cdb5c536..272d36fb9c 100644 --- a/lib_enc/acelp_core_enc.c +++ b/lib_enc/acelp_core_enc.c @@ -314,13 +314,17 @@ ivas_error acelp_core_enc( if ( st->core_brate == SID_2k40 ) { +#ifdef PARAM_ISM_DTX_CNG if ( st->hTdCngEnc != NULL ) { +#endif tmpF = cng_energy( st->element_mode, st->bwidth, st->hDtxEnc->CNG_mode, st->hTdCngEnc->CNG_att, exc, st->L_frame ); i = (int16_t) ( ( tmpF + 2.0f ) * STEP_SID ); i = min( max( i, 0 ), 127 ); st->hTdCngEnc->old_enr_index = i; +#ifdef PARAM_ISM_DTX_CNG } +#endif } } diff --git a/lib_enc/amr_wb_enc.c b/lib_enc/amr_wb_enc.c old mode 100755 new mode 100644 index 88b3faa5d6..80520d4c38 --- a/lib_enc/amr_wb_enc.c +++ b/lib_enc/amr_wb_enc.c @@ -342,12 +342,7 @@ void amr_wb_enc( * WB, SWB and FB bandwidth detector *----------------------------------------------------------------*/ - bw_detect( st, st->input, NULL, NULL -#ifdef FIX_MDCT_BASED_BWD - , - 0 -#endif - ); + bw_detect( st, st->input, NULL, NULL ); /* in AMR_WB IO, limit the maximum band-width to WB */ if ( st->bwidth > WB ) diff --git a/lib_enc/bw_detect.c b/lib_enc/bw_detect.c old mode 100755 new mode 100644 index 8ca63d28f2..5f46910c57 --- a/lib_enc/bw_detect.c +++ b/lib_enc/bw_detect.c @@ -57,9 +57,6 @@ #define BWD_COUNT_MAX 100 #define BWD_COUNT_WIDER_BW 10 -#ifdef FIX_MDCT_BASED_BWD -#define BWD_COUNT_WIDER_BW_MDCT 0 -#endif #define CLDFB_ENER_OFFSET 1.6f @@ -74,10 +71,6 @@ void bw_detect( const float signal_in[], /* i : input signal */ float *spectrum, /* i : MDCT spectrum */ const float *enerBuffer /* i : energy buffer */ -#ifdef FIX_MDCT_BASED_BWD - , - const int16_t mct_on /* i : flag MCT mode */ -#endif ) { int16_t i, j, k, bw_max, bin_width, n_bins; @@ -87,15 +80,6 @@ void bw_detect( const float *pt, *pt1; float max_NB, max_WB, max_SWB, max_FB, mean_NB, mean_WB, mean_SWB, mean_FB; int16_t cldfb_bin_width = 4; -#ifdef FIX_MDCT_BASED_BWD - int16_t bwd_count_wider_bw, l_frame; - - bwd_count_wider_bw = BWD_COUNT_WIDER_BW; - if ( st->element_mode == IVAS_CPE_MDCT && ( st->element_brate > IVAS_64k || mct_on ) ) - { - bwd_count_wider_bw = BWD_COUNT_WIDER_BW_MDCT; - } -#endif if ( st->input_Fs > 8000 ) { @@ -189,19 +173,8 @@ void bw_detect( } else { -#ifndef FIX_MDCT_BASED_BWD bin_width *= (int16_t) ( ( st->input_Fs / FRAMES_PER_SEC ) / BWD_TOTAL_WIDTH ); mvr2r( spectrum, spect, (int16_t) ( st->input_Fs / FRAMES_PER_SEC ) ); -#else - l_frame = (int16_t) ( st->input_Fs / FRAMES_PER_SEC ); - if ( st->core == TCX_10_CORE ) - { - l_frame /= 2; - } - - bin_width *= ( l_frame / BWD_TOTAL_WIDTH ); - mvr2r( spectrum, spect, l_frame ); -#endif } /*---------------------------------------------------------------------* * compute energy per spectral bins @@ -419,29 +392,17 @@ void bw_detect( /* switching to a higher BW */ if ( st->last_input_bwidth == NB ) { -#ifdef FIX_MDCT_BASED_BWD - if ( st->count_WB > bwd_count_wider_bw ) -#else if ( st->count_WB > BWD_COUNT_WIDER_BW ) -#endif { st->input_bwidth = WB; st->count_WB = BWD_COUNT_MAX; -#ifdef FIX_MDCT_BASED_BWD - if ( st->count_SWB > bwd_count_wider_bw ) -#else if ( st->count_SWB > BWD_COUNT_WIDER_BW ) -#endif { st->input_bwidth = SWB; st->count_SWB = BWD_COUNT_MAX; -#ifdef FIX_MDCT_BASED_BWD - if ( st->count_FB > bwd_count_wider_bw ) -#else if ( st->count_FB > BWD_COUNT_WIDER_BW ) -#endif { st->input_bwidth = FB; st->count_FB = BWD_COUNT_MAX; @@ -452,20 +413,12 @@ void bw_detect( if ( st->last_input_bwidth == WB && st->input_Fs > 16000 ) { -#ifdef FIX_MDCT_BASED_BWD - if ( st->count_SWB > bwd_count_wider_bw ) -#else if ( st->count_SWB > BWD_COUNT_WIDER_BW ) -#endif { st->input_bwidth = SWB; st->count_SWB = BWD_COUNT_MAX; -#ifdef FIX_MDCT_BASED_BWD - if ( st->count_FB > bwd_count_wider_bw ) -#else if ( st->count_FB > BWD_COUNT_WIDER_BW ) -#endif { st->input_bwidth = FB; st->count_FB = BWD_COUNT_MAX; @@ -475,11 +428,7 @@ void bw_detect( if ( st->last_input_bwidth == SWB && st->input_Fs > 32000 ) { -#ifdef FIX_MDCT_BASED_BWD - if ( st->count_FB > bwd_count_wider_bw ) -#else if ( st->count_FB > BWD_COUNT_WIDER_BW ) -#endif { st->input_bwidth = FB; st->count_FB = BWD_COUNT_MAX; diff --git a/lib_enc/fd_cng_enc.c b/lib_enc/fd_cng_enc.c index 70abfcbfcb..e0341e00c3 100644 --- a/lib_enc/fd_cng_enc.c +++ b/lib_enc/fd_cng_enc.c @@ -708,14 +708,18 @@ void generate_comfort_noise_enc( /* Perform STFT synthesis */ SynthesisSTFT( fftBuffer, timeDomainOutput, hFdCngCom->olapBufferSynth, hFdCngCom->olapWinSyn, tcx_transition, hFdCngCom, -1, -1 ); +#ifdef PARAM_ISM_DTX_CNG if ( st->hTdCngEnc != NULL ) { +#endif /* update CNG excitation energy for LP_CNG */ /* calculate the residual signal energy */ enr = cng_energy( st->element_mode, st->bwidth, st->hDtxEnc->CNG_mode, st->hTdCngEnc->CNG_att, hFdCngCom->exc_cng, hFdCngCom->frameSize ); st->hTdCngEnc->lp_ener = (float) ( 0.8f * st->hTdCngEnc->lp_ener + 0.2f * pow( 2.0f, enr ) ); +#ifdef PARAM_ISM_DTX_CNG } +#endif /* Overlap-add when previous frame is active */ if ( st->last_core_brate > SID_2k40 && st->codec_mode == MODE2 ) diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index 9c11420560..a2a168262d 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -61,8 +61,11 @@ ivas_error init_encoder( const int16_t idchan, /* i : channel ID */ const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ const int16_t interval_SID, /* i : interval for SID update */ - const int16_t vad_only_flag, /* i : flag to indicate front-VAD structure */ - const ISM_MODE ism_mode /* i : ISM mode */ + const int16_t vad_only_flag /* i : flag to indicate front-VAD structure */ +#ifdef PARAM_ISM_DTX_CNG + , + const ISM_MODE ism_mode /* i : ISM mode */ +#endif ) { int16_t i; @@ -479,10 +482,10 @@ ivas_error init_encoder( * LP-CNG *-----------------------------------------------------------------*/ -#ifdef DISCRETE_ISM_DTX_CNG - if ( ( ( idchan == 0 && st->Opt_DTX_ON && st->element_mode != IVAS_CPE_MDCT ) || st->element_mode == EVS_MONO ) && !( ism_mode == ISM_MODE_PARAM || ism_mode == ISM_MODE_DISC ) ) -#else +#ifdef PARAM_ISM_DTX_CNG if ( ( ( idchan == 0 && st->Opt_DTX_ON && st->element_mode != IVAS_CPE_MDCT ) || st->element_mode == EVS_MONO ) && !( ism_mode == ISM_MODE_PARAM ) ) +#else + if ( ( ( idchan == 0 && st->Opt_DTX_ON && st->element_mode != IVAS_CPE_MDCT ) || st->element_mode == EVS_MONO ) ) #endif { if ( ( st->hTdCngEnc = (TD_CNG_ENC_HANDLE) malloc( sizeof( TD_CNG_ENC_DATA ) ) ) == NULL ) @@ -882,22 +885,32 @@ void LPDmem_enc_init( return; } - - /*-----------------------------------------------------------------------* - * destroy_cldfb_encoder() + * destroy_encoder() * * Free memory which was allocated in init_encoder() *-----------------------------------------------------------------------*/ -void destroy_cldfb_encoder( +void destroy_encoder( Encoder_State *st /* i/o: Encoder static variables structure */ ) { - deleteCldfb( &st->cldfbSynTd ); - deleteCldfb( &st->cldfbAnaEnc ); + if ( st->cldfbSynTd != NULL ) + { + deleteCldfb( &st->cldfbSynTd ); + } + + if ( st->cldfbAnaEnc != NULL ) + { + deleteCldfb( &st->cldfbAnaEnc ); + } + + if ( st->hFdCngEnc != NULL ) + { + deleteFdCngEnc( &st->hFdCngEnc ); + } - deleteFdCngEnc( &st->hFdCngEnc ); + /* Close Core */ return; } diff --git a/lib_enc/ivas_agc_enc.c b/lib_enc/ivas_agc_enc.c index 83dbdad1e1..f98c22b97e 100644 --- a/lib_enc/ivas_agc_enc.c +++ b/lib_enc/ivas_agc_enc.c @@ -195,24 +195,22 @@ void ivas_spar_agc_enc_close( { ivas_agc_enc_state_t *hAgc; - if ( hAgcEnc == NULL || *hAgcEnc == NULL ) - { - return; - } - hAgc = *hAgcEnc; - free( hAgc->agc_com.winFunc ); - hAgc->agc_com.winFunc = NULL; + if ( hAgc != NULL ) + { + free( hAgc->agc_com.winFunc ); + hAgc->agc_com.winFunc = NULL; - free( hAgc->gain_state ); - hAgc->gain_state = NULL; + free( hAgc->gain_state ); + hAgc->gain_state = NULL; - free( hAgc->gain_data ); - hAgc->gain_data = NULL; + free( hAgc->gain_data ); + hAgc->gain_data = NULL; - free( *hAgcEnc ); - *hAgcEnc = NULL; + free( hAgc ); + hAgc = NULL; + } return; } diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 040a8469c5..d4e5e6c686 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -471,8 +471,6 @@ ivas_error ivas_core_enc( dbgwrite( &st->sp_aud_decision1, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "sp_aud_decision1", n, id, ENC ) ); dbgwrite( &st->sp_aud_decision2, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "sp_aud_decision2", n, id, ENC ) ); - dbgwrite( &st->lp_noise, sizeof( float ), 1, input_frame, fname( debug_dir, "lp_noise", n, id, ENC ) ); - #if ( defined DEBUG_MODE_ACELP ) || ( defined DEBUG_MODE_TCX ) if ( st->coder_type == INACTIVE || st->coder_type == UNVOICED ) { diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c old mode 100755 new mode 100644 index 85eba72f00..000fbab33e --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -107,7 +107,12 @@ ivas_error pre_proc_front_ivas( const int16_t front_vad_flag, /* i : front-VAD flag to overwrite VAD decision */ const int16_t force_front_vad, /* i : flag to force VAD decision */ const int16_t front_vad_dtx_flag, /* i : front-VAD DTX flag to overwrite VAD decision*/ - const int32_t ivas_total_brate /* i : IVAS total bitrate - for setting the DTX */ +#ifdef LOW_RATE_TRANS_CORE_CODER + const int32_t ivas_total_brate /* i : IVAS total bitrate - for setting the DTX */ +#else + const int32_t ivas_total_brate, /* i : IVAS total bitrate - for setting the DTX */ + const int16_t ivas_format /* i : IVAS format */ +#endif ) { @@ -486,12 +491,7 @@ ivas_error pre_proc_front_ivas( if ( st->idchan == 0 && element_mode != IVAS_CPE_MDCT ) { - bw_detect( st, st->input, NULL, enerBuffer -#ifdef FIX_MDCT_BASED_BWD - , - 0 -#endif - ); + bw_detect( st, st->input, NULL, enerBuffer ); } if ( element_mode != IVAS_CPE_MDCT ) /* in MDCT stereo, set_bw_stereo() is used instead */ @@ -811,7 +811,11 @@ ivas_error pre_proc_front_ivas( } } /* Switch to ACELP for non-harmonic transient signals */ +#ifdef LOW_RATE_TRANS_CORE_CODER else if ( ( ( element_mode >= IVAS_CPE_DFT && element_brate <= IVAS_16k4 ) || ( element_mode == IVAS_SCE && element_brate < SCE_SMC_THR ) ) && ( loc_harm[0] != 1 ) && smc_dec == MUSIC ) +#else + else if ( ( ( ivas_format == STEREO_FORMAT && element_brate <= IVAS_16k4 ) || ( ivas_format == ISM_FORMAT && element_brate < SCE_SMC_THR ) ) && ( loc_harm[0] != 1 ) && smc_dec == MUSIC ) +#endif { if ( element_mode == IVAS_SCE ) { diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index 74c27f4bff..18d7f06e0e 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -300,7 +300,8 @@ ivas_error ivas_corecoder_enc_reconfig( if ( st_ivas->nCPE <= 1 && st_ivas->hMCT != NULL ) { - ivas_mct_enc_close( &( st_ivas->hMCT ) ); + ivas_mct_enc_close( st_ivas->hMCT ); + st_ivas->hMCT = NULL; } /* special case, if we have MCT now and had a single CPE before, remove the MDCT Stereo handles */ diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index a62f2efbe2..054804372b 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -429,11 +429,19 @@ ivas_error ivas_cpe_enc( for ( n = 0; n < n_CoreChannels; n++ ) { +#ifdef LOW_RATE_TRANS_CORE_CODER error = pre_proc_front_ivas( NULL, hCPE, hCPE->element_brate, nb_bits_metadata, input_frame, n, old_inp_12k8[n], old_inp_16k[n], &ener[n], &relE[n], A[n], Aw[n], epsP[n], lsp_new[n], lsp_mid[n], &vad_hover_flag[n], &attack_flag[n], realBuffer[n], imagBuffer[n], old_wsp[n], pitch_fr[n], voicing_fr[n], &loc_harm[n], &cor_map_sum[n], &vad_flag_dtx[n], enerBuffer[n], fft_buff[n], A[0], lsp_new[0], currFlatness[n], tdm_ratio_idx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, band_energies_LR, 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0, ivas_total_brate ); +#else + error = pre_proc_front_ivas( NULL, hCPE, hCPE->element_brate, nb_bits_metadata, input_frame, n, old_inp_12k8[n], old_inp_16k[n], + &ener[n], &relE[n], A[n], Aw[n], epsP[n], lsp_new[n], lsp_mid[n], + &vad_hover_flag[n], &attack_flag[n], realBuffer[n], imagBuffer[n], old_wsp[n], pitch_fr[n], voicing_fr[n], &loc_harm[n], &cor_map_sum[n], &vad_flag_dtx[n], enerBuffer[n], + fft_buff[n], A[0], lsp_new[0], currFlatness[n], tdm_ratio_idx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, band_energies_LR, 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0, + ivas_total_brate, st_ivas->hEncoderConfig->ivas_format ); +#endif if ( error != IVAS_ERR_OK ) { return error; @@ -845,11 +853,17 @@ ivas_error create_cpe_enc( st->mct_chan_mode = MCT_CHAN_MODE_LFE; } +#ifdef PARAM_ISM_DTX_CNG if ( ( error = init_encoder( st, #ifdef IND_LIST_DYN hEncoderConfig, #endif n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) +#else + if ( ( error = init_encoder( st, +#ifdef IND_LIST_DYN + hEncoderConfig, +#endif n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0 ) ) != IVAS_ERR_OK ) #endif { diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index b894932958..7b4685251f 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -114,7 +114,7 @@ void ivas_decision_matrix_enc( if ( st->element_mode == IVAS_SCE && st->low_rate_mode ) { - /* ISM low-rate mode */ + /* ISm low-rate mode */ st->core = ACELP_CORE; st->coder_type = INACTIVE; } @@ -391,7 +391,7 @@ void ivas_signaling_enc( } else if ( st->element_mode == IVAS_SCE && st->low_rate_mode ) { - /* ISM Low-rate mode -> do nothing -> always WB, ACELP core, IC coder_type */ + /* ISm Low-rate mode -> do nothing -> always WB, ACELP core, IC coder_type */ } else if ( ( st->element_mode == IVAS_CPE_MDCT && st->idchan == 1 ) || st->core_brate <= SID_2k40 ) { diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index 43bc94fb04..a143ff37d2 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -104,7 +104,11 @@ ivas_error ivas_dirac_enc_open( return error; } /* Allocate and initialize FB mixer handle */ +#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), input_Fs, fb_cfg, 0 ) ) != IVAS_ERR_OK ) +#else + if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -245,27 +249,23 @@ ivas_error ivas_dirac_enc_reconfigure( /*------------------------------------------------------------------------- * ivas_dirac_enc_close() * - * Close DirAC encoder handle + * Close DirAC *------------------------------------------------------------------------*/ void ivas_dirac_enc_close( - DIRAC_ENC_HANDLE *hDirAC_out, /* i/o: encoder DirAC handle */ - const int32_t input_Fs /* i : input sampling rate */ + DIRAC_ENC_HANDLE hDirAC, /* i/o: encoder DirAC handle */ + const int32_t input_Fs /* i : input sampling rate */ ) { int16_t i, j; - DIRAC_ENC_HANDLE hDirAC; - - if ( hDirAC_out == NULL || *hDirAC_out == NULL ) - { - return; - } - - hDirAC = *hDirAC_out; if ( hDirAC->hFbMixer != NULL ) { +#ifdef SBA_BR_SWITCHING_CLEAN_UP ivas_FB_mixer_close( &hDirAC->hFbMixer, input_Fs, 0 ); +#else + ivas_FB_mixer_close( &hDirAC->hFbMixer, input_Fs ); +#endif } for ( i = 0; i < DIRAC_MAX_ANA_CHANS; i++ ) @@ -311,8 +311,7 @@ void ivas_dirac_enc_close( hDirAC->hConfig = NULL; } - free( *hDirAC_out ); - *hDirAC_out = NULL; + free( hDirAC ); return; } diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 1e4ba82207..0500a8e775 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -132,11 +132,14 @@ ivas_error ivas_enc( /* bypass EVS coding in float precision, emulating EVS encoder/decoder delay */ for ( i = 0; i < n; i++ ) { +#ifdef SBA_HPF_TUNING_ENC if ( ( ivas_format == SBA_FORMAT ) && ( st_ivas->sba_mode == SBA_MODE_SPAR ) ) { hp20( data_f[HOA_keep_ind[i]], input_frame, st_ivas->mem_hp20_in[i], input_Fs ); } - else if ( !( ivas_format == MC_FORMAT && i == LFE_CHANNEL ) ) /*TODO: is the HPF needed for LFE channel? */ + else +#endif + if ( !( ivas_format == MC_FORMAT && i == LFE_CHANNEL ) ) /*TODO: is the HPF needed for LFE channel? */ { hp20( data_f[i], input_frame, st_ivas->mem_hp20_in[i], input_Fs ); } diff --git a/lib_enc/ivas_enc_cov_handler.c b/lib_enc/ivas_enc_cov_handler.c index e117cfc5a5..b70c05e962 100644 --- a/lib_enc/ivas_enc_cov_handler.c +++ b/lib_enc/ivas_enc_cov_handler.c @@ -117,19 +117,17 @@ void ivas_spar_covar_enc_close( { ivas_enc_cov_handler_state_t *hCovState; - if ( hCovEnc == NULL || *hCovEnc == NULL ) - { - return; - } - hCovState = *hCovEnc; - ivas_spar_covar_smooth_enc_close( &hCovState->pCov_state, nchan_inp ); + if ( hCovState != NULL ) + { + ivas_spar_covar_smooth_enc_close( &hCovState->pCov_state, nchan_inp ); - ivas_spar_covar_smooth_enc_close( &hCovState->pCov_dtx_state, nchan_inp ); + ivas_spar_covar_smooth_enc_close( &hCovState->pCov_dtx_state, nchan_inp ); - free( *hCovEnc ); - *hCovEnc = NULL; + free( hCovState ); + hCovState = NULL; + } return; } @@ -152,7 +150,12 @@ void ivas_enc_cov_handler_process( const int16_t end_band, const int16_t num_ch, const int16_t dtx_vad, - const int16_t transient_det[2] ) +#ifdef SMOOTH_WITH_TRANS_DET + const int16_t transient_det[2] +#else + const int16_t transient_det +#endif +) { int16_t i, j; int16_t dtx_cov_flag; @@ -215,7 +218,11 @@ void ivas_enc_cov_handler_process( } else { +#ifdef SMOOTH_WITH_TRANS_DET if ( ( transient_det[0] == 0 ) && ( transient_det[1] == 0 ) ) +#else + if ( transient_det == 0 ) +#endif { ivas_cov_smooth_process( hCovEnc->pCov_dtx_state, cov_dtx_real, pFb, start_band, end_band, num_ch, transient_det ); hCovEnc->prior_dtx_present = 1; diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index e0713950ca..9af3c7e8a8 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -184,7 +184,11 @@ int16_t getNumChanAnalysis( n = st_ivas->nSCE + CPE_CHANNELS * st_ivas->nCPE; if ( st_ivas->hEncoderConfig->ivas_format == SBA_FORMAT ) { +#ifdef SBA_HPF_TUNING_ENC n = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order ); +#else + n = DIRAC_MAX_ANA_CHANS; +#endif } else if ( st_ivas->hEncoderConfig->ivas_format == MC_FORMAT && ( st_ivas->mc_mode == MC_MODE_PARAMMC || st_ivas->mc_mode == MC_MODE_MCMASA ) ) { @@ -266,14 +270,16 @@ void ivas_initialize_handles_enc( st_ivas->mem_hp20_in = NULL; - /* ISM metadata handles */ + /* ISm metadata handles */ for ( i = 0; i < MAX_NUM_OBJECTS; i++ ) { st_ivas->hIsmMetaData[i] = NULL; } +#ifdef PARAM_ISM_DTX_CNG /* ISM DTX handle */ st_ivas->hISMDTX = NULL; +#endif /* Q Metadata handle */ st_ivas->hQMetaData = NULL; @@ -446,17 +452,15 @@ ivas_error ivas_init_encoder( } } -#ifdef DISCRETE_ISM_DTX_CNG - if ( st_ivas->hEncoderConfig->Opt_DTX_ON ) -#else +#ifdef PARAM_ISM_DTX_CNG if ( st_ivas->hEncoderConfig->Opt_DTX_ON && st_ivas->ism_mode == ISM_MODE_PARAM ) -#endif { if ( ( error = ivas_ism_dtx_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } } +#endif } else if ( ivas_format == SBA_FORMAT || ivas_format == MASA_FORMAT ) { @@ -473,7 +477,11 @@ ivas_error ivas_init_encoder( if ( st_ivas->sba_mode == SBA_MODE_SPAR ) { +#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_spar_enc_open( st_ivas, 0 ) ) != IVAS_ERR_OK ) +#else + if ( ( error = ivas_spar_enc_open( st_ivas ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -767,7 +775,7 @@ void destroy_core_enc( ENC_CORE_HANDLE hCoreCoder /* i/o: core encoder structure */ ) { - destroy_cldfb_encoder( hCoreCoder ); + destroy_encoder( hCoreCoder ); if ( hCoreCoder->hSignalBuf != NULL ) { @@ -966,52 +974,97 @@ void ivas_destroy_enc( } /* ISM metadata handles */ - ivas_ism_metadata_close( st_ivas->hIsmMetaData ); + for ( n = 0; n < MAX_NUM_OBJECTS; n++ ) + { + if ( st_ivas->hIsmMetaData[n] != NULL ) + { + free( st_ivas->hIsmMetaData[n] ); + st_ivas->hIsmMetaData[n] = NULL; + } + } +#ifdef PARAM_ISM_DTX_CNG /* ISM DTX Handle */ if ( st_ivas->hISMDTX != NULL ) { free( st_ivas->hISMDTX ); st_ivas->hISMDTX = NULL; } +#endif /* Q Metadata handle */ ivas_qmetadata_close( &( st_ivas->hQMetaData ) ); /* DirAC handle */ - if ( ivas_format == ISM_FORMAT ) - { - ivas_param_ism_enc_close( &( st_ivas->hDirAC ), st_ivas->hEncoderConfig->input_Fs ); - } - else + if ( st_ivas->hDirAC != NULL ) { - ivas_dirac_enc_close( &( st_ivas->hDirAC ), st_ivas->hEncoderConfig->input_Fs ); + if ( ivas_format == ISM_FORMAT ) + { + ivas_param_ism_enc_close( st_ivas->hDirAC, st_ivas->hEncoderConfig->input_Fs ); + } + else + { + ivas_dirac_enc_close( st_ivas->hDirAC, st_ivas->hEncoderConfig->input_Fs ); + } + st_ivas->hDirAC = NULL; } /* SPAR handle */ - ivas_spar_enc_close( &( st_ivas->hSpar ), st_ivas->hEncoderConfig->input_Fs, nchan_inp, 0 ); + if ( st_ivas->hSpar != NULL ) + { +#ifdef SBA_BR_SWITCHING_CLEAN_UP + ivas_spar_enc_close( st_ivas->hSpar, st_ivas->hEncoderConfig->input_Fs, nchan_inp, 0 ); +#else + ivas_spar_enc_close( st_ivas->hSpar, st_ivas->hEncoderConfig->input_Fs, nchan_inp ); +#endif + st_ivas->hSpar = NULL; + } /* MASA handle */ + if ( st_ivas->hMasa != NULL ) + { #ifdef FIX_350_MASA_DELAY_COMP - ivas_masa_enc_close( &( st_ivas->hMasa ) ); + ivas_masa_enc_close( st_ivas->hMasa ); #else - ivas_masa_enc_close( &( st_ivas->hMasa ), st_ivas->nchan_transport, ivas_format ); + ivas_masa_enc_close( st_ivas->hMasa, st_ivas->nchan_transport, ivas_format ); #endif + st_ivas->hMasa = NULL; + } /* MCT handle */ - ivas_mct_enc_close( &( st_ivas->hMCT ) ); - - /* LFE handle */ - ivas_lfe_enc_close( &( st_ivas->hLFE ) ); + if ( st_ivas->hMCT != NULL ) + { + ivas_mct_enc_close( st_ivas->hMCT ); + st_ivas->hMCT = NULL; + } /* Parametric MC handle */ - ivas_param_mc_enc_close( &( st_ivas->hParamMC ), st_ivas->hEncoderConfig->input_Fs ); + if ( st_ivas->hParamMC != NULL ) + { + ivas_param_mc_enc_close( st_ivas->hParamMC, st_ivas->hEncoderConfig->input_Fs ); + st_ivas->hParamMC = NULL; + } /* Multi-channel MASA handle */ - ivas_mcmasa_enc_close( &( st_ivas->hMcMasa ), st_ivas->hEncoderConfig->input_Fs ); + if ( st_ivas->hMcMasa != NULL ) + { + ivas_mcmasa_enc_close( st_ivas->hMcMasa, st_ivas->hEncoderConfig->input_Fs ); + st_ivas->hMcMasa = NULL; + } /* Stereo downmix for EVS encoder handle */ - stereo_dmx_evs_close_encoder( &( st_ivas->hStereoDmxEVS ) ); + if ( st_ivas->hStereoDmxEVS != NULL ) + { + stereo_dmx_evs_close_encoder( st_ivas->hStereoDmxEVS ); + st_ivas->hStereoDmxEVS = NULL; + } + + /* LFE handle */ + if ( st_ivas->hLFE != NULL ) + { + ivas_lfe_enc_close( st_ivas->hLFE ); + st_ivas->hLFE = NULL; + } /* Encoder configuration handle */ if ( st_ivas->hEncoderConfig != NULL ) diff --git a/lib_enc/ivas_ism_dtx_enc.c b/lib_enc/ivas_ism_dtx_enc.c index 0bd1411424..bc8134f365 100644 --- a/lib_enc/ivas_ism_dtx_enc.c +++ b/lib_enc/ivas_ism_dtx_enc.c @@ -41,16 +41,7 @@ #endif #include "wmc_auto.h" - -#ifdef DISCRETE_ISM_DTX_CNG -/*-----------------------------------------------------------------------* - * Local constants - *-----------------------------------------------------------------------*/ - -#define MD_MAX_DIFF_AZIMUTH 10 -#define MD_MAX_DIFF_ELEVATION 10 -#endif - +#ifdef PARAM_ISM_DTX_CNG /*-------------------------------------------------------------------* * ivas_ism_dtx_open() @@ -76,11 +67,8 @@ ivas_error ivas_ism_dtx_open( hISMDTX->dtx_flag = 0; hISMDTX->sce_id_dtx = 0; -#ifdef DISCRETE_ISM_DTX_CNG - hISMDTX->cnt_SID_ISM = -1; -#else + set_s( hISMDTX->dtx_speech_buffer_enc, 0, PARAM_ISM_HYS_BUF_SIZE ); -#endif for ( i = 0; i < MAX_NUM_OBJECTS; i++ ) { @@ -95,209 +83,6 @@ ivas_error ivas_ism_dtx_open( } -#ifdef DISCRETE_ISM_DTX_CNG -/*-------------------------------------------------------------------* - * ivas_ism_get_dtx_enc() - * - * Analysis and decision about DTX in ISM format - *-------------------------------------------------------------------*/ - -/*! r: indication of DTX frame */ -int16_t ivas_ism_dtx_enc( - ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ - SCE_ENC_HANDLE hSCE[MAX_SCE], /* i/o: SCE encoder structure */ - const int32_t ivas_total_brate, /* i : IVAS total bitrate */ - const int16_t nchan_ism, /* i : number of objects */ - const int16_t nchan_transport, /* i : number of transport channels */ - int16_t vad_flag[MAX_NUM_OBJECTS], /* i : VAD flag */ - ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ - int16_t md_diff_flag[], /* o : metadata differential flag */ - int16_t *sid_flag /* o : indication of SID frame */ -) -{ - int16_t ch, dtx_flag; - int16_t nBits, nBits_MD_max; - int16_t nBits_azimuth, nBits_elevation, nBits_coh, nBits_sce_id; - float lp_noise[MAX_NUM_OBJECTS], lp_noise_variation, lp_noise_mean; - float lp_noise_max; - float tmp1, tmp2; - - /* initialization */ - for ( ch = 0; ch < nchan_transport; ch++ ) - { - hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; - } - - /*------------------------------------------------------------------* - * compute global ISM DTX flag - *-----------------------------------------------------------------*/ - - /* compute global ISM based on localVAD */ - dtx_flag = 1; - for ( ch = 0; ch < nchan_transport; ch++ ) - { - dtx_flag &= !vad_flag[ch]; - } - - /* compute global ISM based on long-term background noise */ - /* one of the channels is active -> no DTX */ - for ( ch = 0; ch < nchan_transport; ch++ ) - { - lp_noise[ch] = hSCE[ch]->hCoreCoder[0]->lp_noise; - } - - lp_noise_variation = var( lp_noise, nchan_transport ); - lp_noise_mean = mean( lp_noise, nchan_transport ); - - if ( lp_noise_mean > 50 || ( lp_noise_mean > 25 && lp_noise_variation > 32 ) ) - { - dtx_flag = 0; - } - - - /* default DTX is applied at lower bitrates; otherwise DTX is applied only in silence */ - maximum( lp_noise, nchan_transport, &lp_noise_max ); - - if ( !( ( nchan_ism == 1 && ivas_total_brate <= IVAS_24k4 ) || - ( nchan_ism == 2 && ivas_total_brate <= IVAS_48k ) || - ( nchan_ism == 3 && ivas_total_brate <= IVAS_80k ) || - ( nchan_ism == 4 && ivas_total_brate <= IVAS_96k ) || - lp_noise_max < 15 ) ) - { - dtx_flag = 0; - } - - /*------------------------------------------------------------------* - * Reset the bitstream - *-----------------------------------------------------------------*/ - - if ( dtx_flag ) - { - /* reset the bitstream (IVAS format signaling was already written) */ - reset_indices_enc( hSCE[0]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); - } - - /*------------------------------------------------------------------* - * decide about SID metadata to be sent or not (per object) - * estimate the MD bit-budget consumption - *-----------------------------------------------------------------*/ - - if ( dtx_flag ) - { - ivas_get_ism_sid_quan_bitbudget( nchan_ism, &nBits_azimuth, &nBits_elevation, &tmp1, &tmp2, &nBits_coh, &nBits_sce_id ); - - nBits = 0; - for ( ch = 0; ch < nchan_ism; ch++ ) - { - /* check difference between current and last metadata */ - md_diff_flag[ch] = 0; - if ( fabsf( hIsmMeta[ch]->azimuth - hIsmMeta[ch]->last_azimuth ) > MD_MAX_DIFF_AZIMUTH ) - { - md_diff_flag[ch] = 1; - } - - if ( fabsf( hIsmMeta[ch]->elevation - hIsmMeta[ch]->last_elevation ) > MD_MAX_DIFF_ELEVATION ) - { - md_diff_flag[ch] = 1; - } - - /* estimate SID metadata bit-budget */ - nBits++; /* number of objects */ - nBits++; /* SID metadata flag */ - if ( md_diff_flag[ch] == 1 ) - { - nBits += nBits_azimuth; - nBits += nBits_elevation; - } - } - - /* calculate maximum available MD bit-budget */ - nBits_MD_max = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC; - nBits_MD_max -= SID_FORMAT_NBITS; - if ( nchan_transport > 1 ) - { - nBits_MD_max -= nBits_sce_id; - } - - for ( ch = 0; ch < nchan_transport - 1; ch++ ) - { - nBits_MD_max -= nBits_coh; /* coherence */ - } - - if ( nchan_ism > 3 ) - { - nBits_MD_max--; /* ism_mode flag */ - } - - /* too many metadata bits -> switch to active coding */ - if ( nBits > nBits_MD_max ) - { - dtx_flag = 0; - } - } - - /*------------------------------------------------------------------* - * set core_brate for all channels - * get 'sid_flag' value - *-----------------------------------------------------------------*/ - - *sid_flag = 0; - - if ( !dtx_flag ) - { - /* at least one of the channels is active -> no DTX */ - for ( ch = 0; ch < nchan_transport; ch++ ) - { - hSCE[ch]->hCoreCoder[0]->core_brate = -1; - set_bw( IVAS_SCE, hSCE[ch]->element_brate, hSCE[ch]->hCoreCoder[0], MODE1 ); - } - - hISMDTX->cnt_SID_ISM = -1; - - /* IVAS format signaling was erased in dtx() */ - if ( hSCE[0]->hCoreCoder[0]->hBstr->nb_bits_tot == 0 ) - { - /* replicate ivas_write_format() */ - push_indice( hSCE[0]->hCoreCoder[0]->hBstr, IND_IVAS_FORMAT, 2 /* == ISM format */, IVAS_FORMAT_SIGNALING_NBITS ); - } - } - else /* ism_dtx_flag == 1 */ - { - for ( ch = 0; ch < nchan_transport; ch++ ) - { - hSCE[ch]->hCoreCoder[0]->cng_type = FD_CNG; - } - - /* * update the global SID counter */ - hISMDTX->cnt_SID_ISM++; - if ( hISMDTX->cnt_SID_ISM >= hSCE[0]->hCoreCoder[0]->hDtxEnc->max_SID ) - { - /* adaptive SID update interval */ - hSCE[0]->hCoreCoder[0]->hDtxEnc->max_SID = hSCE[0]->hCoreCoder[0]->hDtxEnc->interval_SID; - hISMDTX->cnt_SID_ISM = 0; - } - - /* encode SID in one channel only */ - for ( ch = 0; ch < nchan_transport; ch++ ) - { - hSCE[ch]->hCoreCoder[0]->core_brate = FRAME_NO_DATA; - } - - if ( hISMDTX->cnt_SID_ISM == 0 ) - { - hSCE[hISMDTX->sce_id_dtx]->hCoreCoder[0]->core_brate = SID_2k40; - *sid_flag = 1; - } - } - - if ( dtx_flag == 1 && *sid_flag == 0 ) - { - set_s( md_diff_flag, 0, nchan_transport ); - } - - return dtx_flag; -} -#else /*-------------------------------------------------------------------* * ivas_ism_dtx_enc() * @@ -438,7 +223,7 @@ int16_t ivas_ism_dtx_enc( return dtx_flag; } -#endif + /*-------------------------------------------------------------------* * ivas_ism_get_sce_id_dtx() @@ -510,11 +295,7 @@ void ivas_ism_coh_estim_dtx_enc( { Encoder_State *st, *st_id0; int16_t sce_id, i; -#ifdef DISCRETE_ISM_DTX_CNG - float acorr_ene[MAX_NUM_OBJECTS], xcorr_ene; -#else float acorr_ene[PARAM_ISM_MAX_DMX], xcorr_ene; -#endif if ( nchan_transport == 1 ) { @@ -558,3 +339,4 @@ void ivas_ism_coh_estim_dtx_enc( return; } +#endif diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 25ce78ff2e..85b8e0c4aa 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -85,16 +85,9 @@ ivas_error ivas_ism_enc( float Etot_LR[1]; /* total energy; correlation shift */ float lf_E[1][2 * VOIC_BINS]; /* per bin spectrum energy in lf */ int16_t localVAD_HE_SAD[1]; /* local HE VAD */ -#ifdef DISCRETE_ISM_DTX_CNG - int16_t nchan_ism, dtx_flag, sid_flag, flag_noisy_speech; - int16_t md_diff_flag[MAX_NUM_OBJECTS]; -#else -#ifdef NCHAN_ISM_PARAMETER - int16_t nchan_ism, dtx_flag, sid_flag; -#else - int16_t dtx_flag, sid_flag, flag_noisy_speech; -#endif int16_t i, nBits; +#ifdef PARAM_ISM_DTX_CNG + int16_t dtx_flag, sid_flag; #endif ivas_error error; @@ -106,27 +99,10 @@ ivas_error ivas_ism_enc( error = IVAS_ERR_OK; +#ifdef PARAM_ISM_DTX_CNG dtx_flag = 0; sid_flag = 0; -#if ( !defined NCHAN_ISM_PARAMETER || defined DISCRETE_ISM_DTX_CNG ) - flag_noisy_speech = 0; -#endif - -#ifdef NCHAN_ISM_PARAMETER - nchan_ism = st_ivas->hEncoderConfig->nchan_ism; -#else -#ifdef DISCRETE_ISM_DTX_CNG - if ( st_ivas->ism_mode == ISM_MODE_PARAM ) - { - nchan_ism = st_ivas->hDirAC->hParamIsm->num_obj; - } - else /* ism_mode == ISM_MODE_DISC */ - { - nchan_ism = st_ivas->nchan_transport; - } -#endif #endif - set_s( md_diff_flag, 1, nchan_ism ); /*------------------------------------------------------------------* * Preprocesing @@ -182,47 +158,39 @@ ivas_error ivas_ism_enc( * Front Pre-processing *----------------------------------------------------------------*/ +#ifdef LOW_RATE_TRANS_CORE_CODER error = pre_proc_front_ivas( hSCE, NULL, hSCE->element_brate, nb_bits_metadata[sce_id], input_frame, 0, old_inp_12k8[sce_id][0], old_inp_16k[sce_id][0], &ener[sce_id][0], &relE[sce_id][0], A[sce_id][0], Aw[sce_id][0], epsP[sce_id][0], lsp_new[sce_id][0], lsp_mid[sce_id][0], &vad_hover_flag[sce_id][0], &attack_flag[sce_id][0], realBuffer[sce_id][0], imagBuffer[sce_id][0], old_wsp[sce_id][0], pitch_fr[sce_id][0], voicing_fr[sce_id][0], &loc_harm[sce_id][0], &cor_map_sum[sce_id][0], &vad_flag_dtx[sce_id][0], enerBuffer[sce_id][0], fft_buff[sce_id][0], A[sce_id][0], lsp_new[sce_id][0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, 0, 0, 0, 0, st_ivas->hEncoderConfig->ivas_total_brate ); +#else + error = pre_proc_front_ivas( hSCE, NULL, hSCE->element_brate, nb_bits_metadata[sce_id], input_frame, 0, old_inp_12k8[sce_id][0], old_inp_16k[sce_id][0], + &ener[sce_id][0], &relE[sce_id][0], A[sce_id][0], Aw[sce_id][0], epsP[sce_id][0], lsp_new[sce_id][0], lsp_mid[sce_id][0], + &vad_hover_flag[sce_id][0], &attack_flag[sce_id][0], realBuffer[sce_id][0], imagBuffer[sce_id][0], old_wsp[sce_id][0], pitch_fr[sce_id][0], voicing_fr[sce_id][0], &loc_harm[sce_id][0], &cor_map_sum[sce_id][0], &vad_flag_dtx[sce_id][0], enerBuffer[sce_id][0], + fft_buff[sce_id][0], A[sce_id][0], lsp_new[sce_id][0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, 0, 0, 0, 0, + st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->hEncoderConfig->ivas_format ); +#endif if ( error != IVAS_ERR_OK ) { return error; } -#ifdef DISCRETE_ISM_DTX_CNG - if ( st_ivas->hEncoderConfig->Opt_DTX_ON ) - { - vad_flag[sce_id] = vad_flag_dtx[sce_id][0]; - } - else -#endif - { - vad_flag[sce_id] = st->vad_flag; - } + vad_flag[sce_id] = st->vad_flag; } +#ifdef PARAM_ISM_DTX_CNG /*------------------------------------------------------------------* * DTX analysis *-----------------------------------------------------------------*/ -#ifdef DISCRETE_ISM_DTX_CNG - if ( st_ivas->hEncoderConfig->Opt_DTX_ON ) -#else if ( st_ivas->hEncoderConfig->Opt_DTX_ON && st_ivas->ism_mode == ISM_MODE_PARAM ) -#endif { /* compute the dominant sce_id using long term energy */ ivas_ism_get_sce_id_dtx( st_ivas->hISMDTX, st_ivas->hSCE, st_ivas->nchan_transport, input_frame ); /* analysis and decision about DTX */ -#ifdef DISCRETE_ISM_DTX_CNG - dtx_flag = ivas_ism_dtx_enc( st_ivas->hISMDTX, st_ivas->hSCE, st_ivas->hEncoderConfig->ivas_total_brate, nchan_ism, st_ivas->nchan_transport, vad_flag, st_ivas->hIsmMetaData, md_diff_flag, &sid_flag ); -#else dtx_flag = ivas_ism_dtx_enc( st_ivas, &sid_flag ); -#endif if ( sid_flag ) { @@ -231,96 +199,85 @@ ivas_error ivas_ism_enc( } #ifdef DEBUG_MODE_PARAM_ISM - if ( st_ivas->hDirAC != NULL ) - dbgwrite( &( st_ivas->hDirAC->hParamIsm->flag_noisy_speech ), sizeof( int16_t ), 1, 1, "./res/ParamISM_noisy_speech_flag_enc.dat" ); + dbgwrite( &( st_ivas->hISMDTX->flag_noisy_speech ), sizeof( int16_t ), 1, 1, "./res/ParamISM_noisy_speech_flag_enc.dat" ); dbgwrite( &( st_ivas->hISMDTX->dtx_flag ), sizeof( int16_t ), 1, 1, "./res/ParamISM_DTX_CNG_flag_enc.dat" ); - dbgwrite( &( st_ivas->hISMDTX->sce_id_dtx ), sizeof( int16_t ), 1, input_frame, "./res/sce_id_dtx" ); - dbgwrite( &( dtx_flag ), sizeof( int16_t ), 1, input_frame, "./res/dtx_flag" ); #endif } +#endif /*------------------------------------------------------------------* * Analysis of objects, configuration and decision about bitrates per channel * Metadata quantization and encoding *-----------------------------------------------------------------*/ +#ifdef PARAM_ISM_DTX_CNG if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { ivas_param_ism_compute_noisy_speech_flag( st_ivas ); -#ifdef DISCRETE_ISM_DTX_CNG - flag_noisy_speech = st_ivas->hDirAC->hParamIsm->flag_noisy_speech; -#endif } if ( dtx_flag ) { -#ifdef DISCRETE_ISM_DTX_CNG - ivas_ism_metadata_sid_enc( st_ivas->hISMDTX, flag_noisy_speech, nchan_ism, st_ivas->nchan_transport, st_ivas->ism_mode, st_ivas->hIsmMetaData, sid_flag, md_diff_flag, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata ); -#else if ( sid_flag ) { -#ifdef NCHAN_ISM_PARAMETER - ivas_param_ism_metadata_dtx_enc( st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, st_ivas->hIsmMetaData, st_ivas->hISMDTX, st_ivas->hDirAC->hParamIsm, nchan_ism ); -#else ivas_param_ism_metadata_dtx_enc( st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, st_ivas->hIsmMetaData, st_ivas->hISMDTX, st_ivas->hDirAC->hParamIsm ); -#endif } -#endif } - else if ( st_ivas->ism_mode == ISM_MODE_PARAM ) - { - // VE: call ivas_ism_metadata_enc() with 'st_ivas' - TBD -#ifdef TD5 - ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, -#ifdef NCHAN_ISM_PARAMETER - nchan_ism, + else #endif - st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm, st_ivas->hEncoderConfig->ism_extended_metadata_flag ); -#else - ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, -#ifdef NCHAN_ISM_PARAMETER - nchan_ism, -#endif - st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm ); + if ( st_ivas->ism_mode == ISM_MODE_PARAM ) + { +#ifndef PARAM_ISM_DTX_CNG + /* Move the Noisy speech buffer */ + for ( i = 0; i < ( PARAM_ISM_HYS_BUF_SIZE - 1 ); i++ ) + { + st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i + 1]; + } + + /* For the current frame, make a decision based on some core-coder flags */ + if ( st_ivas->hSCE[0]->hCoreCoder[0]->flag_noisy_speech_snr && st_ivas->hSCE[1]->hCoreCoder[0]->flag_noisy_speech_snr ) + { + if ( st_ivas->hSCE[0]->hCoreCoder[0]->vad_flag || st_ivas->hSCE[1]->hCoreCoder[0]->vad_flag ) + { + st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = 0; + } + else + { + st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = 1; + } + } + else + { + st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = 0; + } + + /* Do a decision based on hysterisis */ + st_ivas->hDirAC->hParamIsm->flag_noisy_speech = 1; + for ( i = 0; i < PARAM_ISM_HYS_BUF_SIZE; i++ ) + { + st_ivas->hDirAC->hParamIsm->flag_noisy_speech = st_ivas->hDirAC->hParamIsm->flag_noisy_speech && st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i]; + } #endif + ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm ); } else /* ISM_MODE_DISC */ { -#ifdef TD5 - ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, -#ifdef NCHAN_ISM_PARAMETER - nchan_ism, -#endif - st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, NULL, st_ivas->hEncoderConfig->ism_extended_metadata_flag ); -#else - ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, -#ifdef NCHAN_ISM_PARAMETER - nchan_ism, -#endif - st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, NULL ); -#endif + ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, NULL ); } -#ifdef DISCRETE_ISM_DTX_CNG - update_last_metadata( nchan_ism, st_ivas->hIsmMetaData, md_diff_flag ); -#endif - /*----------------------------------------------------------------* * Write IVAS format signaling in SID frames *----------------------------------------------------------------*/ st = st_ivas->hSCE[0]->hCoreCoder[0]; -#ifdef DISCRETE_ISM_DTX_CNG - if ( sid_flag ) -#else if ( st->core_brate == SID_2k40 ) -#endif { ivas_write_format_sid( st_ivas->hEncoderConfig->ivas_format, IVAS_SCE, st->hBstr ); -#ifndef DISCRETE_ISM_DTX_CNG +#ifdef PARAM_ISM_DTX_CNG if ( st_ivas->ism_mode != ISM_MODE_PARAM ) +#endif { /* write unused bits */ nBits = ( IVAS_SID_5k2 - SID_2k40 ) / 50 - SID_FORMAT_NBITS; @@ -331,7 +288,6 @@ ivas_error ivas_ism_enc( nBits -= i; } } -#endif } /*------------------------------------------------------------------* @@ -373,7 +329,9 @@ ivas_error ivas_ism_enc( * Encoder *----------------------------------------------------------------*/ +#ifdef PARAM_ISM_DTX_CNG if ( !dtx_flag || ( dtx_flag && sce_id == st_ivas->hISMDTX->sce_id_dtx ) ) +#endif { if ( ( error = ivas_core_enc( hSCE, NULL, NULL, 1, old_inp_12k8[sce_id], old_inp_16k[sce_id], ener[sce_id], A[sce_id], Aw[sce_id], epsP[sce_id], lsp_new[sce_id], lsp_mid[sce_id], vad_hover_flag[sce_id], attack_flag[sce_id], realBuffer[sce_id], imagBuffer[sce_id], old_wsp[sce_id], loc_harm[sce_id], cor_map_sum[sce_id], vad_flag_dtx[sce_id], enerBuffer[sce_id], fft_buff[sce_id], 0, ISM_FORMAT, 0 ) ) != IVAS_ERR_OK ) { @@ -392,6 +350,7 @@ ivas_error ivas_ism_enc( st->hTranDet->transientDetector.prev_bIsAttackPresent = st->hTranDet->transientDetector.bIsAttackPresent; } +#ifdef PARAM_ISM_DTX_CNG if ( dtx_flag ) { for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ ) @@ -400,47 +359,11 @@ ivas_error ivas_ism_enc( { st_ivas->hSCE[sce_id]->hCoreCoder[0]->last_core = st_ivas->hSCE[st_ivas->hISMDTX->sce_id_dtx]->hCoreCoder[0]->last_core; st_ivas->hSCE[sce_id]->hCoreCoder[0]->last_core_brate = st_ivas->hSCE[st_ivas->hISMDTX->sce_id_dtx]->hCoreCoder[0]->core_brate; - st_ivas->hSCE[sce_id]->hCoreCoder[0]->last_L_frame = st_ivas->hSCE[st_ivas->hISMDTX->sce_id_dtx]->hCoreCoder[0]->last_L_frame; - } - } - } - -#ifdef DISCRETE_ISM_DTX_CNG -#ifdef DEBUG_MODE_INFO - if ( dtx_flag ) - { - float tmpF; - int16_t id, n; - - n = 0; - for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ ) - { - if ( sce_id != st_ivas->hISMDTX->sce_id_dtx ) - { - st = st_ivas->hSCE[sce_id]->hCoreCoder[0]; - id = st->id_element; - - dbgwrite( &st->core, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "core", n, id, ENC ) ); - dbgwrite( &st->extl, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "extl", n, id, ENC ) ); - dbgwrite( &st->bwidth, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "bwidth", n, id, ENC ) ); - tmpF = st->total_brate / 1000.0f; - dbgwrite( &tmpF, sizeof( float ), 1, input_frame, fname( debug_dir, "total_brate", n, id, ENC ) ); - tmpF = st->core_brate / 1000.0f; - dbgwrite( &tmpF, sizeof( float ), 1, input_frame, fname( debug_dir, "core_brate", n, id, ENC ) ); - tmpF = st->extl_brate / 1000.0f; - dbgwrite( &tmpF, sizeof( float ), 1, input_frame, fname( debug_dir, "extl_brate", n, id, ENC ) ); - - dbgwrite( &st->coder_type, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "coder_type", n, id, ENC ) ); - dbgwrite( &st->coder_type_raw, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "coder_type_raw", n, id, ENC ) ); - dbgwrite( &st->vad_flag, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "vad_flag", n, id, ENC ) ); - dbgwrite( &st->localVAD, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "localVAD", n, id, ENC ) ); - - dbgwrite( &st->lp_noise, sizeof( float ), 1, input_frame, fname( debug_dir, "lp_noise", n, id, ENC ) ); } } } #endif -#endif + pop_wmops(); return error; @@ -454,6 +377,7 @@ ivas_error ivas_ism_enc( * - reconfigure the ISM format encoder *-------------------------------------------------------------------------*/ +/*! r : ISM format mode */ ivas_error ivas_ism_enc_config( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ) @@ -479,7 +403,7 @@ ivas_error ivas_ism_enc_config( /* Reset and Initialize */ if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { - st_ivas->nchan_transport = MAX_PARAM_ISM_WAVE; + st_ivas->nchan_transport = 2; } else { @@ -513,7 +437,8 @@ ivas_error ivas_ism_enc_config( if ( st_ivas->ism_mode == ISM_MODE_DISC && last_ism_mode == ISM_MODE_PARAM ) { /* Deallocate the memory used by ParamISM when switch to Discrete ISM */ - ivas_param_ism_enc_close( &( st_ivas->hDirAC ), st_ivas->hEncoderConfig->input_Fs ); + ivas_param_ism_enc_close( st_ivas->hDirAC, st_ivas->hEncoderConfig->input_Fs ); + st_ivas->hDirAC = NULL; } } diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index ddac05ff00..41e0f8ac78 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -49,34 +49,16 @@ * Local constants *-----------------------------------------------------------------------*/ -#ifdef TD5 -#define ISM_NUM_PARAM 5 /* number of coded metadata parameters */ -#else #define ISM_NUM_PARAM 2 /* number of coded metadata parameters */ -#endif #define ISM_MAX_AZIMUTH_DIFF_IDX ( ISM_AZIMUTH_NBITS - 1 /*zero*/ - 1 /*sign*/ ) #define ISM_MAX_ELEVATION_DIFF_IDX ( ISM_ELEVATION_NBITS - 1 /*zero*/ - 1 /*sign*/ ) -#ifdef TD5 -#define ISM_MAX_RADIUS_DIFF_IDX ( ISM_RADIUS_NBITS - 1 /*zero*/ - 1 /*sign*/ ) -#endif #define ISM_FEC_MAX 10 #define INTER_OBJECT_PARAM_CHECK ( ( ISM_FEC_MAX / 2 ) - 2 ) /* note: constant must be less than (ISM_FEC_MAX / number of coded parameters) */ -#ifdef TD5 -/*-----------------------------------------------------------------------* - * Local function declarations - *-----------------------------------------------------------------------*/ - -static void encode_angle_indices( BSTR_ENC_HANDLE hBstr, ISM_METADATA_ANGLE_HANDLE angle, const int16_t last_ism_metadata_flag, const int16_t ini_frame, const int16_t idx_azimuth_abs, const int16_t idx_elevation_abs, int16_t *flag_abs_azimuth, int16_t *flag_abs_elevation ); - -static void encode_radius( BSTR_ENC_HANDLE hBstr, int16_t *last_radius_idx, int16_t *radius_diff_cnt, const int16_t last_ism_metadata_flag, const int16_t idx_radius_abs, int16_t *flag_abs_radius ); - -#endif - /*-------------------------------------------------------------------------* * ivas_set_ism_metadata() * @@ -86,14 +68,7 @@ static void encode_radius( BSTR_ENC_HANDLE hBstr, int16_t *last_radius_idx, int1 ivas_error ivas_set_ism_metadata( ISM_METADATA_HANDLE hIsmMeta, /* o : ISM metadata handle */ const float azimuth, /* i : azimuth value */ -#ifdef TD5 - const float elevation, /* i : elevation */ - const float radius_meta, /* i : radius */ - const float yaw, /* i : yaw */ - const float pitch /* i : pitch */ -#else - const float elevation /* i : elevation value */ -#endif + const float elevation /* i : elevation value */ ) { if ( hIsmMeta == NULL ) @@ -106,11 +81,6 @@ ivas_error ivas_set_ism_metadata( /* save read metadata parameters to the internal codec structure */ hIsmMeta->azimuth = azimuth; hIsmMeta->elevation = elevation; -#ifdef TD5 - hIsmMeta->radius = radius_meta; - hIsmMeta->yaw = yaw; - hIsmMeta->pitch = pitch; -#endif return IVAS_ERR_OK; } @@ -119,7 +89,7 @@ ivas_error ivas_set_ism_metadata( /*-------------------------------------------------------------------------* * rate_ism_importance() * - * Rate importance of particular ISM streams + * Rate importance of particular ISm streams *-------------------------------------------------------------------------*/ static void rate_ism_importance( @@ -176,96 +146,64 @@ static void rate_ism_importance( *-------------------------------------------------------------------------*/ ivas_error ivas_ism_metadata_enc( - const int32_t ism_total_brate, /* i : ISM total bitrate */ -#ifdef NCHAN_ISM_PARAMETER - const int16_t nchan_ism, /* i : number of ISM channels */ -#endif - const int16_t nchan_transport, /* i : number of transport channels */ - ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ - SCE_ENC_HANDLE hSCE[], /* i/o: SCE encoder handles */ - BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ - int16_t nb_bits_metadata[], /* o : number of metadata bits */ - const int16_t localVAD[], /* i : VAD flag */ - const int16_t ism_mode, /* i : ISM mode */ -#ifdef TD5 - const PARAM_ISM_CONFIG_HANDLE hParamIsm, /* i : Param ISM Enc Handle */ - const int16_t ism_extended_metadata_flag /* i : Extended metadata flag */ -#else + const int32_t ism_total_brate, /* i : ISms total bitrate */ + const int16_t nchan_transport, /* i : number of transport channels */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + SCE_ENC_HANDLE hSCE[], /* i/o: SCE encoder handles */ + BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ + int16_t nb_bits_metadata[], /* o : number of metadata bits */ + const int16_t localVAD[], /* i : VAD flag */ + const int16_t ism_mode, /* i : ISM mode */ const PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Enc Handle */ -#endif ) { -#ifdef TD5 -#ifdef TUNE_360_OBJECT_WITH_NOISE - int16_t i, ch, nb_bits_start = 0; -#else - int16_t i, ch, nb_bits_start = 0, diff; -#endif - int16_t idx_azimuth_abs = 0, flag_abs_azimuth[MAX_NUM_OBJECTS]; - int16_t idx_elevation_abs = 0, flag_abs_elevation[MAX_NUM_OBJECTS]; - int16_t flag_abs_azimuth_orientation[MAX_NUM_OBJECTS]; - int16_t idx_radius_abs = 0, flag_abs_radius[MAX_NUM_OBJECTS]; -#else int16_t i, ch, nb_bits_start = 0, diff; int16_t idx_azimuth, idx_azimuth_abs = 0, flag_abs_azimuth[MAX_NUM_OBJECTS], nbits_diff_azimuth; int16_t idx_elevation, idx_elevation_abs = 0, flag_abs_elevation[MAX_NUM_OBJECTS], nbits_diff_elevation; -#endif float valQ; ISM_METADATA_HANDLE hIsmMetaData; int32_t element_brate[MAX_NUM_OBJECTS], total_brate[MAX_NUM_OBJECTS]; int16_t ism_metadata_flag_global; int16_t ism_imp[MAX_NUM_OBJECTS]; -#ifdef NCHAN_ISM_PARAMETER - int16_t nbands, nblocks; -#else - int16_t nchan_ism, nbands, nblocks; -#endif + int16_t num_obj, nbands, nblocks; ivas_error error; error = IVAS_ERR_OK; push_wmops( "ism_meta_enc" ); -#ifndef NCHAN_ISM_PARAMETER if ( ism_mode == ISM_MODE_PARAM ) { - nchan_ism = hParamIsm->num_obj; + num_obj = hParamIsm->num_obj; } else if ( ism_mode == ISM_MODE_DISC ) { - nchan_ism = nchan_transport; + num_obj = nchan_transport; } else { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: incorrect ISM mode" ); } -#endif -#ifndef DISCRETE_ISM_DTX_CNG - if ( nchan_ism == 1 && ( hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 || hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA ) && ism_mode == ISM_MODE_DISC ) + if ( num_obj == 1 && ( hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 || hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA ) && ism_mode == ISM_MODE_DISC ) { /* no metadata encoding in CNG */ pop_wmops(); return error; } -#endif /* initialization */ ism_metadata_flag_global = 0; set_s( nb_bits_metadata, 0, nchan_transport ); - set_s( flag_abs_azimuth, 0, nchan_ism ); - set_s( flag_abs_elevation, 0, nchan_ism ); -#ifdef TD5 - set_s( flag_abs_azimuth_orientation, 0, nchan_ism ); - set_s( flag_abs_radius, 0, nchan_ism ); -#endif + set_s( flag_abs_azimuth, 0, num_obj ); + set_s( flag_abs_elevation, 0, num_obj ); /*----------------------------------------------------------------* * Set Metadata presence / importance flag *----------------------------------------------------------------*/ - for ( ch = 0; ch < nchan_ism; ch++ ) + for ( ch = 0; ch < num_obj; ch++ ) { if ( ism_mode == ISM_MODE_PARAM ) { @@ -273,39 +211,6 @@ ivas_error ivas_ism_metadata_enc( } else if ( ism_mode == ISM_MODE_DISC ) { -#ifdef TD5 -#ifdef TUNE_360_OBJECT_WITH_NOISE -#ifdef DISCRETE_ISM_DTX_CNG - hIsmMeta[ch]->ism_metadata_flag = localVAD[ch] || hSCE[ch]->hCoreCoder[0]->lp_noise > 10; -#else - /* In case of low level noise for low bitrate inactive frames, do not sent metadata */ - if ( localVAD[ch] == 0 && !( hSCE[ch]->hCoreCoder[0]->tcxonly ) && ( hSCE[ch]->hCoreCoder[0]->lp_noise <= 10 ) ) - { - hIsmMeta[ch]->ism_metadata_flag = 0; - } -#endif -#else - if ( hIsmMeta[ch]->ism_metadata_flag ) - { - /* at highest bitrates (with TCX core only) metadata are sent also for inactive frames */ - if ( localVAD[ch] == 0 && !( hSCE[ch]->hCoreCoder[0]->tcxonly ) ) - { - /* send metadata even in inactive segments when noise is audible and metadata are changing */ - diff = (int16_t) fabsf( hIsmMeta[ch]->azimuth - ism_dequant_meta( hIsmMeta[ch]->angle[0].last_azimuth_idx, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ) ); - diff = max( diff, (int16_t) fabsf( hIsmMeta[ch]->elevation - ism_dequant_meta( hIsmMeta[ch]->angle[0].last_elevation_idx, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ) ) ); - if ( ism_total_brate >= ISM_EXTENDED_METADATA_BRATE && ism_extended_metadata_flag ) - { - diff = max( diff, (int16_t) fabsf( hIsmMeta[ch]->yaw - ism_dequant_meta( hIsmMeta[ch]->angle[1].last_azimuth_idx, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ) ) ); - diff = max( diff, (int16_t) fabsf( hIsmMeta[ch]->pitch - ism_dequant_meta( hIsmMeta[ch]->angle[1].last_elevation_idx, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ) ) ); - } - if ( !( hSCE[ch]->hCoreCoder[0]->lp_noise > 15 && diff >= 10 ) ) - { - hIsmMeta[ch]->ism_metadata_flag = 0; - } - } - } -#endif -#else #ifdef TUNE_360_OBJECT_WITH_NOISE hIsmMeta[ch]->ism_metadata_flag = localVAD[ch] || hSCE[ch]->hCoreCoder[0]->lp_noise > 10; #else @@ -314,8 +219,8 @@ ivas_error ivas_ism_metadata_enc( if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) { /* send metadata even in inactive segments when noise is audible and metadata are changing */ - diff = (int16_t) fabsf( hIsmMeta[ch]->azimuth - ism_dequant_meta( hIsmMeta[ch]->last_azimuth_idx, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ) ); - diff = max( diff, (int16_t) fabsf( hIsmMeta[ch]->elevation - ism_dequant_meta( hIsmMeta[ch]->last_elevation_idx, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ) ) ); + diff = (int16_t) fabsf( hIsmMeta[ch]->azimuth - ism_dequant_meta( hIsmMeta[ch]->last_azimuth_idx, ism_azimuth_borders, 1 << ISM_AZIMUTH_NBITS ) ); + diff = max( diff, (int16_t) fabsf( hIsmMeta[ch]->elevation - ism_dequant_meta( hIsmMeta[ch]->last_elevation_idx, ism_elevation_borders, 1 << ISM_ELEVATION_NBITS ) ) ); if ( hSCE[ch]->hCoreCoder[0]->lp_noise > 15 && diff >= 10 ) { @@ -329,25 +234,24 @@ ivas_error ivas_ism_metadata_enc( /* at highest bitrates (with TCX core only) metadata are sent in every frame */ hIsmMeta[ch]->ism_metadata_flag = 1; } -#endif } } /*----------------------------------------------------------------* - * Rate importance of particular ISM streams + * Rate importance of particular ISm streams *----------------------------------------------------------------*/ rate_ism_importance( nchan_transport, hIsmMeta, hSCE, ism_imp ); #ifndef TUNE_360_OBJECT_WITH_NOISE /* relax the importance decision in "stereo" coding for noisy audio */ - if ( ism_mode == ISM_MODE_DISC && nchan_ism == 2 ) + if ( ism_mode == ISM_MODE_DISC && num_obj == 2 ) { float diff_F; if ( hIsmMeta[0]->ism_metadata_flag ^ hIsmMeta[1]->ism_metadata_flag ) { - for ( ch = 0; ch < nchan_ism; ch++ ) + for ( ch = 0; ch < num_obj; ch++ ) { diff_F = hSCE[ch]->hCoreCoder[0]->lp_speech - hSCE[ch]->hCoreCoder[0]->lp_noise; @@ -360,33 +264,24 @@ ivas_error ivas_ism_metadata_enc( } } #endif - /*----------------------------------------------------------------* - * Write ISM common signaling + * Write ISm common signaling *----------------------------------------------------------------*/ /* write number of objects - unary coding */ - for ( ch = 1; ch < nchan_ism; ch++ ) + for ( ch = 1; ch < num_obj; ch++ ) { push_indice( hBstr, IND_ISM_NUM_OBJECTS, 1, 1 ); } push_indice( hBstr, IND_ISM_NUM_OBJECTS, 0, 1 ); -#ifdef TD5 - /* write extended metadata presence flag */ - if ( ism_total_brate >= ISM_EXTENDED_METADATA_BRATE ) - { - push_indice( hBstr, IND_ISM_EXTENDED_FLAG, ism_extended_metadata_flag, ISM_EXTENDED_METADATA_BITS ); - } -#endif - - /* write ISM metadata flag (one per object) */ + /* write ISm metadata flag (one per object) */ for ( ch = 0; ch < nchan_transport; ch++ ) { push_indice( hBstr, IND_ISM_METADATA_FLAG, ism_imp[ch], ISM_METADATA_FLAG_BITS ); } - for ( ch = 0; ch < nchan_ism; ch++ ) + for ( ch = 0; ch < num_obj; ch++ ) { ism_metadata_flag_global |= hIsmMeta[ch]->ism_metadata_flag; } @@ -418,7 +313,7 @@ ivas_error ivas_ism_metadata_enc( nb_bits_start = hBstr->nb_bits_tot; } - for ( ch = 0; ch < nchan_ism; ch++ ) + for ( ch = 0; ch < num_obj; ch++ ) { hIsmMetaData = hIsmMeta[ch]; if ( ism_mode == ISM_MODE_DISC ) @@ -428,43 +323,6 @@ ivas_error ivas_ism_metadata_enc( if ( hIsmMeta[ch]->ism_metadata_flag ) { -#ifdef TD5 - /*----------------------------------------------------------------* - * Quantize and encode azimuth and elevation - *----------------------------------------------------------------*/ - - if ( ism_mode == ISM_MODE_DISC ) - { - idx_azimuth_abs = ism_quant_meta( hIsmMetaData->azimuth, &valQ, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ); - idx_elevation_abs = ism_quant_meta( hIsmMetaData->elevation, &valQ, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ); - } - else /* ISM_MODE_PARAM */ - { - idx_azimuth_abs = hParamIsm->azi_index[ch]; - idx_elevation_abs = hParamIsm->ele_index[ch]; - } - - encode_angle_indices( hBstr, &( hIsmMetaData->angle[0] ), hIsmMetaData->last_ism_metadata_flag, hSCE[0]->hCoreCoder[0]->ini_frame, idx_azimuth_abs, idx_elevation_abs, &flag_abs_azimuth[ch], &flag_abs_elevation[ch] ); - - /*----------------------------------------------------------------* - * Quantize and encode radius, yaw, and pitch - *----------------------------------------------------------------*/ - - if ( ism_mode == ISM_MODE_DISC && ism_extended_metadata_flag ) - { - idx_azimuth_abs = ism_quant_meta( hIsmMetaData->yaw, &valQ, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ); - idx_elevation_abs = ism_quant_meta( hIsmMetaData->pitch, &valQ, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ); - idx_radius_abs = usquant( hIsmMetaData->radius, &valQ, ISM_RADIUS_MIN, ISM_RADIUS_DELTA, 1 << ISM_RADIUS_NBITS ); - encode_angle_indices( hBstr, &( hIsmMetaData->angle[1] ), hIsmMetaData->last_ism_metadata_flag, hSCE[0]->hCoreCoder[0]->ini_frame, idx_azimuth_abs, idx_elevation_abs, &flag_abs_azimuth_orientation[ch], &flag_abs_elevation[ch] ); - encode_radius( hBstr, &hIsmMetaData->last_radius_idx, &hIsmMetaData->radius_diff_cnt, hIsmMetaData->last_ism_metadata_flag, idx_radius_abs, &flag_abs_radius[ch] ); - } - - /* save number of metadata bits written */ - if ( ism_mode == ISM_MODE_DISC ) - { - nb_bits_metadata[ch] = hBstr->nb_bits_tot - nb_bits_start; - } -#else /*----------------------------------------------------------------* * Azimuth quantization and encoding *----------------------------------------------------------------*/ @@ -472,7 +330,7 @@ ivas_error ivas_ism_metadata_enc( /* Azimuth quantization (quantize azimuth to the AZIMUTH_NBITS-bit index */ if ( ism_mode == ISM_MODE_DISC ) { - idx_azimuth_abs = ism_quant_meta( hIsmMetaData->azimuth, &valQ, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ); + idx_azimuth_abs = ism_quant_meta( hIsmMetaData->azimuth, &valQ, ism_azimuth_borders, 1 << ISM_AZIMUTH_NBITS ); } else if ( ism_mode == ISM_MODE_PARAM ) { @@ -578,7 +436,7 @@ ivas_error ivas_ism_metadata_enc( /* Elevation quantization (quantize azimuth to the ELEVATION_NBITS-bit index */ if ( ism_mode == ISM_MODE_DISC ) { - idx_elevation_abs = ism_quant_meta( hIsmMetaData->elevation, &valQ, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ); + idx_elevation_abs = ism_quant_meta( hIsmMetaData->elevation, &valQ, ism_elevation_borders, 1 << ISM_ELEVATION_NBITS ); } else /* ISM_MODE_PARAM */ { @@ -709,7 +567,6 @@ ivas_error ivas_ism_metadata_enc( { nb_bits_metadata[ch] = hBstr->nb_bits_tot - nb_bits_start; } -#endif } } @@ -719,16 +576,12 @@ ivas_error ivas_ism_metadata_enc( *----------------------------------------------------------------*/ i = 0; - while ( i == 0 || i < nchan_ism / INTER_OBJECT_PARAM_CHECK ) + while ( i == 0 || i < num_obj / INTER_OBJECT_PARAM_CHECK ) { int16_t num, abs_num, abs_first, abs_next, pos_zero; -#ifdef TD5 - int16_t abs_matrice[INTER_OBJECT_PARAM_CHECK * ISM_NUM_PARAM]; -#else int16_t abs_matrice[INTER_OBJECT_PARAM_CHECK * 2]; -#endif - num = min( INTER_OBJECT_PARAM_CHECK, nchan_ism - i * INTER_OBJECT_PARAM_CHECK ); + num = min( INTER_OBJECT_PARAM_CHECK, num_obj - i * INTER_OBJECT_PARAM_CHECK ); i++; set_s( abs_matrice, 0, INTER_OBJECT_PARAM_CHECK * ISM_NUM_PARAM ); @@ -774,20 +627,12 @@ ivas_error ivas_ism_metadata_enc( if ( abs_next % ISM_NUM_PARAM == 0 ) { -#ifdef TD5 - hIsmMeta[ch]->angle[0].azimuth_diff_cnt = abs_num - 1; -#else hIsmMeta[ch]->azimuth_diff_cnt = abs_num - 1; -#endif } if ( abs_next % ISM_NUM_PARAM == 1 ) { -#ifdef TD5 - hIsmMeta[ch]->angle[0].elevation_diff_cnt = abs_num - 1; -#else hIsmMeta[ch]->elevation_diff_cnt = abs_num - 1; -#endif /*hIsmMeta[ch]->elevation_diff_cnt = min( hIsmMeta[ch]->elevation_diff_cnt, ISM_FEC_MAX );*/ } @@ -850,12 +695,12 @@ ivas_error ivas_ism_metadata_enc( * Configuration and decision about bitrates per channel *----------------------------------------------------------------*/ - if ( ( error = ivas_ism_config( ism_total_brate, nchan_transport, nchan_ism, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_config( ism_total_brate, nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata ) ) != IVAS_ERR_OK ) { return error; } - for ( ch = 0; ch < nchan_ism; ch++ ) + for ( ch = 0; ch < num_obj; ch++ ) { hIsmMeta[ch]->last_ism_metadata_flag = hIsmMeta[ch]->ism_metadata_flag; } @@ -890,7 +735,6 @@ ivas_error ivas_ism_metadata_enc( return error; } - /*------------------------------------------------------------------------- * ivas_ism_metadata_enc_create() * @@ -908,7 +752,7 @@ ivas_error ivas_ism_metadata_enc_create( if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { - nchan_transport = MAX_PARAM_ISM_WAVE; + nchan_transport = 2; } else { @@ -919,39 +763,21 @@ ivas_error ivas_ism_metadata_enc_create( st_ivas->nSCE = nchan_transport; st_ivas->nCPE = 0; - /* allocate ISM metadata handles */ + /* allocate ISm metadata handles */ for ( ch = 0; ch < n_ISms; ch++ ) { if ( ( st_ivas->hIsmMetaData[ch] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISM MetaData\n" ) ); + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISm MetaData\n" ) ); } -#ifdef TD5 - st_ivas->hIsmMetaData[ch]->angle[0].last_azimuth_idx = 0; - st_ivas->hIsmMetaData[ch]->angle[0].azimuth_diff_cnt = ISM_FEC_MAX; - st_ivas->hIsmMetaData[ch]->angle[0].last_elevation_idx = 0; - st_ivas->hIsmMetaData[ch]->angle[0].elevation_diff_cnt = ISM_FEC_MAX - 1; - st_ivas->hIsmMetaData[ch]->last_radius_idx = 0; - st_ivas->hIsmMetaData[ch]->radius_diff_cnt = ISM_FEC_MAX - 2; - st_ivas->hIsmMetaData[ch]->angle[1].last_azimuth_idx = 0; - st_ivas->hIsmMetaData[ch]->angle[1].azimuth_diff_cnt = ISM_FEC_MAX - 2; - st_ivas->hIsmMetaData[ch]->angle[1].last_elevation_idx = 0; - st_ivas->hIsmMetaData[ch]->angle[1].elevation_diff_cnt = ISM_FEC_MAX - 2; -#else st_ivas->hIsmMetaData[ch]->last_azimuth_idx = 0; st_ivas->hIsmMetaData[ch]->azimuth_diff_cnt = ISM_FEC_MAX; st_ivas->hIsmMetaData[ch]->last_elevation_idx = 0; st_ivas->hIsmMetaData[ch]->elevation_diff_cnt = ISM_FEC_MAX - 1; -#endif st_ivas->hIsmMetaData[ch]->last_ism_metadata_flag = 0; ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); - -#ifdef DISCRETE_ISM_DTX_CNG - st_ivas->hIsmMetaData[ch]->last_azimuth = 0.0f; - st_ivas->hIsmMetaData[ch]->last_elevation = 0.0f; -#endif } if ( ( error = ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, nchan_transport, n_ISms, NULL, NULL, NULL, element_brate_tmp, NULL, NULL ) ) != IVAS_ERR_OK ) @@ -961,507 +787,3 @@ ivas_error ivas_ism_metadata_enc_create( return IVAS_ERR_OK; } - - -#ifdef TD5 -/*------------------------------------------------------------------------- - * encode_radius() - * - * Radius index encoding - *-------------------------------------------------------------------------*/ - -static void encode_radius( - BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ - int16_t *last_radius_idx, /* i/o: last radius index */ - int16_t *radius_diff_cnt, /* i/o: radius diff coding counter */ - const int16_t last_ism_metadata_flag, /* last frame ism_metadata_flag */ - const int16_t idx_radius_abs, /* i : Azimuth index */ - int16_t *flag_abs_radius /* o : Radius encoding mode */ -) -{ - int16_t idx_radius, nbits_diff_radius, diff; - - idx_radius = idx_radius_abs; - nbits_diff_radius = 0; - *flag_abs_radius = 0; /* differential coding by default */ - - if ( *radius_diff_cnt == ISM_FEC_MAX /* make differential encoding in ISM_FEC_MAX consecutive frames at maximum (in order to control the decoding in FEC) */ - || last_ism_metadata_flag == 0 /* If last frame had no metadata coded, do not use differential coding */ - ) - { - *flag_abs_radius = 1; - } - - diff = idx_radius_abs - *last_radius_idx; - - /* try differential coding */ - if ( *flag_abs_radius == 0 ) - { - if ( diff == 0 ) - { - idx_radius = 0; - nbits_diff_radius = 1; - } - else if ( ABSVAL( diff ) <= ISM_MAX_RADIUS_DIFF_IDX ) - { - idx_radius = 1 << 1; - nbits_diff_radius = 1; - - if ( diff < 0 ) - { - idx_radius += 1; /* negative sign */ - diff *= -1; - } - else - { - idx_radius += 0; /* positive sign */ - } - - idx_radius = idx_radius << diff; - nbits_diff_radius++; - - /* unary coding of "diff */ - idx_radius += ( ( 1 << diff ) - 1 ); - nbits_diff_radius += diff; - - if ( nbits_diff_radius < ISM_RADIUS_NBITS ) - { - /* add stop bit */ - idx_radius = idx_radius << 1; - nbits_diff_radius++; - } - } - else - { - *flag_abs_radius = 1; - } - } - - /* update counter */ - if ( *flag_abs_radius == 0 ) - { - ( *radius_diff_cnt )++; - *radius_diff_cnt = min( *radius_diff_cnt, ISM_FEC_MAX ); - } - else - { - *radius_diff_cnt = 0; - } - - /* Write radius */ - push_indice( hBstr, IND_ISM_RADIUS_DIFF_FLAG, *flag_abs_radius, 1 ); - - if ( *flag_abs_radius ) - { - push_indice( hBstr, IND_ISM_RADIUS, idx_radius, ISM_RADIUS_NBITS ); - } - else - { - push_indice( hBstr, IND_ISM_RADIUS, idx_radius, nbits_diff_radius ); - } - - /* Updates */ - *last_radius_idx = idx_radius_abs; - - return; -} - - -/*----------------------------------------------------------------* - * encode_angle_indices() - * - * Encoding of an angle - *----------------------------------------------------------------*/ - -static void encode_angle_indices( - BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ - ISM_METADATA_ANGLE_HANDLE angle, /* i/o: angle handle */ - const int16_t last_ism_metadata_flag, /* i : last frame ism_metadata_flag */ - const int16_t ini_frame, /* i : initialization frames counter */ - const int16_t idx_azimuth_abs, /* i : Azimuth index */ - const int16_t idx_elevation_abs, /* i : Elevation index */ - int16_t *flag_abs_azimuth, /* o : Azimuth encoding mode */ - int16_t *flag_abs_elevation /* o : Elevation encoding mode */ -) -{ - int16_t idx_azimuth, nbits_diff_azimuth, diff; - int16_t idx_elevation, nbits_diff_elevation; - - /*----------------------------------------------------------------* - * Azimuth index encoding - *----------------------------------------------------------------*/ - - idx_azimuth = idx_azimuth_abs; - - nbits_diff_azimuth = 0; - - *flag_abs_azimuth = 0; /* differential coding by default */ - if ( angle->azimuth_diff_cnt == ISM_FEC_MAX /* make differential encoding in ISM_FEC_MAX consecutive frames at maximum (in order to control the decoding in FEC) */ - || last_ism_metadata_flag == 0 /* If last frame had no metadata coded, do not use differential coding */ - ) - { - *flag_abs_azimuth = 1; - } - - /* try differential coding */ - if ( *flag_abs_azimuth == 0 ) - { - diff = idx_azimuth_abs - angle->last_azimuth_idx; - - /* azimuth is on a circle - check for diff coding for -180° -> 180° and vice versa changes */ - if ( abs( diff ) > ( ( 1 << ISM_AZIMUTH_NBITS ) - 1 ) - ISM_MAX_AZIMUTH_DIFF_IDX ) - { - if ( diff > 0 ) - { - diff -= ( 1 << ISM_AZIMUTH_NBITS ) - 1; - } - else - { - diff += ( 1 << ISM_AZIMUTH_NBITS ) - 1; - } - } - - if ( diff == 0 ) - { - idx_azimuth = 0; - nbits_diff_azimuth = 1; - } - else if ( ABSVAL( diff ) < ISM_MAX_AZIMUTH_DIFF_IDX ) /* when diff bits >= abs bits, prefer abs */ - { - idx_azimuth = 1 << 1; - nbits_diff_azimuth = 1; - - if ( diff < 0 ) - { - idx_azimuth += 1; /* negative sign */ - diff *= -1; - } - else - { - idx_azimuth += 0; /* positive sign */ - } - - idx_azimuth = idx_azimuth << diff; - nbits_diff_azimuth++; - - /* unary coding of "diff */ - idx_azimuth += ( ( 1 << diff ) - 1 ); - nbits_diff_azimuth += diff; - - if ( nbits_diff_azimuth < ISM_AZIMUTH_NBITS - 1 ) - { - /* add stop bit - only for codewords shorter than ISM_AZIMUTH_NBITS */ - idx_azimuth = idx_azimuth << 1; - nbits_diff_azimuth++; - } - } - else - { - *flag_abs_azimuth = 1; - } - } - - /* update counter */ - if ( *flag_abs_azimuth == 0 ) - { - angle->azimuth_diff_cnt++; - angle->elevation_diff_cnt = min( angle->elevation_diff_cnt, ISM_FEC_MAX ); - } - else - { - angle->azimuth_diff_cnt = 0; - } - - /* Write azimuth */ - push_indice( hBstr, IND_ISM_AZIMUTH_DIFF_FLAG, *flag_abs_azimuth, 1 ); - - if ( *flag_abs_azimuth ) - { - push_indice( hBstr, IND_ISM_AZIMUTH, idx_azimuth, ISM_AZIMUTH_NBITS ); - } - else - { - push_indice( hBstr, IND_ISM_AZIMUTH, idx_azimuth, nbits_diff_azimuth ); - } - - /*----------------------------------------------------------------* - * Elevation index encoding - *----------------------------------------------------------------*/ - - idx_elevation = idx_elevation_abs; - nbits_diff_elevation = 0; - *flag_abs_elevation = 0; /* differential coding by default */ - if ( angle->elevation_diff_cnt == ISM_FEC_MAX /* make differential encoding in ISM_FEC_MAX consecutive frames at maximum (in order to control the decoding in FEC) */ - || last_ism_metadata_flag == 0 /* If last frame had no metadata coded, do not use differential coding */ - ) - { - *flag_abs_elevation = 1; - } - - /* note: elevation is coded starting from the second frame only (it is meaningless in the init_frame) */ - if ( ini_frame == 0 ) - { - *flag_abs_elevation = 1; - angle->last_elevation_idx = idx_elevation_abs; - } - - diff = idx_elevation_abs - angle->last_elevation_idx; - - /* avoid absolute coding of elevation if absolute coding was already used for azimuth */ - if ( *flag_abs_azimuth == 1 ) - { - int16_t diff_orig = diff; - - *flag_abs_elevation = 0; - - - if ( diff >= 0 ) - { - diff = min( diff, ISM_MAX_ELEVATION_DIFF_IDX ); - } - else - { - diff = -1 * min( -diff, ISM_MAX_ELEVATION_DIFF_IDX ); - } - - if ( last_ism_metadata_flag == 0 || abs( diff_orig - diff ) > ISM_MAX_ELEVATION_DIFF_IDX ) - { - angle->elevation_diff_cnt = ISM_FEC_MAX - 1; - } - } - - /* try differential coding */ - if ( *flag_abs_elevation == 0 ) - { - if ( diff == 0 ) - { - idx_elevation = 0; - nbits_diff_elevation = 1; - } - else if ( ABSVAL( diff ) <= ISM_MAX_ELEVATION_DIFF_IDX ) - { - idx_elevation = 1 << 1; - nbits_diff_elevation = 1; - - if ( diff < 0 ) - { - idx_elevation += 1; /* negative sign */ - diff *= -1; - } - else - { - idx_elevation += 0; /* positive sign */ - } - - idx_elevation = idx_elevation << diff; - nbits_diff_elevation++; - - /* unary coding of "diff */ - idx_elevation += ( ( 1 << diff ) - 1 ); - nbits_diff_elevation += diff; - - if ( nbits_diff_elevation < ISM_ELEVATION_NBITS ) - { - /* add stop bit */ - idx_elevation = idx_elevation << 1; - nbits_diff_elevation++; - } - } - else - { - *flag_abs_elevation = 1; - } - } - - /* update counter */ - if ( *flag_abs_elevation == 0 ) - { - angle->elevation_diff_cnt++; - angle->elevation_diff_cnt = min( angle->elevation_diff_cnt, ISM_FEC_MAX ); - } - else - { - angle->elevation_diff_cnt = 0; - } - - /* Write elevation */ - if ( *flag_abs_azimuth == 0 ) /* do not write "flag_abs_elevation" if "flag_abs_azimuth == 1" */ - { - push_indice( hBstr, IND_ISM_ELEVATION_DIFF_FLAG, *flag_abs_elevation, 1 ); - } - - if ( *flag_abs_elevation ) - { - push_indice( hBstr, IND_ISM_ELEVATION, idx_elevation, ISM_ELEVATION_NBITS ); - } - else - { - push_indice( hBstr, IND_ISM_ELEVATION, idx_elevation, nbits_diff_elevation ); - } - - /*----------------------------------------------------------------* - * Updates - *----------------------------------------------------------------*/ - - angle->last_azimuth_idx = idx_azimuth_abs; - angle->last_elevation_idx = idx_elevation_abs; - - return; -} -#endif - - -#ifdef DISCRETE_ISM_DTX_CNG -/*-------------------------------------------------------------------* - * ivas_ism_metadata_sid_enc() - * - * Quantize and encode ISM metadata in SID frame - *-------------------------------------------------------------------*/ - -void ivas_ism_metadata_sid_enc( - ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ - const int16_t flag_noisy_speech, /* i : noisy speech flag */ - const int16_t nchan_ism, /* i : number of objects */ - const int16_t nchan_transport, /* i : number of transport channels */ - const ISM_MODE ism_mode, /* i : ISM mode */ - ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ - const int16_t sid_flag, /* i : indication of SID frame */ - const int16_t md_diff_flag[], /* i : metadata differental flag */ - BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ - int16_t nb_bits_metadata[] /* o : number of metadata bits */ -) -{ - int16_t i, ch, nBits, nBits_start, nBits_unused; - float q_step, q_step_border; - int16_t idx, idx_azimuth, idx_elevation; - int16_t nBits_azimuth, nBits_elevation, nBits_coh, nBits_sce_id; - float valQ; - ISM_METADATA_HANDLE hIsmMetaData; - - if ( sid_flag ) - { - nBits = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC; - nBits -= SID_FORMAT_NBITS; - nBits_start = hBstr->nb_bits_tot; - - /*----------------------------------------------------------------* - * Write ISm common signaling - *----------------------------------------------------------------*/ - - /* write number of objects - unary coding */ - for ( ch = 1; ch < nchan_ism; ch++ ) - { - push_indice( hBstr, IND_ISM_NUM_OBJECTS, 1, 1 ); - } - push_indice( hBstr, IND_ISM_NUM_OBJECTS, 0, 1 ); - - /* write SID metadata flag (one per object) */ - for ( ch = 0; ch < nchan_ism; ch++ ) - { - push_indice( hBstr, IND_ISM_METADATA_FLAG, md_diff_flag[ch], 1 ); - } - - /*----------------------------------------------------------------* - * Set quantization bits based on the number of coded objects - *----------------------------------------------------------------*/ - - ivas_get_ism_sid_quan_bitbudget( nchan_ism, &nBits_azimuth, &nBits_elevation, &q_step, &q_step_border, &nBits_coh, &nBits_sce_id ); - - /*----------------------------------------------------------------* - * Spatial parameters, loop over TCs - 1 - *----------------------------------------------------------------*/ - - /* write ISM mode flag to explicitly signal number of spatial parameters */ - if ( nchan_ism > 2 ) - { - if ( ism_mode == ISM_MODE_DISC ) - { - push_indice( hBstr, IND_ISM_VAD_FLAG, 0, 1 ); - } - else - { - push_indice( hBstr, IND_ISM_VAD_FLAG, 1, 1 ); - } - - if ( ism_mode == ISM_MODE_PARAM ) - { - /* write noisy speech flag */ - push_indice( hBstr, IND_ISM_NOISY_SPEECH_FLAG, flag_noisy_speech, 1 ); - nBits_sce_id = 1; - } - } - - if ( nchan_transport > 1 ) - { - /* write sce id */ - push_indice( hBstr, IND_ISM_SCE_ID_DTX, hISMDTX->sce_id_dtx, nBits_sce_id ); - - /* quantize and write coherence */ - for ( ch = 0; ch < nchan_transport; ch++ ) - { - if ( ch == hISMDTX->sce_id_dtx ) - { - continue; - } - - idx = (int16_t) ( hISMDTX->coh[ch] * ( ( 1 << nBits_coh ) - 1 ) + 0.5f ); - assert( ( idx >= 0 ) && ( idx <= ( ( 1 << nBits_coh ) - 1 ) ) ); - push_indice( hBstr, IND_ISM_DTX_COH_SCA, idx, nBits_coh ); - } - } - - /*----------------------------------------------------------------* - * Metadata quantization and coding, loop over all objects - *----------------------------------------------------------------*/ - - for ( ch = 0; ch < nchan_ism; ch++ ) - { - if ( md_diff_flag[ch] == 1 ) - { - hIsmMetaData = hIsmMeta[ch]; - - idx_azimuth = ism_quant_meta( hIsmMetaData->azimuth, &valQ, ism_azimuth_borders, q_step, q_step_border, 1 << nBits_azimuth ); - idx_elevation = ism_quant_meta( hIsmMetaData->elevation, &valQ, ism_elevation_borders, q_step, q_step_border, 1 << nBits_elevation ); - - push_indice( hBstr, IND_ISM_AZIMUTH, idx_azimuth, nBits_azimuth ); - push_indice( hBstr, IND_ISM_ELEVATION, idx_elevation, nBits_elevation ); - - /* update last indexes to correspond to active frames coding */ - if ( nBits_azimuth > ISM_AZIMUTH_NBITS ) - { -#ifdef TD5 - hIsmMetaData->angle[0].last_azimuth_idx = idx_azimuth >> ( nBits_azimuth - ISM_AZIMUTH_NBITS ); - hIsmMetaData->angle[0].last_elevation_idx = idx_elevation >> ( nBits_elevation - ISM_ELEVATION_NBITS ); -#else - hIsmMetaData->last_azimuth_idx = idx_azimuth >> ( nBits_azimuth - ISM_AZIMUTH_NBITS ); - hIsmMetaData->last_elevation_idx = idx_elevation >> ( nBits_elevation - ISM_ELEVATION_NBITS ); -#endif - } - else - { -#ifdef TD5 - hIsmMetaData->angle[0].last_azimuth_idx = idx_azimuth << ( ISM_AZIMUTH_NBITS - nBits_azimuth ); - hIsmMetaData->angle[0].last_elevation_idx = idx_elevation << ( ISM_ELEVATION_NBITS - nBits_elevation ); -#else - hIsmMetaData->last_azimuth_idx = idx_azimuth << ( ISM_AZIMUTH_NBITS - nBits_azimuth ); - hIsmMetaData->last_elevation_idx = idx_elevation << ( ISM_ELEVATION_NBITS - nBits_elevation ); -#endif - } - } - } - - /* Write unused (padding) bits */ - nBits_unused = nBits - hBstr->nb_bits_tot; - while ( nBits_unused > 0 ) - { - i = min( nBits_unused, 16 ); - push_indice( hBstr, IND_UNUSED, 0, i ); - nBits_unused -= i; - } - - nb_bits_metadata[0] = hBstr->nb_bits_tot - nBits_start; - } - - return; -} -#endif diff --git a/lib_enc/ivas_ism_param_enc.c b/lib_enc/ivas_ism_param_enc.c index 63c1fcea81..ef66df5a90 100644 --- a/lib_enc/ivas_ism_param_enc.c +++ b/lib_enc/ivas_ism_param_enc.c @@ -47,27 +47,16 @@ static void ivas_param_ism_compute_obj_parameters( -#ifdef NCHAN_ISM_PARAMETER - const int16_t nchan_ism, /* i : number of ISM channels */ -#endif float reference_power_obj[MAX_NUM_OBJECTS][PARAM_ISM_MDFT_NO_SLOTS][DIRAC_NO_FB_BANDS_MAX], /* i : Reference power */ PARAM_ISM_CONFIG_HANDLE hParamIsm /* i/o: Param ISM Enc Handle */ ) { -#ifdef NCHAN_ISM_PARAMETER - int16_t i, b, m, br, mr; -#else int16_t i, b, m, br, mr, num_obj; -#endif int16_t brange_start, brange_end, mrange_start, mrange_end, time_merge_fac; float power_ratios_m[MAX_PARAM_ISM_NBANDS][MAX_PARAM_ISM_NBLOCKS]; -#ifdef NCHAN_ISM_PARAMETER - assert( nchan_ism == 3 || nchan_ism == 4 ); -#else num_obj = hParamIsm->num_obj; assert( num_obj == 3 || num_obj == 4 ); -#endif for ( b = 0; b < hParamIsm->nbands; b++ ) { @@ -92,11 +81,7 @@ static void ivas_param_ism_compute_obj_parameters( /* for each object, sum up reference power within current T/F tile */ -#ifdef NCHAN_ISM_PARAMETER - for ( i = 0; i < nchan_ism; i++ ) -#else for ( i = 0; i < num_obj; i++ ) -#endif { for ( mr = mrange_start; mr < mrange_end; mr++ ) { @@ -118,12 +103,7 @@ static void ivas_param_ism_compute_obj_parameters( index_1 = 1; index_2 = 0; } - -#ifdef NCHAN_ISM_PARAMETER - for ( i = MAX_PARAM_ISM_WAVE; i < nchan_ism; i++ ) -#else - for ( i = MAX_PARAM_ISM_WAVE; i < num_obj; i++ ) -#endif + for ( i = 2; i < num_obj; i++ ) { if ( ref_power_local[i] > ref_power_local[index_1] ) { @@ -169,36 +149,23 @@ static void ivas_param_ism_compute_obj_parameters( static void ivas_param_ism_enc_quantize_DOA( -#ifdef NCHAN_ISM_PARAMETER - const int16_t nchan_ism, /* i : number of ISM channels */ -#endif ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS], /* i : ISM metadata */ PARAM_ISM_CONFIG_HANDLE hParamIsm /* i/o: Param ISM encoder handle */ ) { -#ifdef NCHAN_ISM_PARAMETER - int16_t i, azi_idx, ele_idx; -#else int16_t i, azi_idx, ele_idx, num_obj; -#endif float valQ; -#ifndef NCHAN_ISM_PARAMETER num_obj = hParamIsm->num_obj; -#endif /* Loop over objects */ -#ifdef NCHAN_ISM_PARAMETER - for ( i = 0; i < nchan_ism; i++ ) -#else for ( i = 0; i < num_obj; i++ ) -#endif { /* Quantize the elevation and obtain quantized elevation value and index */ - ele_idx = ism_quant_meta( hIsmMetaData[i]->elevation, &valQ, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ); + ele_idx = ism_quant_meta( hIsmMetaData[i]->elevation, &valQ, ism_elevation_borders, 1 << ISM_ELEVATION_NBITS ); /* Obtain the index of quantized azimuth values */ - azi_idx = ism_quant_meta( hIsmMetaData[i]->azimuth, &valQ, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ); + azi_idx = ism_quant_meta( hIsmMetaData[i]->azimuth, &valQ, ism_azimuth_borders, 1 << ISM_AZIMUTH_NBITS ); /*Replace azimuth with quantized values */ hIsmMetaData[i]->azimuth = valQ; @@ -224,11 +191,7 @@ void ivas_param_ism_stereo_dmx( const int16_t input_frame /* i : Length of input frame */ ) { -#ifdef NCHAN_ISM_PARAMETER - int16_t i, j; -#else int16_t i, j, num_obj; -#endif float alpha, azi_shift, tmp, tmp_1; float cardioid_left[MAX_NUM_OBJECTS], cardioid_right[MAX_NUM_OBJECTS]; float stereo_dmx[2][L_FRAME48k]; @@ -239,20 +202,14 @@ void ivas_param_ism_stereo_dmx( /*Initialization*/ alpha = 0.5; azi_shift = 0; -#ifndef NCHAN_ISM_PARAMETER num_obj = st_ivas->hDirAC->hParamIsm->num_obj; -#endif /* Set the stereo dmx to zero */ set_zero( stereo_dmx[0], L_FRAME48k ); set_zero( stereo_dmx[1], L_FRAME48k ); /* Loop over all objects */ -#ifdef NCHAN_ISM_PARAMETER - for ( i = 0; i < st_ivas->hEncoderConfig->nchan_ism; i++ ) -#else for ( i = 0; i < num_obj; i++ ) -#endif { hIsmMetaData = st_ivas->hIsmMetaData[i]; @@ -314,10 +271,8 @@ ivas_error ivas_param_ism_enc_open( input_Fs = st_ivas->hEncoderConfig->input_Fs; -#ifndef NCHAN_ISM_PARAMETER /* Assign the number of objects */ hDirAC->hParamIsm->num_obj = st_ivas->hEncoderConfig->nchan_inp; -#endif /* set FB config. */ if ( ( error = ivas_fb_set_cfg( &fb_cfg, ISM_FORMAT, SBA_MODE_NONE, st_ivas->hEncoderConfig->nchan_inp, 0, 0, input_Fs ) ) != IVAS_ERR_OK ) @@ -326,16 +281,16 @@ ivas_error ivas_param_ism_enc_open( } /* Allocate and initialize FB mixer handle */ +#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), input_Fs, fb_cfg, 0 ) ) != IVAS_ERR_OK ) +#else + if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) +#endif { return error; } -#ifdef NCHAN_ISM_PARAMETER - ivas_param_ism_config( hDirAC->hParamIsm, st_ivas->hEncoderConfig->nchan_inp ); -#else ivas_param_ism_config( hDirAC->hParamIsm ); -#endif /* Assign memories for Band and Block grouping */ hDirAC->hParamIsm->nbands = MAX_PARAM_ISM_NBANDS; @@ -361,29 +316,27 @@ ivas_error ivas_param_ism_enc_open( /*-------------------------------------------------------------------------* * ivas_param_ism_enc_close() * - * Close Param ISM encoder handle + * Close Param ISM handle *-------------------------------------------------------------------------*/ void ivas_param_ism_enc_close( - DIRAC_ENC_HANDLE *hDirAC, /* i/o: encoder DirAC handle */ - const int32_t input_Fs /* i : input sampling_rate */ + DIRAC_ENC_HANDLE hDirAC, /* i/o: encoder DirAC handle */ + const int32_t input_Fs /* i : input sampling_rate */ ) { - if ( hDirAC == NULL || *hDirAC == NULL ) - { - return; - } - - ivas_FB_mixer_close( &( *hDirAC )->hFbMixer, input_Fs, 0 ); +#ifdef SBA_BR_SWITCHING_CLEAN_UP + ivas_FB_mixer_close( &hDirAC->hFbMixer, input_Fs, 0 ); +#else + ivas_FB_mixer_close( &hDirAC->hFbMixer, input_Fs ); +#endif - if ( ( *hDirAC )->hParamIsm != NULL ) + if ( hDirAC->hParamIsm != NULL ) { - free( ( *hDirAC )->hParamIsm ); - ( *hDirAC )->hParamIsm = NULL; + free( hDirAC->hParamIsm ); + hDirAC->hParamIsm = NULL; } - free( ( *hDirAC ) ); - ( *hDirAC ) = NULL; + free( hDirAC ); return; } @@ -402,9 +355,6 @@ void ivas_param_ism_enc( ) { int16_t i, j, ts, l_ts; -#ifdef NCHAN_ISM_PARAMETER - int16_t nchan_ism; -#endif int16_t num_time_slots; float *pcm_in[MAX_NUM_OBJECTS]; float fb_RealBuffer[MAX_NUM_OBJECTS][DIRAC_NO_FB_BANDS_MAX]; @@ -415,9 +365,6 @@ void ivas_param_ism_enc( DIRAC_ENC_HANDLE hDirAC; PARAM_ISM_CONFIG_HANDLE hParamIsm; -#ifdef NCHAN_ISM_PARAMETER - nchan_ism = st_ivas->hEncoderConfig->nchan_ism; -#endif hDirAC = st_ivas->hDirAC; hParamIsm = hDirAC->hParamIsm; @@ -426,11 +373,7 @@ void ivas_param_ism_enc( l_ts = input_frame / PARAM_ISM_MDFT_NO_SLOTS; num_time_slots = PARAM_ISM_MDFT_NO_SLOTS; -#ifdef NCHAN_ISM_PARAMETER - for ( i = 0; i < nchan_ism; i++ ) -#else for ( i = 0; i < hParamIsm->num_obj; i++ ) -#endif { pcm_in[i] = &data[i][0]; @@ -439,18 +382,12 @@ void ivas_param_ism_enc( p_fb_RealBuffer[i] = &fb_RealBuffer[i][0]; p_fb_ImagBuffer[i] = &fb_ImagBuffer[i][0]; } - for ( ts = 0; ts < num_time_slots; ts++ ) { ivas_fb_mixer_get_windowed_fr( hDirAC->hFbMixer, pcm_in, p_fb_RealBuffer, p_fb_ImagBuffer, l_ts, l_ts ); - ivas_fb_mixer_update_prior_input( hDirAC->hFbMixer, pcm_in, l_ts ); -#ifdef NCHAN_ISM_PARAMETER - for ( i = 0; i < nchan_ism; i++ ) -#else for ( i = 0; i < hParamIsm->num_obj; i++ ) -#endif { pcm_in[i] += l_ts; for ( j = 0; j < DIRAC_NO_FB_BANDS_MAX; j++ ) @@ -459,27 +396,18 @@ void ivas_param_ism_enc( } } } - /* Quantize DOAs */ -#ifdef NCHAN_ISM_PARAMETER - ivas_param_ism_enc_quantize_DOA( nchan_ism, st_ivas->hIsmMetaData, hParamIsm ); -#else ivas_param_ism_enc_quantize_DOA( st_ivas->hIsmMetaData, hParamIsm ); -#endif /* Compute object indices and power ratios */ -#ifdef NCHAN_ISM_PARAMETER - ivas_param_ism_compute_obj_parameters( nchan_ism, reference_power_obj, hParamIsm ); -#else ivas_param_ism_compute_obj_parameters( reference_power_obj, hParamIsm ); -#endif pop_wmops(); return; } -#ifndef DISCRETE_ISM_DTX_CNG +#ifdef PARAM_ISM_DTX_CNG static void ivas_param_ism_enc_quantize_DOA_dtx( float azimuth, float elevation, @@ -546,14 +474,10 @@ static void ivas_param_ism_enc_quantize_DOA_dtx( *-------------------------------------------------------------------------*/ void ivas_param_ism_metadata_dtx_enc( - BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ - ISM_METADATA_HANDLE hIsmMeta[], /* i : ISM metadata handles */ - ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ - PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Enc Handle */ -#ifdef NCHAN_ISM_PARAMETER - , - const int16_t nchan_ism /* i : number of ISM channels */ -#endif + BSTR_ENC_HANDLE hBstr, /* i/o : bitstream handle */ + ISM_METADATA_HANDLE hIsmMeta[], /* i : ISM metadata handles */ + ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ + PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Enc Handle */ ) { int16_t i, nBits, nBits_unused; @@ -565,11 +489,7 @@ void ivas_param_ism_metadata_dtx_enc( /* Transmit the metadata */ /* write number of objects - unary coding */ -#ifdef NCHAN_ISM_PARAMETER - for ( i = 0; i < nchan_ism; i++ ) -#else for ( i = 1; i < hParamIsm->num_obj; i++ ) -#endif { push_indice( hBstr, IND_ISM_NUM_OBJECTS, 1, 1 ); } @@ -586,11 +506,7 @@ void ivas_param_ism_metadata_dtx_enc( assert( ( coh_idx >= 0 ) && ( coh_idx <= ( ( 1 << PARAM_ISM_DTX_COH_SCA_BITS ) - 1 ) ) ); push_indice( hBstr, IND_ISM_DTX_COH_SCA, coh_idx, PARAM_ISM_DTX_COH_SCA_BITS ); -#ifdef NCHAN_ISM_PARAMETER - for ( i = 0; i < nchan_ism; i++ ) -#else for ( i = 0; i < hParamIsm->num_obj; i++ ) -#endif { ivas_param_ism_enc_quantize_DOA_dtx( hIsmMeta[i]->azimuth, hIsmMeta[i]->elevation, PARAM_ISM_DTX_AZI_BITS, PARAM_ISM_DTX_ELE_BITS, &azi_idx, &ele_idx ); push_indice( hBstr, IND_ISM_AZIMUTH, azi_idx, PARAM_ISM_DTX_AZI_BITS ); @@ -616,7 +532,7 @@ void ivas_param_ism_metadata_dtx_enc( return; } -#endif + /*-------------------------------------------------------------------* * ivas_param_ism_compute_noisy_speech_flag() @@ -664,3 +580,4 @@ void ivas_param_ism_compute_noisy_speech_flag( return; } +#endif diff --git a/lib_enc/ivas_lfe_enc.c b/lib_enc/ivas_lfe_enc.c index 9a5b754942..fe2e0d3c02 100644 --- a/lib_enc/ivas_lfe_enc.c +++ b/lib_enc/ivas_lfe_enc.c @@ -491,27 +491,21 @@ ivas_error ivas_create_lfe_enc( *-------------------------------------------------------------------------*/ void ivas_lfe_enc_close( - LFE_ENC_HANDLE *hLFE /* i/o: LFE encoder handle */ + LFE_ENC_HANDLE hLFE /* i/o: LFE encoder handle */ ) { - if ( hLFE == NULL || *hLFE == NULL ) + if ( hLFE->old_wtda_audio != NULL ) { - return; + free( hLFE->old_wtda_audio ); + hLFE->old_wtda_audio = NULL; } - - if ( ( *hLFE )->old_wtda_audio != NULL ) - { - free( ( *hLFE )->old_wtda_audio ); - ( *hLFE )->old_wtda_audio = NULL; - } - if ( ( *hLFE )->pWindow_state ) + if ( hLFE->pWindow_state ) { - free( ( *hLFE )->pWindow_state ); - ( *hLFE )->pWindow_state = NULL; + free( hLFE->pWindow_state ); + hLFE->pWindow_state = NULL; } - free( ( *hLFE ) ); - ( *hLFE ) = NULL; + free( hLFE ); return; } diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index b5e100145d..eb685cd0bc 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -149,7 +149,7 @@ ivas_error ivas_masa_enc_open( *-----------------------------------------------------------------------*/ void ivas_masa_enc_close( - MASA_ENCODER_HANDLE *hMasa /* i/o: MASA metadata structure */ + MASA_ENCODER_HANDLE hMasa /* i/o: MASA metadata structure */ #ifndef FIX_350_MASA_DELAY_COMP , const int16_t nchan_transport, /* i : Number of transport channels */ @@ -159,14 +159,9 @@ void ivas_masa_enc_close( { int16_t i; - if ( hMasa == NULL || *hMasa == NULL ) - { - return; - } - - for ( i = 0; i < ( *hMasa )->data.num_Cldfb_instances; i++ ) + for ( i = 0; i < hMasa->data.num_Cldfb_instances; i++ ) { - deleteCldfb( &( ( *hMasa )->data.cldfbAnaEnc[i] ) ); + deleteCldfb( &( hMasa->data.cldfbAnaEnc[i] ) ); } #ifndef FIX_350_MASA_DELAY_COMP @@ -174,14 +169,13 @@ void ivas_masa_enc_close( { for ( i = 0; i < nchan_transport; i++ ) { - free( ( *hMasa )->data.delay_buffer[i] ); - ( *hMasa )->data.delay_buffer[i] = NULL; + free( hMasa->data.delay_buffer[i] ); + hMasa->data.delay_buffer[i] = NULL; } } #endif - free( ( *hMasa ) ); - ( *hMasa ) = NULL; + free( hMasa ); return; } @@ -595,11 +589,7 @@ ivas_error ivas_masa_enc_config( ivas_set_qmetadata_maxbit_req( hQMetaData, ivas_format ); -#ifdef FIX_373_MASA_DELAY_COMP_MSAN - masa_sample_rate_band_correction( &( hMasa->config ), hMasa->data.band_mapping, hQMetaData, st_ivas->hEncoderConfig->input_Fs, NULL ); -#else masa_sample_rate_band_correction( &( hMasa->config ), hMasa->data.band_mapping, hQMetaData, st_ivas->hEncoderConfig->input_Fs ); -#endif /* Transmit stereo signals using a mono downmix at lowest bitrates */ if ( ivas_format == MASA_FORMAT && st_ivas->nCPE == 1 && st_ivas->hCPE[0]->hStereoDft != NULL && st_ivas->hCPE[0]->hStereoDft->hConfig != NULL ) diff --git a/lib_enc/ivas_mc_param_enc.c b/lib_enc/ivas_mc_param_enc.c index db9945d0ce..9b1241f234 100644 --- a/lib_enc/ivas_mc_param_enc.c +++ b/lib_enc/ivas_mc_param_enc.c @@ -146,7 +146,11 @@ ivas_error ivas_param_mc_enc_open( } /* Allocate and initialize FB mixer handle */ +#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &( hParamMC->hFbMixer ), input_Fs, fb_cfg, 0 ) ) != IVAS_ERR_OK ) +#else + if ( ( error = ivas_FB_mixer_open( &( hParamMC->hFbMixer ), input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -360,20 +364,18 @@ ivas_error ivas_param_mc_enc_reconfig( *------------------------------------------------------------------------*/ void ivas_param_mc_enc_close( - PARAM_MC_ENC_HANDLE *hParamMC, /* i/o: Parametric MC encoder handle */ + PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ const int32_t sampling_rate ) { - if ( hParamMC == NULL || *hParamMC == NULL ) - { - return; - } - - ivas_param_mc_metadata_close( &( *hParamMC )->hMetadataPMC ); + ivas_param_mc_metadata_close( &hParamMC->hMetadataPMC ); - ivas_FB_mixer_close( &( *hParamMC )->hFbMixer, sampling_rate, 0 ); +#ifdef SBA_BR_SWITCHING_CLEAN_UP + ivas_FB_mixer_close( &hParamMC->hFbMixer, sampling_rate, 0 ); +#else + ivas_FB_mixer_close( &hParamMC->hFbMixer, sampling_rate ); +#endif - free( ( *hParamMC ) ); - ( *hParamMC ) = NULL; + free( hParamMC ); return; } @@ -386,10 +388,10 @@ void ivas_param_mc_enc_close( *------------------------------------------------------------------------*/ void ivas_param_mc_enc( - Encoder_Struct *st_ivas, /* i/o: IVAS Encoder handle */ - BSTR_ENC_HANDLE hMetaData, /* i/o: IVAS Metadata bitstream handle */ - float data_f[][L_FRAME48k], /* i/o: input: CICP6, CICP12, CICP14, CICP16 or CICP19 MC data */ - const int16_t input_frame /* i : input frame length */ + Encoder_Struct *st_ivas, /* i/o: IVAS Encoder handle */ + BSTR_ENC_HANDLE hMetaData, /* i/o: IVAS Metadata bitstream handle */ + float data_f[][L_FRAME48k], /* i/o: input: CICP6, CICP12, CICP14, CICP16 or CICP19 MC data */ + const int16_t input_frame /* i : input frame length */ ) { int16_t k; diff --git a/lib_enc/ivas_mcmasa_enc.c b/lib_enc/ivas_mcmasa_enc.c index 866e4e176c..153bc3ecad 100644 --- a/lib_enc/ivas_mcmasa_enc.c +++ b/lib_enc/ivas_mcmasa_enc.c @@ -194,7 +194,11 @@ ivas_error ivas_mcmasa_enc_open( } /* Allocate and initialize FB mixer handle */ +#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &( hMcMasa->hFbMixer ), input_Fs, fb_cfg, 0 ) ) != IVAS_ERR_OK ) +#else + if ( ( error = ivas_FB_mixer_open( &( hMcMasa->hFbMixer ), input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -224,7 +228,11 @@ ivas_error ivas_mcmasa_enc_open( return error; } +#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &( hMcMasa->hFbMixerLfe ), input_Fs, fb_cfgLfe, 0 ) ) != IVAS_ERR_OK ) +#else + if ( ( error = ivas_FB_mixer_open( &( hMcMasa->hFbMixerLfe ), input_Fs, fb_cfgLfe ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -451,11 +459,11 @@ ivas_error ivas_mcmasa_enc_reconfig( /* brute-force solution: close McMASA and re-instantiate with new settings */ #ifdef FIX_350_MASA_DELAY_COMP - ivas_masa_enc_close( &( st_ivas->hMasa ) ); + ivas_masa_enc_close( st_ivas->hMasa ); #else - ivas_masa_enc_close( &( st_ivas->hMasa ), st_ivas->nchan_transport, st_ivas->hEncoderConfig->ivas_format ); + ivas_masa_enc_close( st_ivas->hMasa, st_ivas->nchan_transport, st_ivas->hEncoderConfig->ivas_format ); #endif - ivas_mcmasa_enc_close( &( st_ivas->hMcMasa ), st_ivas->hEncoderConfig->input_Fs ); + ivas_mcmasa_enc_close( st_ivas->hMcMasa, st_ivas->hEncoderConfig->input_Fs ); /* Determine if to separate some channels from the analysis */ ivas_mcmasa_setNumTransportChannels( &( st_ivas->nchan_transport ), &( st_ivas->hEncoderConfig->element_mode_init ), ivas_total_brate ); @@ -483,33 +491,36 @@ ivas_error ivas_mcmasa_enc_reconfig( *--------------------------------------------------------------------------*/ void ivas_mcmasa_enc_close( - MCMASA_ENC_HANDLE *hMcMasa, /* i/o: encoder McMASA handle */ - const int32_t input_Fs /* i : input sampling rate */ + MCMASA_ENC_HANDLE hMcMasa, /* i/o: encoder McMASA handle */ + const int32_t input_Fs /* i : input sampling rate */ ) { int16_t i, j; - if ( hMcMasa == NULL || *hMcMasa == NULL ) - { - return; - } - - if ( ( *hMcMasa )->separateChannelEnabled ) + if ( hMcMasa->separateChannelEnabled ) { - free( ( *hMcMasa )->delay_buffer_lfe[0] ); - free( ( *hMcMasa )->delay_buffer_lfe[1] ); + free( hMcMasa->delay_buffer_lfe[0] ); + free( hMcMasa->delay_buffer_lfe[1] ); for ( i = 0; i < 2; i++ ) { - free( ( *hMcMasa )->lfeAnaRingBuffer[i] ); + free( hMcMasa->lfeAnaRingBuffer[i] ); } } - ivas_FB_mixer_close( &( *hMcMasa )->hFbMixer, input_Fs, 0 ); +#ifdef SBA_BR_SWITCHING_CLEAN_UP + ivas_FB_mixer_close( &hMcMasa->hFbMixer, input_Fs, 0 ); +#else + ivas_FB_mixer_close( &hMcMasa->hFbMixer, input_Fs ); +#endif - if ( !( *hMcMasa )->separateChannelEnabled ) + if ( !hMcMasa->separateChannelEnabled ) { - ivas_FB_mixer_close( &( *hMcMasa )->hFbMixerLfe, input_Fs, 0 ); +#ifdef SBA_BR_SWITCHING_CLEAN_UP + ivas_FB_mixer_close( &hMcMasa->hFbMixerLfe, input_Fs, 0 ); +#else + ivas_FB_mixer_close( &hMcMasa->hFbMixerLfe, input_Fs ); +#endif } /* intensity 3-dim */ @@ -517,36 +528,35 @@ void ivas_mcmasa_enc_close( { for ( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) { - free( ( *hMcMasa )->direction_vector_m[i][j] ); - ( *hMcMasa )->direction_vector_m[i][j] = NULL; + free( hMcMasa->direction_vector_m[i][j] ); + hMcMasa->direction_vector_m[i][j] = NULL; } - for ( j = 0; j < ( *hMcMasa )->no_col_avg_diff; j++ ) + for ( j = 0; j < hMcMasa->no_col_avg_diff; j++ ) { - free( ( *hMcMasa )->buffer_intensity_real[i][j] ); - ( *hMcMasa )->buffer_intensity_real[i][j] = NULL; + free( hMcMasa->buffer_intensity_real[i][j] ); + hMcMasa->buffer_intensity_real[i][j] = NULL; } - free( ( *hMcMasa )->buffer_intensity_real[i] ); - ( *hMcMasa )->buffer_intensity_real[i] = NULL; + free( hMcMasa->buffer_intensity_real[i] ); + hMcMasa->buffer_intensity_real[i] = NULL; - free( ( *hMcMasa )->direction_vector_m[i] ); - ( *hMcMasa )->direction_vector_m[i] = NULL; + free( hMcMasa->direction_vector_m[i] ); + hMcMasa->direction_vector_m[i] = NULL; } - for ( j = 0; j < ( *hMcMasa )->no_col_avg_diff; j++ ) + for ( j = 0; j < hMcMasa->no_col_avg_diff; j++ ) { - free( ( *hMcMasa )->buffer_intensity_real_vert[j] ); - ( *hMcMasa )->buffer_intensity_real_vert[j] = NULL; + free( hMcMasa->buffer_intensity_real_vert[j] ); + hMcMasa->buffer_intensity_real_vert[j] = NULL; } - free( ( *hMcMasa )->buffer_intensity_real_vert ); - ( *hMcMasa )->buffer_intensity_real_vert = NULL; + free( hMcMasa->buffer_intensity_real_vert ); + hMcMasa->buffer_intensity_real_vert = NULL; - free( ( *hMcMasa )->buffer_energy ); - ( *hMcMasa )->buffer_energy = NULL; + free( hMcMasa->buffer_energy ); + hMcMasa->buffer_energy = NULL; - free( ( *hMcMasa ) ); - ( *hMcMasa ) = NULL; + free( hMcMasa ); return; } diff --git a/lib_enc/ivas_mct_enc.c b/lib_enc/ivas_mct_enc.c index b66a2c5733..707e74e329 100644 --- a/lib_enc/ivas_mct_enc.c +++ b/lib_enc/ivas_mct_enc.c @@ -173,7 +173,8 @@ ivas_error ivas_mct_enc( } /* joint MCT encoding */ - ivas_mct_core_enc( ivas_format, hMCT, st_ivas->hCPE, hMCT->nchan_out_woLFE + hMCT->num_lfe, ivas_total_brate, switch_bw, ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCT ) ? (int16_t) st_ivas->hLFE->lfe_bits : 0, st_ivas->hEncoderConfig->sba_order ); + ivas_mct_core_enc( ivas_format, hMCT, st_ivas->hCPE, hMCT->nchan_out_woLFE + hMCT->num_lfe, ivas_total_brate, switch_bw, + ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCT ) ? (int16_t) st_ivas->hLFE->lfe_bits : 0, st_ivas->hEncoderConfig->sba_order ); /* Spectrum quantization and coding */ for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) @@ -498,35 +499,29 @@ ivas_error mct_enc_reconfigure( *-------------------------------------------------------------------------*/ void ivas_mct_enc_close( - MCT_ENC_HANDLE *hMCT /* i/o: MCT encoder structure */ + MCT_ENC_HANDLE hMCT /* i/o: MCT encoder structure */ ) { int16_t n, maxBlocks; - if ( hMCT == NULL || *hMCT == NULL ) - { - return; - } - - maxBlocks = ( *hMCT )->nchan_out_woLFE / 2; + maxBlocks = hMCT->nchan_out_woLFE / 2; for ( n = 0; n < maxBlocks; n++ ) { - if ( ( *hMCT )->hBlockData[n] != NULL ) + if ( hMCT->hBlockData[n] != NULL ) { - if ( ( *hMCT )->hBlockData[n]->hStereoMdct != NULL ) + if ( hMCT->hBlockData[n]->hStereoMdct != NULL ) { - free( ( *hMCT )->hBlockData[n]->hStereoMdct ); - ( *hMCT )->hBlockData[n]->hStereoMdct = NULL; + free( hMCT->hBlockData[n]->hStereoMdct ); + hMCT->hBlockData[n]->hStereoMdct = NULL; } - free( ( *hMCT )->hBlockData[n] ); - ( *hMCT )->hBlockData[n] = NULL; + free( hMCT->hBlockData[n] ); + hMCT->hBlockData[n] = NULL; } } - free( ( *hMCT ) ); - ( *hMCT ) = NULL; + free( hMCT ); return; } @@ -613,18 +608,34 @@ static ivas_error ivas_mc_enc_reconfig( } /*De-allocate handles for other MC modes*/ - ivas_param_mc_enc_close( &( st_ivas->hParamMC ), st_ivas->hEncoderConfig->input_Fs ); + if ( st_ivas->hParamMC != NULL ) + { + ivas_param_mc_enc_close( st_ivas->hParamMC, st_ivas->hEncoderConfig->input_Fs ); + st_ivas->hParamMC = NULL; + } /* De-allocate McMasa-related handles */ - ivas_mcmasa_enc_close( &( st_ivas->hMcMasa ), st_ivas->hEncoderConfig->input_Fs ); + if ( st_ivas->hMcMasa != NULL ) + { + ivas_mcmasa_enc_close( st_ivas->hMcMasa, st_ivas->hEncoderConfig->input_Fs ); + st_ivas->hMcMasa = NULL; + } + if ( st_ivas->hMasa != NULL ) + { #ifdef FIX_350_MASA_DELAY_COMP - ivas_masa_enc_close( &( st_ivas->hMasa ) ); + ivas_masa_enc_close( st_ivas->hMasa ); #else - ivas_masa_enc_close( &( st_ivas->hMasa ), nchan_transport_old, MC_FORMAT ); + ivas_masa_enc_close( st_ivas->hMasa, nchan_transport_old, MC_FORMAT ); #endif + st_ivas->hMasa = NULL; + } - ivas_qmetadata_close( &st_ivas->hQMetaData ); + if ( st_ivas->hQMetaData != NULL ) + { + ivas_qmetadata_close( &st_ivas->hQMetaData ); + st_ivas->hQMetaData = NULL; + } } } else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) @@ -645,30 +656,39 @@ static ivas_error ivas_mc_enc_reconfig( } /* De-allocate McMasa-related handles */ - ivas_mcmasa_enc_close( &( st_ivas->hMcMasa ), st_ivas->hEncoderConfig->input_Fs ); - + if ( st_ivas->hMcMasa != NULL ) + { + ivas_mcmasa_enc_close( st_ivas->hMcMasa, st_ivas->hEncoderConfig->input_Fs ); + st_ivas->hMcMasa = NULL; + } if ( st_ivas->hMasa != NULL ) { #ifdef FIX_350_MASA_DELAY_COMP - ivas_masa_enc_close( &( st_ivas->hMasa ) ); + ivas_masa_enc_close( st_ivas->hMasa ); #else - ivas_masa_enc_close( &( st_ivas->hMasa ), nchan_transport_old, MC_FORMAT ); + ivas_masa_enc_close( st_ivas->hMasa, nchan_transport_old, MC_FORMAT ); #endif st_ivas->hMasa = NULL; } - ivas_qmetadata_close( &st_ivas->hQMetaData ); + if ( st_ivas->hQMetaData != NULL ) + { + ivas_qmetadata_close( &st_ivas->hQMetaData ); + st_ivas->hQMetaData = NULL; + } /* De-allocate MCT handle if last mode was MCT */ - if ( last_mc_mode == MC_MODE_MCT && st_ivas->nchan_transport <= CPE_CHANNELS ) + if ( last_mc_mode == MC_MODE_MCT && st_ivas->hMCT != NULL && st_ivas->nchan_transport <= CPE_CHANNELS ) { - ivas_mct_enc_close( &( st_ivas->hMCT ) ); + ivas_mct_enc_close( st_ivas->hMCT ); + st_ivas->hMCT = NULL; } if ( last_mc_mode == MC_MODE_MCT && st_ivas->hLFE != NULL ) { /* LFE handle */ - ivas_lfe_enc_close( &( st_ivas->hLFE ) ); + ivas_lfe_enc_close( st_ivas->hLFE ); + st_ivas->hLFE = NULL; } } else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) @@ -701,14 +721,26 @@ static ivas_error ivas_mc_enc_reconfig( } } - ivas_param_mc_enc_close( &( st_ivas->hParamMC ), st_ivas->hEncoderConfig->input_Fs ); + if ( st_ivas->hParamMC != NULL ) + { + ivas_param_mc_enc_close( st_ivas->hParamMC, st_ivas->hEncoderConfig->input_Fs ); + st_ivas->hParamMC = NULL; + } if ( last_mc_mode == MC_MODE_MCT ) { /* LFE handle */ - ivas_lfe_enc_close( &( st_ivas->hLFE ) ); + if ( st_ivas->hLFE != NULL ) + { + ivas_lfe_enc_close( st_ivas->hLFE ); + st_ivas->hLFE = NULL; + } - ivas_mct_enc_close( &( st_ivas->hMCT ) ); + if ( st_ivas->hMCT != NULL ) + { + ivas_mct_enc_close( st_ivas->hMCT ); + st_ivas->hMCT = NULL; + } } } diff --git a/lib_enc/ivas_mdct_core_enc.c b/lib_enc/ivas_mdct_core_enc.c old mode 100755 new mode 100644 index ef9264d5df..626dcf2631 --- a/lib_enc/ivas_mdct_core_enc.c +++ b/lib_enc/ivas_mdct_core_enc.c @@ -686,7 +686,6 @@ void ivas_mdct_core_whitening_enc( core_signal_analysis_high_bitrate( new_samples[ch] + L_INP_MEM, T_op[ch], NULL, NULL, st, mdst_spectrum[ch], tnsSize[ch], tnsBits[ch], param_core[ch], <pBits[ch], windowedSignal[ch], st->L_frame, st->hTcxEnc->L_frameTCX, hCPE->last_element_mode, 0 ); /* BWD in MDCT domain */ -#ifndef FIX_MDCT_BASED_BWD if ( st->hTcxEnc->transform_type[0] == TCX_20 && st->hTcxCfg->tcx_last_overlap_mode != TRANSITION_OVERLAP ) { if ( st->mct_chan_mode != MCT_CHAN_MODE_LFE ) @@ -694,22 +693,6 @@ void ivas_mdct_core_whitening_enc( bw_detect( st, NULL, st->hTcxEnc->spectrum[0], NULL ); } } -#else - if ( st->mct_chan_mode != MCT_CHAN_MODE_LFE && st->hTcxCfg->tcx_last_overlap_mode != TRANSITION_OVERLAP ) - { - nSubframes = ( st->hTcxEnc->tcxMode == TCX_20 ) ? 1 : NB_DIV; - - for ( n = 0; n < nSubframes; n++ ) - { - bw_detect( st, NULL, st->hTcxEnc->spectrum[n], NULL, mct_on ); - - if ( nSubframes == NB_DIV && n == 0 ) - { - st->last_input_bwidth = st->input_bwidth; - } - } - } -#endif if ( st->last_core == ACELP_CORE ) /* reset past kernel info */ { diff --git a/lib_enc/ivas_sba_enc.c b/lib_enc/ivas_sba_enc.c index d3aab0a6e8..e878d74183 100644 --- a/lib_enc/ivas_sba_enc.c +++ b/lib_enc/ivas_sba_enc.c @@ -120,10 +120,14 @@ ivas_error ivas_sba_enc_reconfigure( DIRAC_ENC_HANDLE hDirAC = st_ivas->hDirAC; SPAR_ENC_HANDLE hSpar; SBA_MODE sba_mode_old; +#ifdef SBA_HPF_TUNING_ENC int16_t analysis_order_old; +#endif +#ifdef SBA_BR_SWITCHING_CLEAN_UP int16_t spar_reconfig_flag; spar_reconfig_flag = 0; +#endif nchan_transport_old = st_ivas->nchan_transport; nCPE_old = st_ivas->nCPE; nSCE_old = st_ivas->nSCE; @@ -132,6 +136,7 @@ ivas_error ivas_sba_enc_reconfigure( st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, hEncoderConfig->sba_order ); st_ivas->sba_mode = ivas_sba_mode_select( ivas_total_brate ); +#ifdef SBA_HPF_TUNING_ENC analysis_order_old = ivas_sba_get_analysis_order( hEncoderConfig->last_ivas_total_brate, hEncoderConfig->sba_order ); if ( analysis_order_old != st_ivas->sba_analysis_order ) @@ -199,12 +204,17 @@ ivas_error ivas_sba_enc_reconfigure( old_mem_hp20_in = NULL; } } +#endif if ( st_ivas->sba_mode == SBA_MODE_SPAR ) { if ( st_ivas->hSpar == NULL ) { +#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_spar_enc_open( st_ivas, spar_reconfig_flag ) ) != IVAS_ERR_OK ) +#else + if ( ( error = ivas_spar_enc_open( st_ivas ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -213,6 +223,7 @@ ivas_error ivas_sba_enc_reconfigure( ivas_spar_config( ivas_total_brate, min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ), &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->hSpar->core_nominal_brate, -1 ); +#ifdef SBA_BR_SWITCHING_CLEAN_UP for ( n = 0; n < DIRAC_MAX_ANA_CHANS; n++ ) { if ( hDirAC->sba_synchro_buffer[n] != NULL ) @@ -222,10 +233,17 @@ ivas_error ivas_sba_enc_reconfigure( } } hDirAC->num_samples_synchro_delay = 0; +#endif } else { - ivas_spar_enc_close( &( st_ivas->hSpar ), hEncoderConfig->input_Fs, hEncoderConfig->nchan_inp, spar_reconfig_flag ); +#ifdef SBA_BR_SWITCHING_CLEAN_UP + ivas_spar_enc_close( st_ivas->hSpar, hEncoderConfig->input_Fs, hEncoderConfig->nchan_inp, spar_reconfig_flag ); + +#else + ivas_spar_enc_close( st_ivas->hSpar, hEncoderConfig->input_Fs, hEncoderConfig->nchan_inp ); +#endif + st_ivas->hSpar = NULL; } hSpar = st_ivas->hSpar; @@ -246,19 +264,68 @@ ivas_error ivas_sba_enc_reconfigure( { if ( hDirAC->hFbMixer != NULL ) { +#ifndef SBA_BR_SWITCHING_CLEAN_UP + ivas_FB_mixer_close( &( hDirAC->hFbMixer ), hEncoderConfig->input_Fs ); +#else ivas_FB_mixer_close( &( hDirAC->hFbMixer ), hEncoderConfig->input_Fs, 0 ); +#endif hDirAC->hFbMixer = NULL; } if ( sba_mode_old == SBA_MODE_SPAR ) { +#ifndef SBA_BR_SWITCHING_CLEAN_UP + IVAS_FB_CFG *fb_cfg; + int16_t nchan_internal, sba_order_internal; + int16_t table_idx, active_w_mixing; + + sba_order_internal = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ); + nchan_internal = ivas_sba_get_nchan_metadata( sba_order_internal ); + + /* Covar. State handle */ + ivas_spar_covar_enc_close( &hSpar->hCovEnc, hSpar->hFbMixer->fb_cfg->num_in_chans ); + + /* MD handle */ + ivas_spar_md_enc_close( &hSpar->hMdEnc ); + + if ( ( error = ivas_spar_md_enc_open( &( hSpar->hMdEnc ), hEncoderConfig, sba_order_internal ) ) != IVAS_ERR_OK ) + { + return error; + } + + /*Initialization*/ + hSpar->hMdEnc->table_idx = -1; + + /* FB mixer handle */ + ivas_FB_mixer_close( &hSpar->hFbMixer, hEncoderConfig->input_Fs ); + + table_idx = ivas_get_spar_table_idx( ivas_total_brate, sba_order_internal, SPAR_CONFIG_BW, NULL, NULL ); + active_w_mixing = ivas_spar_br_table_consts[table_idx].active_w; + if ( ( error = ivas_fb_set_cfg( &fb_cfg, SBA_FORMAT, SBA_MODE_SPAR, nchan_internal, st_ivas->nchan_transport, active_w_mixing, hEncoderConfig->input_Fs ) ) != IVAS_ERR_OK ) + { + return error; + } + fb_cfg->remix_order = remix_order_set[hSpar->hMdEnc->spar_md_cfg.remix_unmix_order]; + + if ( ( error = ivas_FB_mixer_open( &( hSpar->hFbMixer ), hEncoderConfig->input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* Covar. State handle */ + if ( ( error = ivas_spar_covar_enc_open( &( hSpar->hCovEnc ), hSpar->hFbMixer->pFb, hEncoderConfig->input_Fs, nchan_internal ) ) != IVAS_ERR_OK ) + { + return error; + } +#else spar_reconfig_flag = 1; - ivas_spar_enc_close( &( st_ivas->hSpar ), hEncoderConfig->input_Fs, hEncoderConfig->nchan_inp, spar_reconfig_flag ); + ivas_spar_enc_close( st_ivas->hSpar, hEncoderConfig->input_Fs, hEncoderConfig->nchan_inp, spar_reconfig_flag ); if ( ( error = ivas_spar_enc_open( st_ivas, spar_reconfig_flag ) ) != IVAS_ERR_OK ) { return error; } +#endif } } else @@ -273,7 +340,11 @@ ivas_error ivas_sba_enc_reconfigure( } /* Allocate and initialize FB mixer handle */ +#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), hEncoderConfig->input_Fs, fb_cfg, 0 ) ) != IVAS_ERR_OK ) +#else + if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), hEncoderConfig->input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -297,6 +368,43 @@ ivas_error ivas_sba_enc_reconfigure( } } } +#ifndef SBA_BR_SWITCHING_CLEAN_UP + /* initialize delay for SPAR/DirAC delay synchronization */ + if ( ( st_ivas->sba_mode == SBA_MODE_DIRAC ) && ( ( sba_mode_old != st_ivas->sba_mode ) || ( nchan_transport_old != st_ivas->nchan_transport ) ) ) + { + if ( hDirAC->num_samples_synchro_delay == 0 ) + { + hDirAC->num_samples_synchro_delay = NS2SA( hEncoderConfig->input_Fs, IVAS_FB_ENC_DELAY_NS ); + + for ( n = 0; n < DIRAC_MAX_ANA_CHANS; n++ ) + { + if ( ( hDirAC->sba_synchro_buffer[n] = (float *) malloc( hDirAC->num_samples_synchro_delay * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hDirAC synchro buffer\n" ) ); + } + set_zero( hDirAC->sba_synchro_buffer[n], hDirAC->num_samples_synchro_delay ); + } + for ( ; n < DIRAC_MAX_ANA_CHANS; n++ ) + { + hDirAC->sba_synchro_buffer[n] = NULL; + } + } + } + else + { + for ( n = 0; n < DIRAC_MAX_ANA_CHANS; n++ ) + { + if ( hDirAC->sba_synchro_buffer[n] != NULL ) + { + free( hDirAC->sba_synchro_buffer[n] ); + hDirAC->sba_synchro_buffer[n] = NULL; + } + } + hDirAC->num_samples_synchro_delay = 0; + } + + +#endif } if ( ( error = ivas_dirac_enc_reconfigure( st_ivas ) ) != IVAS_ERR_OK ) diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index a713c4273c..03cc8d9028 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -180,12 +180,21 @@ ivas_error ivas_sce_enc( * Front Pre-processing *----------------------------------------------------------------*/ +#ifdef LOW_RATE_TRANS_CORE_CODER error = pre_proc_front_ivas( hSCE, NULL, hSCE->element_brate, nb_bits_metadata, input_frame, 0, old_inp_12k8[0], old_inp_16k[0], &ener[0], &relE[0], A[0], Aw[0], epsP[0], lsp_new[0], lsp_mid[0], &vad_hover_flag[0], &attack_flag[0], realBuffer[0], imagBuffer[0], old_wsp[0], pitch_fr[0], voicing_fr[0], &loc_harm[0], &cor_map_sum[0], &vad_flag_dtx[0], enerBuffer[0], fft_buff[0], A[0], lsp_new[0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, flag_16k_smc, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->force_front_vad : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_dtx_flag : 0, st_ivas->hEncoderConfig->ivas_total_brate ); +#else + error = pre_proc_front_ivas( hSCE, NULL, hSCE->element_brate, nb_bits_metadata, input_frame, 0, old_inp_12k8[0], old_inp_16k[0], + &ener[0], &relE[0], A[0], Aw[0], epsP[0], lsp_new[0], lsp_mid[0], + &vad_hover_flag[0], &attack_flag[0], realBuffer[0], imagBuffer[0], old_wsp[0], pitch_fr[0], voicing_fr[0], &loc_harm[0], &cor_map_sum[0], &vad_flag_dtx[0], enerBuffer[0], + fft_buff[0], A[0], lsp_new[0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, flag_16k_smc, + st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->force_front_vad : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_dtx_flag : 0, + st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->hEncoderConfig->ivas_format ); +#endif if ( error != IVAS_ERR_OK ) { return error; @@ -251,8 +260,10 @@ ivas_error ivas_sce_enc( hSCE->last_element_brate = hSCE->element_brate; +#ifdef LOW_RATE_TRANS_CORE_CODER /* Store previous attack detection flag */ st->hTranDet->transientDetector.prev_bIsAttackPresent = st->hTranDet->transientDetector.bIsAttackPresent; +#endif #ifdef DEBUG_MODE_INFO { @@ -345,11 +356,17 @@ ivas_error create_sce_enc( st->total_brate = hSCE->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; +#ifdef PARAM_ISM_DTX_CNG if ( ( error = init_encoder( st, #ifdef IND_LIST_DYN st_ivas->hEncoderConfig, #endif 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) +#else + if ( ( error = init_encoder( st, +#ifdef IND_LIST_DYN + st_ivas->hEncoderConfig, +#endif 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0 ) ) != IVAS_ERR_OK ) #endif { diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 2a9909286d..43058148d4 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -58,8 +58,11 @@ static ivas_error ivas_spar_enc_process( Encoder_Struct *st_ivas, const ENCODER_ *------------------------------------------------------------------------*/ ivas_error ivas_spar_enc_open( - Encoder_Struct *st_ivas, /* i/o: IVAS encoder handle */ + Encoder_Struct *st_ivas /* i/o: IVAS encoder handle */ +#ifdef SBA_BR_SWITCHING_CLEAN_UP + , const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ +#endif ) { SPAR_ENC_HANDLE hSpar; @@ -72,16 +75,20 @@ ivas_error ivas_spar_enc_open( hEncoderConfig = st_ivas->hEncoderConfig; error = IVAS_ERR_OK; +#ifdef SBA_BR_SWITCHING_CLEAN_UP hSpar = st_ivas->hSpar; if ( !spar_reconfig_flag ) { +#endif /* SPAR encoder handle */ if ( ( hSpar = (SPAR_ENC_HANDLE) malloc( sizeof( SPAR_ENC_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR encoder" ); } +#ifdef SBA_BR_SWITCHING_CLEAN_UP } +#endif input_Fs = hEncoderConfig->input_Fs; sba_order_internal = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ); @@ -106,8 +113,12 @@ ivas_error ivas_spar_enc_open( ivas_fb_set_cfg( &fb_cfg, SBA_FORMAT, SBA_MODE_SPAR, nchan_inp, nchan_transport, active_w_mixing, input_Fs ); fb_cfg->remix_order = remix_order_set[hSpar->hMdEnc->spar_md_cfg.remix_unmix_order]; - /* FB mixer handle */ +/* FB mixer handle */ +#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &( hSpar->hFbMixer ), input_Fs, fb_cfg, spar_reconfig_flag ) ) != IVAS_ERR_OK ) +#else + if ( ( error = ivas_FB_mixer_open( &( hSpar->hFbMixer ), input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -118,14 +129,18 @@ ivas_error ivas_spar_enc_open( return error; } +#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { +#endif /* Transient Detector handle */ if ( ( error = ivas_transient_det_open( &( hSpar->hTranDet ), input_Fs ) ) != IVAS_ERR_OK ) { return error; } +#ifdef SBA_BR_SWITCHING_CLEAN_UP } +#endif /* initialization */ hSpar->hMdEnc->table_idx = -1; @@ -179,8 +194,10 @@ ivas_error ivas_spar_enc_open( * Allocate and initialize Front-VAD handle *-----------------------------------------------------------------*/ +#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { +#endif hSpar->front_vad_flag = 0; hSpar->front_vad_dtx_flag = 0; hSpar->force_front_vad = 0; @@ -202,11 +219,17 @@ ivas_error ivas_spar_enc_open( hSpar->hCoreCoderVAD->total_brate = hEncoderConfig->ivas_total_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ hSpar->hCoreCoderVAD->mct_chan_mode = MCT_CHAN_MODE_IGNORE; +#ifdef PARAM_ISM_DTX_CNG if ( ( error = init_encoder( hSpar->hCoreCoderVAD, #ifdef IND_LIST_DYN hEncoderConfig, #endif 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) +#else + if ( ( error = init_encoder( hSpar->hCoreCoderVAD, +#ifdef IND_LIST_DYN + hEncoderConfig, +#endif 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1 ) ) != IVAS_ERR_OK ) #endif { @@ -218,7 +241,9 @@ ivas_error ivas_spar_enc_open( hSpar->hCoreCoderVAD = NULL; hSpar->hFrontVad = NULL; } +#ifdef SBA_BR_SWITCHING_CLEAN_UP } +#endif /*-----------------------------------------------------------------* * Final assignment @@ -237,66 +262,81 @@ ivas_error ivas_spar_enc_open( *------------------------------------------------------------------------*/ void ivas_spar_enc_close( - SPAR_ENC_HANDLE *hSpar, /* i/o: SPAR encoder handle */ - const int32_t input_Fs, /* i : input sampling rate */ - const int16_t nchan_inp, /* i : number of input channels */ + SPAR_ENC_HANDLE hSpar, /* i/o: SPAR encoder handle */ + const int32_t input_Fs, /* i : input sampling rate */ + const int16_t nchan_inp /* i : number of input channels */ +#ifdef SBA_BR_SWITCHING_CLEAN_UP + , const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ +#endif ) { int16_t num_chans; - if ( hSpar == NULL || *hSpar == NULL ) - { - return; - } - - if ( !spar_reconfig_flag ) + if ( hSpar != NULL ) { - /* core-coder-VAD handle */ - if ( ( *hSpar )->hCoreCoderVAD != NULL ) +#ifdef SBA_BR_SWITCHING_CLEAN_UP + if ( !spar_reconfig_flag ) { - destroy_core_enc( ( *hSpar )->hCoreCoderVAD ); - ( *hSpar )->hCoreCoderVAD = NULL; - } +#endif + /* core-coder-VAD handle */ + if ( hSpar->hCoreCoderVAD != NULL ) + { + destroy_core_enc( hSpar->hCoreCoderVAD ); + hSpar->hCoreCoderVAD = NULL; + } - /* front-VAD handle */ - if ( ( *hSpar )->hFrontVad != NULL ) - { - front_vad_destroy( &( *hSpar )->hFrontVad ); - ( *hSpar )->hFrontVad = NULL; + /* front-VAD handle */ + if ( hSpar->hFrontVad != NULL ) + { + front_vad_destroy( &hSpar->hFrontVad ); + hSpar->hFrontVad = NULL; + } +#ifdef SBA_BR_SWITCHING_CLEAN_UP } - } +#endif - num_chans = ( *hSpar )->hFbMixer->fb_cfg->num_in_chans; - assert( num_chans <= nchan_inp ); + num_chans = hSpar->hFbMixer->fb_cfg->num_in_chans; + assert( num_chans <= nchan_inp ); - /* MD handle */ - ivas_spar_md_enc_close( &( *hSpar )->hMdEnc ); + /* MD handle */ + ivas_spar_md_enc_close( &hSpar->hMdEnc ); - /* Covar. State handle */ - ivas_spar_covar_enc_close( &( *hSpar )->hCovEnc, num_chans ); + /* Covar. State handle */ + ivas_spar_covar_enc_close( &hSpar->hCovEnc, num_chans ); - /* FB mixer handle */ - ivas_FB_mixer_close( &( *hSpar )->hFbMixer, input_Fs, spar_reconfig_flag ); + /* FB mixer handle */ +#ifdef SBA_BR_SWITCHING_CLEAN_UP + ivas_FB_mixer_close( &hSpar->hFbMixer, input_Fs, spar_reconfig_flag ); +#else + ivas_FB_mixer_close( &hSpar->hFbMixer, input_Fs ); - /* AGC */ - ivas_spar_agc_enc_close( &( *hSpar )->hAgcEnc ); + /* Trans Det handle */ + ivas_transient_det_close( &hSpar->hTranDet ); +#endif - /* PCA */ - if ( ( *hSpar )->hPCA != NULL ) - { - free( ( *hSpar )->hPCA ); - ( *hSpar )->hPCA = NULL; - } + /* AGC */ + ivas_spar_agc_enc_close( &hSpar->hAgcEnc ); - if ( !spar_reconfig_flag ) - { - /* Trans Det handle */ - ivas_transient_det_close( &( *hSpar )->hTranDet ); - free( ( *hSpar ) ); - ( *hSpar ) = NULL; - } + /* PCA */ + if ( hSpar->hPCA != NULL ) + { + free( hSpar->hPCA ); + hSpar->hPCA = NULL; + } +#ifdef SBA_BR_SWITCHING_CLEAN_UP + if ( !spar_reconfig_flag ) + { + /* Trans Det handle */ + ivas_transient_det_close( &hSpar->hTranDet ); +#endif + free( hSpar ); + hSpar = NULL; +#ifdef SBA_BR_SWITCHING_CLEAN_UP + } +#endif + } return; } @@ -398,7 +438,11 @@ static ivas_error ivas_spar_enc_process( float pcm_tmp[IVAS_SPAR_MAX_CH][L_FRAME48k * 2]; float *p_pcm_tmp[IVAS_SPAR_MAX_CH]; int16_t i, j, b, i_ts, input_frame, dtx_vad; +#ifdef SMOOTH_WITH_TRANS_DET int16_t transient_det[2]; +#else + int16_t transient_det; +#endif int32_t ivas_total_brate, input_Fs; float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; float *cov_dtx_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; @@ -441,11 +485,15 @@ static ivas_error ivas_spar_enc_process( * Transient detector *-----------------------------------------------------------------------------------------*/ +#ifdef SMOOTH_WITH_TRANS_DET ivas_transient_det_process( hSpar->hTranDet, data_f[0], input_frame, transient_det ); if ( sba_order == 1 ) { transient_det[1] = transient_det[0]; } +#else + transient_det = ivas_transient_det_process( hSpar->hTranDet, data_f[0], input_frame ); +#endif /* store previous input samples for W in local buffer */ assert( num_del_samples <= IVAS_FB_1MS_48K_SAMP ); diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 44fb18dbc2..6b2492ebb4 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -225,11 +225,6 @@ void ivas_spar_md_enc_close( int16_t num_channels, i, j; ivas_spar_md_enc_state_t *hMdEnc; - if ( hMdEnc_in == NULL || *hMdEnc_in == NULL ) - { - return; - } - hMdEnc = *hMdEnc_in; num_channels = hMdEnc->num_umx_ch; @@ -255,6 +250,7 @@ void ivas_spar_md_enc_close( { for ( i = 0; i < num_channels; i++ ) { + for ( j = 0; j < num_channels; j++ ) { free( hMdEnc->cov_real[i][j] ); @@ -268,6 +264,7 @@ void ivas_spar_md_enc_close( { for ( i = 0; i < num_channels; i++ ) { + for ( j = 0; j < num_channels; j++ ) { free( hMdEnc->cov_dtx_real[i][j] ); @@ -291,8 +288,11 @@ void ivas_spar_md_enc_close( free( hMdEnc->mixer_mat_local ); } - free( *hMdEnc_in ); - *hMdEnc_in = NULL; + if ( hMdEnc != NULL ) + { + free( hMdEnc ); + hMdEnc = NULL; + } return; } diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index a56f6423d3..e450990254 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -550,6 +550,7 @@ typedef struct ivas_stereo_classifier_data_structure } STEREO_CLASSIF_DATA, *STEREO_CLASSIF_HANDLE; +#ifdef PARAM_ISM_DTX_CNG /*----------------------------------------------------------------------------------* * ISM DTX structure *----------------------------------------------------------------------------------*/ @@ -559,16 +560,13 @@ typedef struct int16_t dtx_flag; int16_t sce_id_dtx; -#ifdef DISCRETE_ISM_DTX_CNG - int16_t cnt_SID_ISM; -#else int16_t dtx_speech_buffer_enc[PARAM_ISM_HYS_BUF_SIZE]; -#endif float long_term_energy_stereo_dmx_enc[MAX_NUM_OBJECTS][PARAM_ISM_HYS_BUF_SIZE]; float coh[MAX_NUM_OBJECTS]; } ISM_DTX_DATA, *ISM_DTX_HANDLE; +#endif /*----------------------------------------------------------------------------------* * Front-VAD structure @@ -1014,15 +1012,9 @@ typedef struct encoder_config_structure int16_t element_mode_init; /* element mode used at initialization */ int16_t stereo_dmx_evs; /* flag to indicate that stereo downmix for EVS encoder */ -#ifdef NCHAN_ISM_PARAMETER - int16_t nchan_ism; /* number of ISM channels */ -#endif int16_t sba_order; /* Ambisonic (SBA) order */ int16_t sba_planar; /* Ambisonic (SBA) planar flag */ MC_LS_SETUP mc_input_setup; /* multichannel input ls setup */ -#ifdef TD5 - int16_t ism_extended_metadata_flag; /* flag indicating extended metadata encoding, including radius and orientation (yaw, pitch) in ISM format */ -#endif int16_t Opt_AMR_WB; /* flag indicating AMR-WB IO mode */ @@ -1079,7 +1071,9 @@ typedef struct /* multichannel modules */ ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS]; /* ISM metadata handles (storage for one frame of read ISM metadata) */ +#ifdef PARAM_ISM_DTX_CNG ISM_DTX_HANDLE hISMDTX; /* ISM DTX handle */ +#endif DIRAC_ENC_HANDLE hDirAC; /* DirAC data handle */ SPAR_ENC_HANDLE hSpar; /* SPAR encoder handle */ MASA_ENCODER_HANDLE hMasa; /* MASA encoder data and configuration */ diff --git a/lib_enc/ivas_stereo_dmx_evs.c b/lib_enc/ivas_stereo_dmx_evs.c index a5c0fe147f..052970fa70 100644 --- a/lib_enc/ivas_stereo_dmx_evs.c +++ b/lib_enc/ivas_stereo_dmx_evs.c @@ -946,22 +946,16 @@ ivas_error stereo_dmx_evs_init_encoder( *-------------------------------------------------------------------*/ void stereo_dmx_evs_close_encoder( - STEREO_DMX_EVS_ENC_HANDLE *hStereoDmxEVS /* i/o: Stereo downmix for EVS encoder handle */ + STEREO_DMX_EVS_ENC_HANDLE hStereoDmxEVS /* i/o: Stereo downmix for EVS encoder handle */ ) { - if ( hStereoDmxEVS == NULL || *hStereoDmxEVS == NULL ) + if ( hStereoDmxEVS->hPOC != NULL ) { - return; + free( hStereoDmxEVS->hPOC ); + hStereoDmxEVS->hPOC = NULL; } - if ( ( *hStereoDmxEVS )->hPOC != NULL ) - { - free( ( *hStereoDmxEVS )->hPOC ); - ( *hStereoDmxEVS )->hPOC = NULL; - } - - free( ( *hStereoDmxEVS ) ); - ( *hStereoDmxEVS ) = NULL; + free( hStereoDmxEVS ); return; } diff --git a/lib_enc/ivas_tcx_core_enc.c b/lib_enc/ivas_tcx_core_enc.c index 40a97cc33e..3971c6740e 100644 --- a/lib_enc/ivas_tcx_core_enc.c +++ b/lib_enc/ivas_tcx_core_enc.c @@ -457,7 +457,11 @@ void stereo_tcx_core_enc( mvr2r( lsp_q, st->lsp_old, M ); } +#ifdef PARAM_ISM_DTX_CNG if ( st->Opt_DTX_ON && !st->tcxonly && st->hTdCngEnc != NULL ) +#else + if ( st->Opt_DTX_ON && !st->tcxonly ) +#endif { /* update CNG parameters in active frames */ if ( st->bwidth == NB && st->enableTcxLpc && st->core != ACELP_CORE ) diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index f3db751e0a..1b771a041c 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -364,12 +364,7 @@ ivas_error IVAS_ENC_ConfigureForObjects( const bool max_bwidth_user, /* i : shows if bandwidth limitation was set by the user (true) or if default bandwidth was used (false) */ const IVAS_ENC_BANDWIDTH maxBandwidth, /* i : bandwidth limitation */ const IVAS_ENC_DTX_CONFIG dtxConfig, /* i : configuration of DTX, can by set to default by using IVAS_ENC_GetDefaultDtxConfig() */ -#ifdef TD5 - const uint16_t numObjects, /* i : number of objects to be encoded */ - const bool ism_extended_metadata /* i : Extended metadata used (true/false), where extended metadata includes radius and orientation */ -#else - const uint16_t numObjects /* i : number of objects to be encoded */ -#endif + const uint16_t numObjects /* i : number of objects to be encoded */ ) { Encoder_Struct *st_ivas; @@ -389,12 +384,7 @@ ivas_error IVAS_ENC_ConfigureForObjects( st_ivas->hEncoderConfig->ivas_format = ISM_FORMAT; st_ivas->hEncoderConfig->element_mode_init = IVAS_SCE; st_ivas->hEncoderConfig->nchan_inp = numObjects; -#ifdef NCHAN_ISM_PARAMETER - st_ivas->hEncoderConfig->nchan_ism = numObjects; -#endif -#ifdef TD5 - st_ivas->hEncoderConfig->ism_extended_metadata_flag = ism_extended_metadata; -#endif + hIvasEnc->maxBandwidthUser = max_bwidth_user; error = configureEncoder( hIvasEnc, inputFs, bitrate, maxBandwidth, dtxConfig, IVAS_ENC_GetDefaultChannelAwareConfig() ); @@ -434,12 +424,7 @@ ivas_error IVAS_ENC_FeedObjectMetadata( return IVAS_ERR_INDEX_OUT_OF_BOUNDS; } -#ifdef TD5 - error = ivas_set_ism_metadata( hIvasEnc->st_ivas->hIsmMetaData[ismIndex], metadata.azimuth, metadata.elevation, metadata.radius, metadata.yaw, metadata.pitch ); -#else error = ivas_set_ism_metadata( hIvasEnc->st_ivas->hIsmMetaData[ismIndex], metadata.azimuth, metadata.elevation ); -#endif - if ( error != IVAS_ERR_OK ) { return error; @@ -886,16 +871,22 @@ static ivas_error configureEncoder( return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "8kHz input sampling rate is not supported in IVAS." ); } +#ifdef PARAM_ISM_DTX_CNG if ( hEncoderConfig->Opt_DTX_ON && hEncoderConfig->ivas_format != MONO_FORMAT && - ( -#ifndef DISCRETE_ISM_DTX_CNG - ( hEncoderConfig->ivas_format == ISM_FORMAT && hEncoderConfig->nchan_inp == 2 ) || // ToDo: see Issue 113 - ( hEncoderConfig->ivas_format == ISM_FORMAT && hEncoderConfig->nchan_inp > 2 && hEncoderConfig->ivas_total_brate != IVAS_24k4 && hEncoderConfig->ivas_total_brate != IVAS_32k ) || // ParamISM + ( ( hEncoderConfig->ivas_format == ISM_FORMAT && hEncoderConfig->nchan_inp == 2 ) || // ToDo: see Issue 113 + ( hEncoderConfig->ivas_format == ISM_FORMAT && hEncoderConfig->nchan_inp > 2 && hEncoderConfig->ivas_total_brate != IVAS_24k4 && hEncoderConfig->ivas_total_brate != IVAS_32k ) || // ParamISM + ( hEncoderConfig->ivas_format == MASA_FORMAT && hEncoderConfig->ivas_total_brate > IVAS_128k ) || // ToDo: remove the bitrate limitation + ( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_get_sba_num_TCs( hEncoderConfig->ivas_total_brate, 1 ) > 2 ) || // ToDo: support for 3+ TCs to be done + hEncoderConfig->ivas_format == MC_FORMAT // ToDo: TBD + ) ) +#else + if ( hEncoderConfig->Opt_DTX_ON && hEncoderConfig->ivas_format != MONO_FORMAT && + ( ( hEncoderConfig->ivas_format == ISM_FORMAT && hEncoderConfig->nchan_inp > 1 ) || // ToDo: see Issue 113 + ( hEncoderConfig->ivas_format == MASA_FORMAT && hEncoderConfig->ivas_total_brate > IVAS_128k ) || // ToDo: remove the bitrate limitation + ( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_get_sba_num_TCs( hEncoderConfig->ivas_total_brate, 1 ) > 2 ) || // ToDo: support for 3+ TCs to be done + hEncoderConfig->ivas_format == MC_FORMAT // ToDo: TBD + ) ) #endif - ( hEncoderConfig->ivas_format == MASA_FORMAT && hEncoderConfig->ivas_total_brate > IVAS_128k ) || // ToDo: remove the bitrate limitation - ( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_get_sba_num_TCs( hEncoderConfig->ivas_total_brate, 1 ) > 2 ) || // ToDo: support for 3+ TCs to be done - hEncoderConfig->ivas_format == MC_FORMAT // ToDo: TBD - ) ) { return IVAS_ERROR( IVAS_ERR_DTX_NOT_SUPPORTED, "DTX is not supported in this IVAS format and element mode." ); } @@ -935,7 +926,7 @@ static ivas_error configureEncoder( return error; } -#ifndef DISCRETE_ISM_DTX_CNG +#ifdef PARAM_ISM_DTX_CNG if ( hEncoderConfig->Opt_DTX_ON && ( hEncoderConfig->ivas_format == ISM_FORMAT ) && !( st_ivas->ism_mode == ISM_MODE_DISC && hEncoderConfig->nchan_inp == 1 ) && !( st_ivas->ism_mode == ISM_MODE_PARAM && ( hEncoderConfig->nchan_inp == 3 || hEncoderConfig->nchan_inp == 4 ) ) ) { return IVAS_ERROR( IVAS_ERR_UNKNOWN, "DTX is not supported in this IVAS format and element mode." ); @@ -1010,6 +1001,7 @@ static int16_t getInputBufferSize( return (int16_t) ( st_ivas->hEncoderConfig->input_Fs * st_ivas->hEncoderConfig->nchan_inp / FRAMES_PER_SEC ); } +#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS /*---------------------------------------------------------------------* * IVAS_ENC_GetNumInChannels() * @@ -1034,6 +1026,7 @@ ivas_error IVAS_ENC_GetNumInChannels( return IVAS_ERR_OK; } +#endif /*---------------------------------------------------------------------* @@ -1552,11 +1545,11 @@ static ivas_error printConfigInfo_enc( { if ( hEncoderConfig->ivas_total_brate <= ACELP_32k && hEncoderConfig->nchan_inp > 2 ) { - fprintf( stdout, "IVAS format: Param-ISM (%i streams)\n", hEncoderConfig->nchan_inp ); + fprintf( stdout, "IVAS format: Param-ISm (%i streams)\n", hEncoderConfig->nchan_inp ); } else { - fprintf( stdout, "IVAS format: ISM (%i streams)\n", hEncoderConfig->nchan_inp ); + fprintf( stdout, "IVAS format: ISm (%i streams)\n", hEncoderConfig->nchan_inp ); } } else if ( hEncoderConfig->ivas_format == SBA_FORMAT ) @@ -1999,6 +1992,7 @@ static ivas_error sanitizeBandwidth( static ivas_error sanitizeBitrateISM( const ENCODER_CONFIG_HANDLE hEncoderConfig ) { +#ifdef ISM_HIGHEST_BITRATE if ( hEncoderConfig->ivas_total_brate > IVAS_128k && hEncoderConfig->nchan_inp == 1 ) { return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too high bitrate for 1 ISM specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); @@ -2013,6 +2007,12 @@ static ivas_error sanitizeBitrateISM( { return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too high bitrate for 3 ISM specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); } +#else + if ( hEncoderConfig->ivas_total_brate > IVAS_256k ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too high bitrate for ISm specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); + } +#endif if ( hEncoderConfig->ivas_total_brate < IVAS_16k4 && hEncoderConfig->nchan_inp == 2 ) { @@ -2029,13 +2029,6 @@ static ivas_error sanitizeBitrateISM( return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too low bitrate for 4 ISM specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); } -#ifdef TD5 - if ( hEncoderConfig->ivas_total_brate < ISM_EXTENDED_METADATA_BRATE && hEncoderConfig->ism_extended_metadata_flag == 1 ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too low bitrate for extended metadata format specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); - } -#endif - return IVAS_ERR_OK; } @@ -2291,14 +2284,8 @@ static void init_encoder_config( hEncoderConfig->var_SID_rate_flag = 1; hEncoderConfig->mc_input_setup = MC_LS_SETUP_INVALID; hEncoderConfig->stereo_dmx_evs = 0; -#ifdef NCHAN_ISM_PARAMETER - hEncoderConfig->nchan_ism = 0; -#endif hEncoderConfig->sba_order = 0; hEncoderConfig->sba_planar = 0; -#ifdef TD5 - hEncoderConfig->ism_extended_metadata_flag = 0; -#endif #ifdef DEBUGGING hEncoderConfig->stereo_mode_cmdl = 0; hEncoderConfig->force = -1; diff --git a/lib_enc/lib_enc.h b/lib_enc/lib_enc.h index 37fd4b4dee..7430822642 100644 --- a/lib_enc/lib_enc.h +++ b/lib_enc/lib_enc.h @@ -180,12 +180,7 @@ ivas_error IVAS_ENC_ConfigureForObjects( const bool max_bwidth_user, /* i : shows if bandwidth limitation was set by the user (true) or if default bandwidth was used (false) */ const IVAS_ENC_BANDWIDTH maxBandwidth, /* i : bandwidth limitation */ const IVAS_ENC_DTX_CONFIG dtxConfig, /* i : configuration of DTX, can by set to default by using IVAS_ENC_GetDefaultDtxConfig() */ -#ifdef TD5 - const uint16_t numObjects, /* i : number of objects to be encoded */ - const bool ism_extended_metadata /* i : Extended metadata used (true/false), where extended metadata includes radius and orientation */ -#else const uint16_t numObjects /* i : number of objects to be encoded */ -#endif ); /*! r: error code */ @@ -303,11 +298,13 @@ ivas_error IVAS_ENC_GetDelay( int16_t *delay /* o : encoder delay */ ); +#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS /*! r: encoder error code */ ivas_error IVAS_ENC_GetNumInChannels( const IVAS_ENC_HANDLE hIvasEnc, /* i/o: IVAS encoder handle */ int16_t *numInChannels /* o : total number of samples expected in the input buffer for current encoder configuration */ ); +#endif /*! r: encoder error code */ ivas_error IVAS_ENC_GetInputBufferSize( diff --git a/lib_enc/pre_proc.c b/lib_enc/pre_proc.c old mode 100755 new mode 100644 index bbeba48a16..300cb79787 --- a/lib_enc/pre_proc.c +++ b/lib_enc/pre_proc.c @@ -219,12 +219,7 @@ void pre_proc( * NB/WB/SWB/FB bandwidth detector *----------------------------------------------------------------*/ - bw_detect( st, st->input, NULL, enerBuffer -#ifdef FIX_MDCT_BASED_BWD - , - 0 -#endif - ); + bw_detect( st, st->input, NULL, enerBuffer ); /*----------------------------------------------------------------* * Noise energy down-ward update and total noise energy estimation diff --git a/lib_enc/rst_enc.c b/lib_enc/rst_enc.c index 3a20418759..2f19c41665 100644 --- a/lib_enc/rst_enc.c +++ b/lib_enc/rst_enc.c @@ -84,11 +84,15 @@ void CNG_reset_enc( set_f( voice_factors, 1.0, NB_SUBFR16k ); +#ifdef PARAM_ISM_DTX_CNG if ( st->hTdCngEnc != NULL ) { +#endif /* Reset active frame counter */ st->hTdCngEnc->act_cnt2 = 0; +#ifdef PARAM_ISM_DTX_CNG } +#endif /* deactivate bass post-filter */ st->bpf_off = 1; diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index c4941b610c..caf9a562d5 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -147,6 +147,1225 @@ static ivas_error ivas_hrtf_close( return IVAS_ERR_OK; } + +#ifndef FIX_197_CREND_INTERFACE +/*------------------------------------------------------------------------- + * ivas_crend_init_from_rom() + * + * Allocate and initialize crend renderer handle + *------------------------------------------------------------------------*/ + +ivas_error ivas_crend_init_from_rom( + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ +) +{ + int16_t i, j, tmp; + int32_t output_Fs; + AUDIO_CONFIG intern_config; + HRTFS_HANDLE hHrtf; + +#ifdef FIX_197_CREND_INTERFACE + hHrtf = st_ivas->hCrendWrapper->hHrtfCrend; +#else + hHrtf = st_ivas->hHrtf; +#endif + + output_Fs = st_ivas->hDecoderConfig->output_Fs; + + intern_config = st_ivas->intern_config; + + if ( intern_config == AUDIO_CONFIG_BINAURAL || intern_config == AUDIO_CONFIG_BINAURAL_ROOM ) + { + return IVAS_ERR_INTERNAL_FATAL; + } + + if ( hHrtf == NULL ) + { + if ( ivas_hrtf_open( &hHrtf ) != IVAS_ERR_OK ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for HRTF handle" ); + } + } + + hHrtf->max_num_ir = audioCfg2channels( intern_config ); + + if ( hHrtf->max_num_ir <= 0 ) + { + return IVAS_ERR_INTERNAL_FATAL; + } + + /* Do all error checks up front so that the nested if later is easier */ + if ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV && st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Encountered unsupported renderer type" ); + } + + if ( intern_config != AUDIO_CONFIG_5_1 && intern_config != AUDIO_CONFIG_5_1_2 && intern_config != AUDIO_CONFIG_5_1_4 && + intern_config != AUDIO_CONFIG_7_1 && intern_config != AUDIO_CONFIG_7_1_4 && + intern_config != AUDIO_CONFIG_FOA && intern_config != AUDIO_CONFIG_HOA2 && intern_config != AUDIO_CONFIG_HOA3 ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Encountered unsupported transport config in Crend" ); + } + + if ( ( ( st_ivas->hRenderConfig != NULL ) && !st_ivas->hRenderConfig->roomAcoustics.use_brir ) || ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV ) ) + { + if ( intern_config == AUDIO_CONFIG_5_1 || intern_config == AUDIO_CONFIG_5_1_2 || intern_config == AUDIO_CONFIG_5_1_4 || + intern_config == AUDIO_CONFIG_7_1 || intern_config == AUDIO_CONFIG_7_1_4 ) + { + hHrtf->max_num_ir -= 1; /* subtract LFE */ + hHrtf->gain_lfe = GAIN_LFE; + + if ( output_Fs == 48000 ) + { + hHrtf->latency_s = CRendBin_Combined_HRIR_latency_s; + + hHrtf->max_num_iterations = CRendBin_Combined_HRIR_max_num_iterations_48kHz; + hHrtf->index_frequency_max_diffuse = CRendBin_Combined_HRIR_index_frequency_max_diffuse_48kHz; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_HRIR_num_iterations_diffuse_48kHz[j]; + hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_48kHz[j]; + hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_Combined_HRIR_coeff_diffuse_re_48kHz[j]; + hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_Combined_HRIR_coeff_diffuse_im_48kHz[j]; + } + } + else if ( output_Fs == 32000 ) + { + hHrtf->latency_s = CRendBin_Combined_HRIR_latency_s; + + hHrtf->max_num_iterations = CRendBin_Combined_HRIR_max_num_iterations_32kHz; + hHrtf->index_frequency_max_diffuse = CRendBin_Combined_HRIR_index_frequency_max_diffuse_32kHz; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_HRIR_num_iterations_diffuse_32kHz[j]; + hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_32kHz[j]; + hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_Combined_HRIR_coeff_diffuse_re_32kHz[j]; + hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_Combined_HRIR_coeff_diffuse_im_32kHz[j]; + } + } + else if ( output_Fs == 16000 ) + { + hHrtf->latency_s = CRendBin_Combined_HRIR_latency_s; + + hHrtf->max_num_iterations = CRendBin_Combined_HRIR_max_num_iterations_16kHz; + hHrtf->index_frequency_max_diffuse = CRendBin_Combined_HRIR_index_frequency_max_diffuse_16kHz; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_HRIR_num_iterations_diffuse_16kHz[j]; + hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_16kHz[j]; + hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_Combined_HRIR_coeff_diffuse_re_16kHz[j]; + hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_Combined_HRIR_coeff_diffuse_im_16kHz[j]; + } + } + else + { + return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Encountered Unsupported sampling rate in Crend" ); + } + + for ( i = 0; i < hHrtf->max_num_ir; i++ ) + { + if ( intern_config == AUDIO_CONFIG_5_1 ) + { + tmp = channelIndex_CICP6[i]; + } + else if ( intern_config == AUDIO_CONFIG_7_1 ) + { + tmp = channelIndex_CICP12[i]; + } + else if ( intern_config == AUDIO_CONFIG_5_1_2 ) + { + tmp = channelIndex_CICP14[i]; + } + else if ( intern_config == AUDIO_CONFIG_5_1_4 ) + { + tmp = channelIndex_CICP16[i]; + } + else if ( intern_config == AUDIO_CONFIG_7_1_4 ) + { + tmp = channelIndex_CICP19[i]; + } + else + { + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: Channel configuration not specified!\n\n" ); + } + + if ( output_Fs == 48000 ) + { + hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz[tmp]; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations[i][j] = CRendBin_Combined_HRIR_num_iterations_48kHz[tmp][j]; + hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_HRIR_pIndex_frequency_max_48kHz[tmp][j]; + hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_HRIR_coeff_re_48kHz[tmp][j]; + hHrtf->pOut_to_bin_im[i][j] = CRendBin_Combined_HRIR_coeff_im_48kHz[tmp][j]; + } + } + else if ( output_Fs == 32000 ) + { + hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz[tmp]; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations[i][j] = CRendBin_Combined_HRIR_num_iterations_32kHz[tmp][j]; + hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_HRIR_pIndex_frequency_max_32kHz[tmp][j]; + hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_HRIR_coeff_re_32kHz[tmp][j]; + hHrtf->pOut_to_bin_im[i][j] = CRendBin_Combined_HRIR_coeff_im_32kHz[tmp][j]; + } + } + else if ( output_Fs == 16000 ) + { + hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz[tmp]; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations[i][j] = CRendBin_Combined_HRIR_num_iterations_16kHz[tmp][j]; + hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_HRIR_pIndex_frequency_max_16kHz[tmp][j]; + hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_HRIR_coeff_re_16kHz[tmp][j]; + hHrtf->pOut_to_bin_im[i][j] = CRendBin_Combined_HRIR_coeff_im_16kHz[tmp][j]; + } + } + else + { + return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Encountered Unsupported sampling rate in Crend" ); + } + } + } + else if ( intern_config == AUDIO_CONFIG_FOA || intern_config == AUDIO_CONFIG_HOA2 || intern_config == AUDIO_CONFIG_HOA3 ) + { + if ( output_Fs == 48000 ) + { + hHrtf->latency_s = CRendBin_HOA3_HRIR_latency_s; + + hHrtf->max_num_iterations = CRendBin_HOA3_HRIR_max_num_iterations_48kHz; + hHrtf->index_frequency_max_diffuse = CRendBin_HOA3_HRIR_index_frequency_max_diffuse_48kHz; + + for ( i = 0; i < hHrtf->max_num_ir; i++ ) + { + hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz[i]; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_48kHz[i][j]; + hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_48kHz[i][j]; + hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_48kHz[i][j]; + hHrtf->pOut_to_bin_im[i][j] = CRendBin_HOA3_HRIR_coeff_im_48kHz[i][j]; + } + } + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations_diffuse[j] = CRendBin_HOA3_HRIR_num_iterations_diffuse_48kHz[j]; + hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_48kHz[j]; + hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_HOA3_HRIR_coeff_diffuse_re_48kHz[j]; + hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_HOA3_HRIR_coeff_diffuse_im_48kHz[j]; + } + } + else if ( output_Fs == 32000 ) + { + hHrtf->latency_s = CRendBin_HOA3_HRIR_latency_s; + + hHrtf->max_num_iterations = CRendBin_HOA3_HRIR_max_num_iterations_32kHz; + hHrtf->index_frequency_max_diffuse = CRendBin_HOA3_HRIR_index_frequency_max_diffuse_32kHz; + + for ( i = 0; i < hHrtf->max_num_ir; i++ ) + { + hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz[i]; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_32kHz[i][j]; + hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_32kHz[i][j]; + hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_32kHz[i][j]; + hHrtf->pOut_to_bin_im[i][j] = CRendBin_HOA3_HRIR_coeff_im_32kHz[i][j]; + } + } + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations_diffuse[j] = CRendBin_HOA3_HRIR_num_iterations_diffuse_32kHz[j]; + hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_32kHz[j]; + hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_HOA3_HRIR_coeff_diffuse_re_32kHz[j]; + hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_HOA3_HRIR_coeff_diffuse_im_32kHz[j]; + } + } + else if ( output_Fs == 16000 ) + { + hHrtf->latency_s = CRendBin_HOA3_HRIR_latency_s; + + hHrtf->max_num_iterations = CRendBin_HOA3_HRIR_max_num_iterations_16kHz; + hHrtf->index_frequency_max_diffuse = CRendBin_HOA3_HRIR_index_frequency_max_diffuse_16kHz; + + for ( i = 0; i < hHrtf->max_num_ir; i++ ) + { + hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz[i]; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_16kHz[i][j]; + hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_16kHz[i][j]; + hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_16kHz[i][j]; + hHrtf->pOut_to_bin_im[i][j] = CRendBin_HOA3_HRIR_coeff_im_16kHz[i][j]; + } + } + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations_diffuse[j] = CRendBin_HOA3_HRIR_num_iterations_diffuse_16kHz[j]; + hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_16kHz[j]; + hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_HOA3_HRIR_coeff_diffuse_re_16kHz[j]; + hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_HOA3_HRIR_coeff_diffuse_im_16kHz[j]; + } + } + else + { + return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Encountered Unsupported sampling rate in Crend" ); + } + } + } + else if ( ( ( st_ivas->hRenderConfig != NULL ) && st_ivas->hRenderConfig->roomAcoustics.use_brir ) || ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) + { + if ( intern_config == AUDIO_CONFIG_5_1 || intern_config == AUDIO_CONFIG_5_1_2 || intern_config == AUDIO_CONFIG_5_1_4 || + intern_config == AUDIO_CONFIG_7_1 || intern_config == AUDIO_CONFIG_7_1_4 ) + { + hHrtf->max_num_ir -= 1; /* subtract LFE */ + hHrtf->gain_lfe = GAIN_LFE; + + if ( output_Fs == 48000 ) + { + hHrtf->latency_s = CRendBin_Combined_BRIR_latency_s; + + hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_48kHz; + hHrtf->index_frequency_max_diffuse = CRendBin_Combined_BRIR_index_frequency_max_diffuse_48kHz; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_BRIR_num_iterations_diffuse_48kHz[j]; + hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_48kHz[j]; + hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_Combined_BRIR_coeff_diffuse_re_48kHz[j]; + hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_Combined_BRIR_coeff_diffuse_im_48kHz[j]; + } + } + else if ( output_Fs == 32000 ) + { + hHrtf->latency_s = CRendBin_Combined_BRIR_latency_s; + + hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_32kHz; + hHrtf->index_frequency_max_diffuse = CRendBin_Combined_BRIR_index_frequency_max_diffuse_32kHz; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_BRIR_num_iterations_diffuse_32kHz[j]; + hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_32kHz[j]; + hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_Combined_BRIR_coeff_diffuse_re_32kHz[j]; + hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_Combined_BRIR_coeff_diffuse_im_32kHz[j]; + } + } + else if ( output_Fs == 16000 ) + { + hHrtf->latency_s = CRendBin_Combined_BRIR_latency_s; + + hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_16kHz; + hHrtf->index_frequency_max_diffuse = CRendBin_Combined_BRIR_index_frequency_max_diffuse_16kHz; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_BRIR_num_iterations_diffuse_16kHz[j]; + hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_16kHz[j]; + hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_Combined_BRIR_coeff_diffuse_re_16kHz[j]; + hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_Combined_BRIR_coeff_diffuse_im_16kHz[j]; + } + } + else + { + return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Encountered Unsupported sampling rate in Crend" ); + } + + for ( i = 0; i < hHrtf->max_num_ir; i++ ) + { + if ( intern_config == AUDIO_CONFIG_5_1 ) + { + tmp = channelIndex_CICP6[i]; + } + else if ( intern_config == AUDIO_CONFIG_7_1 ) + { + tmp = channelIndex_CICP12[i]; + } + else if ( intern_config == AUDIO_CONFIG_5_1_2 ) + { + tmp = channelIndex_CICP14[i]; + } + else if ( intern_config == AUDIO_CONFIG_5_1_4 ) + { + tmp = channelIndex_CICP16[i]; + } + else if ( intern_config == AUDIO_CONFIG_7_1_4 ) + { + tmp = channelIndex_CICP19[i]; + } + else + { + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: Channel configuration not specified!\n\n" ); + } + + if ( output_Fs == 48000 ) + { + hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz[tmp]; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_48kHz[tmp][j]; + hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_48kHz[tmp][j]; + hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_BRIR_coeff_re_48kHz[tmp][j]; + hHrtf->pOut_to_bin_im[i][j] = CRendBin_Combined_BRIR_coeff_im_48kHz[tmp][j]; + } + } + else if ( output_Fs == 32000 ) + { + hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[tmp]; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_32kHz[tmp][j]; + hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_32kHz[tmp][j]; + hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_BRIR_coeff_re_32kHz[tmp][j]; + hHrtf->pOut_to_bin_im[i][j] = CRendBin_Combined_BRIR_coeff_im_32kHz[tmp][j]; + } + } + else if ( output_Fs == 16000 ) + { + hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[tmp]; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_16kHz[tmp][j]; + hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_16kHz[tmp][j]; + hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_BRIR_coeff_re_16kHz[tmp][j]; + hHrtf->pOut_to_bin_im[i][j] = CRendBin_Combined_BRIR_coeff_im_16kHz[tmp][j]; + } + } + else + { + return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Encountered Unsupported sampling rate in Crend" ); + } + } + } + else if ( intern_config == AUDIO_CONFIG_FOA || intern_config == AUDIO_CONFIG_HOA2 || intern_config == AUDIO_CONFIG_HOA3 ) + { + if ( output_Fs == 48000 ) + { + hHrtf->latency_s = CRendBin_HOA3_HRIR_latency_s; + + hHrtf->max_num_iterations = CRendBin_HOA3_HRIR_max_num_iterations_48kHz; + hHrtf->index_frequency_max_diffuse = CRendBin_HOA3_HRIR_index_frequency_max_diffuse_48kHz; + + for ( i = 0; i < hHrtf->max_num_ir; i++ ) + { + hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz[i]; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_48kHz[i][j]; + hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_48kHz[i][j]; + hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_48kHz[i][j]; + hHrtf->pOut_to_bin_im[i][j] = CRendBin_HOA3_HRIR_coeff_im_48kHz[i][j]; + } + } + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations_diffuse[j] = CRendBin_HOA3_HRIR_num_iterations_diffuse_48kHz[j]; + hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_48kHz[j]; + hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_HOA3_HRIR_coeff_diffuse_re_48kHz[j]; + hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_HOA3_HRIR_coeff_diffuse_im_48kHz[j]; + } + } + else if ( output_Fs == 32000 ) + { + hHrtf->latency_s = CRendBin_HOA3_HRIR_latency_s; + + hHrtf->max_num_iterations = CRendBin_HOA3_HRIR_max_num_iterations_32kHz; + hHrtf->index_frequency_max_diffuse = CRendBin_HOA3_HRIR_index_frequency_max_diffuse_32kHz; + + for ( i = 0; i < hHrtf->max_num_ir; i++ ) + { + hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz[i]; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_32kHz[i][j]; + hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_32kHz[i][j]; + hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_32kHz[i][j]; + hHrtf->pOut_to_bin_im[i][j] = CRendBin_HOA3_HRIR_coeff_im_32kHz[i][j]; + } + } + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations_diffuse[j] = CRendBin_HOA3_HRIR_num_iterations_diffuse_32kHz[j]; + hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_32kHz[j]; + hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_HOA3_HRIR_coeff_diffuse_re_32kHz[j]; + hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_HOA3_HRIR_coeff_diffuse_im_32kHz[j]; + } + } + else if ( output_Fs == 16000 ) + { + hHrtf->latency_s = CRendBin_HOA3_HRIR_latency_s; + + hHrtf->max_num_iterations = CRendBin_HOA3_HRIR_max_num_iterations_16kHz; + hHrtf->index_frequency_max_diffuse = CRendBin_HOA3_HRIR_index_frequency_max_diffuse_16kHz; + + for ( i = 0; i < hHrtf->max_num_ir; i++ ) + { + hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz[i]; + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_16kHz[i][j]; + hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_16kHz[i][j]; + hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_16kHz[i][j]; + hHrtf->pOut_to_bin_im[i][j] = CRendBin_HOA3_HRIR_coeff_im_16kHz[i][j]; + } + } + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + hHrtf->num_iterations_diffuse[j] = CRendBin_HOA3_HRIR_num_iterations_diffuse_16kHz[j]; + hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_16kHz[j]; + hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_HOA3_HRIR_coeff_diffuse_re_16kHz[j]; + hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_HOA3_HRIR_coeff_diffuse_im_16kHz[j]; + } + } + else + { + return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Encountered Unsupported sampling rate in Crend" ); + } + } + else + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "Unsupported intern_config type in Crend" ); + } + } + else + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "Unsupported renderer type in Crend" ); + } + +#ifdef FIX_197_CREND_INTERFACE + st_ivas->hCrendWrapper->hHrtfCrend = hHrtf; +#else + st_ivas->hHrtf = hHrtf; +#endif + + return IVAS_ERR_OK; +} +#endif + +#ifndef FIX_197_CREND_INTERFACE +/*------------------------------------------------------------------------- + * ivas_crend_init_from_hrtf_handle() + * + * Allocate and initialize Crend HRTF handle from external file + *------------------------------------------------------------------------*/ + +ivas_error ivas_crend_init_from_hrtf_handle( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + HRTFS_HANDLE hrtf ) +{ + int16_t i, j, as_lfe_filter; + const int16_t *hchannelIndex = NULL; + AUDIO_CONFIG transport_config; + + if ( st_ivas == NULL ) + { + return IVAS_ERR_INTERNAL; + } + + if ( hrtf == NULL ) + { + return IVAS_ERR_INVALID_HRTF; + } + + if ( st_ivas->hHrtf != NULL ) + { + ivas_hrtf_close( &st_ivas->hHrtf ); + } + + if ( ivas_hrtf_open( &( st_ivas->hHrtf ) ) != IVAS_ERR_OK ) + { + return IVAS_ERR_INTERNAL; + } + + if ( st_ivas->hHrtf != NULL ) + { + st_ivas->hHrtf->latency_s = hrtf->latency_s; + // st_ivas->hHrtf->max_num_ir->max_ir_len = hrtf->max_ir_len; + st_ivas->hHrtf->max_num_iterations = hrtf->max_num_iterations; + st_ivas->hHrtf->gain_lfe = hrtf->gain_lfe; + // st_ivas->hHrtf->crend_hr_gain_foa_to_bin = hrtf->crend_hr_gain_foa_to_bin; + st_ivas->hHrtf->max_num_ir = 0; + st_ivas->hIntSetup.nchan_out_woLFE = 0; + st_ivas->hIntSetup.num_lfe = 0; + st_ivas->hIntSetup.nchan_out_woLFE = 0; + + transport_config = st_ivas->intern_config == AUDIO_CONFIG_INVALID ? st_ivas->transport_config : st_ivas->intern_config; + + switch ( transport_config ) + { + case AUDIO_CONFIG_5_1: + st_ivas->hHrtf->max_num_ir = 5; + st_ivas->hHrtf->gain_lfe = GAIN_LFE; + st_ivas->hIntSetup.nchan_out_woLFE = st_ivas->hHrtf->max_num_ir; + st_ivas->hIntSetup.num_lfe = 1; + hchannelIndex = (const int16_t *) &channelIndex_CICP6; + break; + case AUDIO_CONFIG_7_1: + st_ivas->hHrtf->max_num_ir = 7; + st_ivas->hHrtf->gain_lfe = GAIN_LFE; + st_ivas->hIntSetup.nchan_out_woLFE = st_ivas->hHrtf->max_num_ir; + st_ivas->hIntSetup.num_lfe = 1; + hchannelIndex = (const int16_t *) &channelIndex_CICP12; + break; + case AUDIO_CONFIG_5_1_2: + st_ivas->hHrtf->max_num_ir = 7; + st_ivas->hHrtf->gain_lfe = GAIN_LFE; + st_ivas->hIntSetup.nchan_out_woLFE = st_ivas->hHrtf->max_num_ir; + st_ivas->hIntSetup.num_lfe = 1; + hchannelIndex = (const int16_t *) &channelIndex_CICP14; + break; + case AUDIO_CONFIG_5_1_4: + st_ivas->hHrtf->max_num_ir = 9; + st_ivas->hHrtf->gain_lfe = GAIN_LFE; + st_ivas->hIntSetup.nchan_out_woLFE = st_ivas->hHrtf->max_num_ir; + st_ivas->hIntSetup.num_lfe = 1; + hchannelIndex = (const int16_t *) &channelIndex_CICP16; + break; + case AUDIO_CONFIG_7_1_4: + st_ivas->hHrtf->max_num_ir = 11; + st_ivas->hHrtf->gain_lfe = GAIN_LFE; + st_ivas->hIntSetup.nchan_out_woLFE = st_ivas->hHrtf->max_num_ir; + st_ivas->hIntSetup.num_lfe = 1; + hchannelIndex = (const int16_t *) &channelIndex_CICP19; + break; + case AUDIO_CONFIG_FOA: + st_ivas->hIntSetup.ambisonics_order = 1; + st_ivas->hHrtf->max_num_ir = 4; + break; + case AUDIO_CONFIG_HOA2: + st_ivas->hIntSetup.ambisonics_order = 2; + st_ivas->hHrtf->max_num_ir = 9; + break; + case AUDIO_CONFIG_HOA3: + st_ivas->hIntSetup.ambisonics_order = 3; + st_ivas->hHrtf->max_num_ir = 16; + break; + default: + break; + } + + as_lfe_filter = 0; + if ( ( st_ivas->hHrtf->max_num_ir != hrtf->max_num_ir ) && ( st_ivas->hHrtf->max_num_ir + 1 == hrtf->max_num_ir ) ) + { + as_lfe_filter = 1; + hchannelIndex = NULL; + } + + if ( st_ivas->hHrtf->max_num_ir == 0 ) + { + return IVAS_ERR_INTERNAL; + } + + for ( i = 0; i < st_ivas->hHrtf->max_num_ir; i++ ) + { + int16_t tmp = i; + if ( hchannelIndex != NULL ) + { + tmp = hchannelIndex[i]; + } + if ( as_lfe_filter ) + { + if ( tmp > 2 ) + { + tmp++; + } + } + + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + st_ivas->hHrtf->pOut_to_bin_re[i][j] = hrtf->pOut_to_bin_re[tmp][j]; + st_ivas->hHrtf->pOut_to_bin_im[i][j] = hrtf->pOut_to_bin_im[tmp][j]; + st_ivas->hHrtf->num_iterations[i][j] = hrtf->num_iterations[tmp][j]; + st_ivas->hHrtf->pIndex_frequency_max[i][j] = hrtf->pIndex_frequency_max[tmp][j]; + } + st_ivas->hHrtf->inv_diffuse_weight[i] = hrtf->inv_diffuse_weight[tmp]; + } + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + st_ivas->hHrtf->pOut_to_bin_diffuse_re[j] = hrtf->pOut_to_bin_diffuse_re[j]; + st_ivas->hHrtf->pOut_to_bin_diffuse_im[j] = hrtf->pOut_to_bin_diffuse_im[j]; + st_ivas->hHrtf->num_iterations_diffuse[j] = hrtf->num_iterations_diffuse[j]; + st_ivas->hHrtf->pIndex_frequency_max_diffuse[j] = hrtf->pIndex_frequency_max_diffuse[j]; + } + st_ivas->hHrtf->index_frequency_max_diffuse = hrtf->index_frequency_max_diffuse; + } + return IVAS_ERR_OK; +} + +/*------------------------------------------------------------------------- + * ivas_crend_init_from_setofhrtf() + * + * Allocate and initialize crend renderer handle + *------------------------------------------------------------------------*/ + +ivas_error ivas_crend_init_from_setofhrtf( + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ +) +{ + ivas_error error; + AUDIO_CONFIG transport_config; + + transport_config = st_ivas->intern_config == AUDIO_CONFIG_INVALID ? st_ivas->transport_config : st_ivas->intern_config; + switch ( transport_config ) + { + case AUDIO_CONFIG_5_1: + case AUDIO_CONFIG_5_1_2: + case AUDIO_CONFIG_5_1_4: + case AUDIO_CONFIG_7_1: + case AUDIO_CONFIG_7_1_4: + if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) + { + if ( ( error = ivas_crend_init_from_hrtf_handle( st_ivas, st_ivas->hSetOfHRTF->hHRTF_brir_combined ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else + { + if ( ( error = ivas_crend_init_from_hrtf_handle( st_ivas, st_ivas->hSetOfHRTF->hHRTF_hrir_combined ) ) != IVAS_ERR_OK ) + { + return error; + } + } + break; + case AUDIO_CONFIG_FOA: + case AUDIO_CONFIG_HOA2: + case AUDIO_CONFIG_HOA3: + if ( ( error = ivas_crend_init_from_hrtf_handle( st_ivas, st_ivas->hSetOfHRTF->hHRTF_hrir_hoa3 ) ) != IVAS_ERR_OK ) + { + return error; + } + break; + default: + return IVAS_ERR_INTERNAL; + } + + return IVAS_ERR_OK; +} + +#endif + +#ifndef FIX_197_CREND_INTERFACE +/*------------------------------------------------------------------------- + * ivas_crend_open() + * + * Allocate and initialize Crend renderer handle + *------------------------------------------------------------------------*/ + +ivas_error ivas_crend_open( + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ +) +{ + int16_t i, subframe_length; + int16_t max_total_ir_len; + HRTFS_HANDLE hHrtf; + CREND_HANDLE hCrend; + ivas_error error; + + error = IVAS_ERR_OK; + subframe_length = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ) / MAX_PARAM_SPATIAL_SUBFRAMES; + + if ( ( st_ivas->hHrtf == NULL ) && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) + { + if ( st_ivas->hSetOfHRTF != NULL ) + { + if ( ( error = ivas_crend_init_from_setofhrtf( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else + { + if ( ( error = ivas_crend_init_from_rom( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + } + } + + if ( ( hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for renderer handle" ); + } + + hCrend->lfe_delay_line = NULL; + + for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) + { + hCrend->freq_buffer_re[i] = NULL; + hCrend->freq_buffer_im[i] = NULL; + } + + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + hCrend->prev_out_buffer[i] = NULL; + } + + hCrend->freq_buffer_re_diffuse = NULL; + hCrend->freq_buffer_im_diffuse = NULL; + hCrend->hReverb = NULL; + hCrend->delay_line_rw_index = 0; + hCrend->diffuse_delay_line_rw_index = 0; + hCrend->hTrack = NULL; + hCrend->m_fYaw = 0; + hCrend->m_fPitch = 0; + hCrend->m_fRoll = 0; + + hHrtf = st_ivas->hHrtf; + + if ( ( hHrtf != NULL ) && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) + { + max_total_ir_len = hHrtf->max_num_iterations * subframe_length; + + for ( i = 0; i < hHrtf->max_num_ir; i++ ) + { + if ( ( hCrend->freq_buffer_re[i] = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); + } + set_f( hCrend->freq_buffer_re[i], 0, max_total_ir_len ); + + if ( ( hCrend->freq_buffer_im[i] = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); + } + set_f( hCrend->freq_buffer_im[i], 0, max_total_ir_len ); + } + + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + if ( ( hCrend->prev_out_buffer[i] = (float *) malloc( sizeof( float ) * subframe_length ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); + } + set_f( hCrend->prev_out_buffer[i], 0, subframe_length ); + } + + max_total_ir_len = hHrtf->num_iterations_diffuse[0] * subframe_length; + + if ( max_total_ir_len > 0 ) + { + if ( ( hCrend->freq_buffer_re_diffuse = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); + } + set_f( hCrend->freq_buffer_re_diffuse, 0, max_total_ir_len ); + + if ( ( hCrend->freq_buffer_im_diffuse = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); + } + set_f( hCrend->freq_buffer_im_diffuse, 0, max_total_ir_len ); + } + else + { + hCrend->freq_buffer_re_diffuse = NULL; + hCrend->freq_buffer_im_diffuse = NULL; + } + + max_total_ir_len = (int16_t) ( hHrtf->latency_s * st_ivas->hDecoderConfig->output_Fs + 0.5f ) + subframe_length; + if ( max_total_ir_len > 0 ) + { + if ( ( hCrend->lfe_delay_line = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); + } + set_f( hCrend->lfe_delay_line, 0, max_total_ir_len ); + } + else + { + hCrend->lfe_delay_line = NULL; + } + + if ( st_ivas->hDecoderConfig->Opt_Headrotation ) + { + if ( ( hCrend->hTrack = (ivas_orient_trk_state_t *) malloc( sizeof( ivas_orient_trk_state_t ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Orientation tracking" ); + } + + ivas_orient_trk_Init( hCrend->hTrack ); + } + else + { + hCrend->hTrack = NULL; + } + + if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM && st_ivas->ivas_format == MC_FORMAT && st_ivas->hDecoderConfig->Opt_Headrotation ) + { + if ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth, st_ivas->hIntSetup.ls_elevation, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK ) + { + return error; + } + } + + if ( ( ( st_ivas->hRenderConfig != NULL ) && st_ivas->hRenderConfig->roomAcoustics.late_reverb_on ) ) + { + if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), st_ivas->intern_config, hHrtf, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else + { + hCrend->hReverb = NULL; + } + + st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtf->latency_s * 1000000000.f ); + } + + st_ivas->hCrend = hCrend; + + return error; +} +#endif + +#ifndef FIX_197_CREND_INTERFACE + +/*------------------------------------------------------------------------- + * ivas_crend_close() + * + * Deallocate Crend renderer handle + *------------------------------------------------------------------------*/ + +ivas_error ivas_crend_close( + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ +) +{ + int16_t i; + + if ( st_ivas->hHrtf != NULL ) + { + ivas_hrtf_close( &st_ivas->hHrtf ); + } + + if ( st_ivas->hCrend != NULL ) + { + if ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD ) + { + for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) + { + if ( st_ivas->hCrend->freq_buffer_re[i] != NULL ) + { + free( st_ivas->hCrend->freq_buffer_re[i] ); + st_ivas->hCrend->freq_buffer_re[i] = NULL; + } + if ( st_ivas->hCrend->freq_buffer_im[i] != NULL ) + { + free( st_ivas->hCrend->freq_buffer_im[i] ); + st_ivas->hCrend->freq_buffer_im[i] = NULL; + } + } + + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + if ( st_ivas->hCrend->prev_out_buffer[i] != NULL ) + { + free( st_ivas->hCrend->prev_out_buffer[i] ); + st_ivas->hCrend->prev_out_buffer[i] = NULL; + } + } + + if ( st_ivas->hCrend->lfe_delay_line != NULL ) + { + free( st_ivas->hCrend->lfe_delay_line ); + st_ivas->hCrend->lfe_delay_line = NULL; + } + + if ( st_ivas->hCrend->freq_buffer_re_diffuse != NULL ) + { + free( st_ivas->hCrend->freq_buffer_re_diffuse ); + st_ivas->hCrend->freq_buffer_re_diffuse = NULL; + } + + if ( st_ivas->hCrend->freq_buffer_im_diffuse != NULL ) + { + free( st_ivas->hCrend->freq_buffer_im_diffuse ); + st_ivas->hCrend->freq_buffer_im_diffuse = NULL; + } + + if ( st_ivas->hCrend->hTrack != NULL ) + { + free( st_ivas->hCrend->hTrack ); + st_ivas->hCrend->hTrack = NULL; + } + } + + ivas_reverb_close( &st_ivas->hCrend->hReverb ); + + free( st_ivas->hCrend ); + st_ivas->hCrend = NULL; + } + + return IVAS_ERR_OK; +} +#endif + +#ifndef FIX_197_CREND_INTERFACE + +/*-----------------------------------------------------------------------------------------* + * Function ivas_crend_convolver() + * + * Convolver block + *-----------------------------------------------------------------------------------------*/ + +static ivas_error ivas_crend_convolver( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + float pcm_in[][L_FRAME48k], + float pcm_out[][L_FRAME48k], + const int16_t i_ts ) +{ + float *pIn; + float *pFreq_buf_re; + float *pFreq_buf_im; + float *pFreq_filt_re; + float *pFreq_filt_im; + int16_t i, j, k, m, nchan_out, subframe_length, nchan_intern, idx_in; + float pOut[L_FRAME48k * 2]; + float tmp_out_re[L_FRAME48k], tmp_out_im[L_FRAME48k]; + int16_t offset, offset_in, offset_diffuse; + int32_t output_Fs; + + nchan_intern = audioCfg2channels( st_ivas->intern_config ); + nchan_out = st_ivas->hDecoderConfig->nchan_out; + output_Fs = st_ivas->hDecoderConfig->output_Fs; + subframe_length = (int16_t) ( output_Fs / FRAMES_PER_SEC ) / MAX_PARAM_SPATIAL_SUBFRAMES; + + offset = st_ivas->hCrend->delay_line_rw_index * subframe_length; /* subframe_length * ( st_ivas->hHrtf->max_num_iterations - 1 ); */ + offset_diffuse = st_ivas->hCrend->diffuse_delay_line_rw_index * subframe_length; /* subframe_length *( st_ivas->hHrtf->num_iterations_diffuse[0] - 1 ); */ + + if ( st_ivas->hHrtf->num_iterations_diffuse[0] > 0 ) + { + set_zero( &st_ivas->hCrend->freq_buffer_re_diffuse[offset_diffuse], subframe_length ); + set_zero( &st_ivas->hCrend->freq_buffer_im_diffuse[offset_diffuse], subframe_length ); + } + + i = 0; + for ( idx_in = 0; idx_in < nchan_intern; idx_in++ ) + { + pIn = &pcm_in[idx_in][i_ts * subframe_length]; + if ( st_ivas->hIntSetup.index_lfe[0] != idx_in ) + { + if ( st_ivas->hHrtf->num_iterations_diffuse[0] > 0 ) + { + pFreq_buf_re = &st_ivas->hCrend->freq_buffer_re_diffuse[offset_diffuse]; + pFreq_buf_im = &st_ivas->hCrend->freq_buffer_im_diffuse[offset_diffuse]; + pFreq_filt_re = &st_ivas->hCrend->freq_buffer_re[i][offset]; + pFreq_filt_im = &st_ivas->hCrend->freq_buffer_im[i][offset]; + + for ( k = 0; k < st_ivas->hHrtf->index_frequency_max_diffuse; k++ ) + { + pFreq_buf_re[k] += pFreq_filt_re[k] * st_ivas->hHrtf->inv_diffuse_weight[i]; + pFreq_buf_im[k] += pFreq_filt_im[k] * st_ivas->hHrtf->inv_diffuse_weight[i]; + } + } + + pFreq_buf_re = &st_ivas->hCrend->freq_buffer_re[i][offset]; + pFreq_buf_im = &st_ivas->hCrend->freq_buffer_im[i][offset]; + + ivas_mdft( pIn, pFreq_buf_re, pFreq_buf_im, subframe_length, subframe_length ); + i++; + } + } + + for ( j = 0; j < nchan_out; j++ ) + { + set_zero( tmp_out_re, subframe_length ); + set_zero( tmp_out_im, subframe_length ); + + i = 0; + for ( idx_in = 0; idx_in < nchan_intern; idx_in++ ) + { + if ( idx_in != st_ivas->hIntSetup.index_lfe[0] ) + { + offset = 0; + for ( m = 0; m < st_ivas->hHrtf->num_iterations[i][j]; m++ ) + { + offset_in = ( st_ivas->hCrend->delay_line_rw_index + st_ivas->hHrtf->max_num_iterations - st_ivas->hHrtf->num_iterations[i][j] + m + 1 ); + offset_in = offset_in % ( st_ivas->hHrtf->max_num_iterations ); + offset_in = offset_in * subframe_length; + pFreq_buf_re = &st_ivas->hCrend->freq_buffer_re[i][offset_in]; + pFreq_buf_im = &st_ivas->hCrend->freq_buffer_im[i][offset_in]; + pFreq_filt_re = &st_ivas->hHrtf->pOut_to_bin_re[i][j][offset]; + pFreq_filt_im = &st_ivas->hHrtf->pOut_to_bin_im[i][j][offset]; + + for ( k = 0; k < st_ivas->hHrtf->pIndex_frequency_max[i][j][m]; k++ ) + { + tmp_out_re[k] += pFreq_buf_re[k] * pFreq_filt_re[k] - pFreq_buf_im[k] * pFreq_filt_im[k]; + tmp_out_im[k] += pFreq_buf_re[k] * pFreq_filt_im[k] + pFreq_buf_im[k] * pFreq_filt_re[k]; + } + offset = offset + k; + } + i++; + } + } + + offset = 0; + for ( m = 0; m < st_ivas->hHrtf->num_iterations_diffuse[j]; m++ ) + { + offset_diffuse = ( st_ivas->hCrend->diffuse_delay_line_rw_index + m + 1 ); + offset_diffuse = offset_diffuse % st_ivas->hHrtf->num_iterations_diffuse[0]; + offset_diffuse = offset_diffuse * subframe_length; + pFreq_buf_re = &st_ivas->hCrend->freq_buffer_re_diffuse[offset_diffuse]; + pFreq_buf_im = &st_ivas->hCrend->freq_buffer_im_diffuse[offset_diffuse]; + pFreq_filt_re = &st_ivas->hHrtf->pOut_to_bin_diffuse_re[j][offset]; + pFreq_filt_im = &st_ivas->hHrtf->pOut_to_bin_diffuse_im[j][offset]; + + for ( k = 0; k < st_ivas->hHrtf->pIndex_frequency_max_diffuse[j][m]; k++ ) + { + tmp_out_re[k] += pFreq_buf_re[k] * pFreq_filt_re[k] - pFreq_buf_im[k] * pFreq_filt_im[k]; + tmp_out_im[k] += pFreq_buf_re[k] * pFreq_filt_im[k] + pFreq_buf_im[k] * pFreq_filt_re[k]; + } + offset = offset + k; + } + + ivas_imdft( tmp_out_re, tmp_out_im, pOut, subframe_length ); + + pFreq_buf_re = &pcm_out[j][i_ts * subframe_length]; + for ( k = 0; k < subframe_length; k++ ) + { + pFreq_buf_re[k] = pOut[k] + st_ivas->hCrend->prev_out_buffer[j][k]; + st_ivas->hCrend->prev_out_buffer[j][k] = pOut[k + subframe_length]; + } + } + + st_ivas->hCrend->delay_line_rw_index++; + st_ivas->hCrend->delay_line_rw_index = st_ivas->hCrend->delay_line_rw_index % ( st_ivas->hHrtf->max_num_iterations ); + if ( st_ivas->hHrtf->num_iterations_diffuse[0] > 0 ) + { + st_ivas->hCrend->diffuse_delay_line_rw_index++; + st_ivas->hCrend->diffuse_delay_line_rw_index = st_ivas->hCrend->diffuse_delay_line_rw_index % ( st_ivas->hHrtf->num_iterations_diffuse[0] ); + } + + return IVAS_ERR_OK; +} +#endif + +#ifndef FIX_197_CREND_INTERFACE + +/*-----------------------------------------------------------------------------------------* + * Function ivas_crend_process() + * + * Process call for IVAS Crend renderer + *-----------------------------------------------------------------------------------------*/ + +ivas_error ivas_crend_process( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + float output[][L_FRAME48k] /* i/o: input/output audio channels */ +) +{ + int16_t i, nchan_out, output_frame; + int16_t subframe_len, subframe_idx; + float pcm_tmp[BINAURAL_CHANNELS][L_FRAME48k]; + AUDIO_CONFIG intern_config; + ivas_error error; + + push_wmops( "ivas_crend_process" ); + + intern_config = st_ivas->intern_config; + nchan_out = st_ivas->hDecoderConfig->nchan_out; + output_frame = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); + subframe_len = output_frame / MAX_PARAM_SPATIAL_SUBFRAMES; + + for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) + { + if ( st_ivas->hDecoderConfig->Opt_Headrotation && st_ivas->hHeadTrackData && st_ivas->hHeadTrackData->num_quaternions >= 0 ) + { + /* Orientation tracking */ + if ( st_ivas->hCrend->hTrack != NULL ) + { + if ( st_ivas->hDecoderConfig->orientation_tracking == IVAS_ORIENT_TRK_AVG ) + { + ivas_orient_trk_SetTrackingType( st_ivas->hCrend->hTrack, OTR_TRACKING_AVG_ORIENT ); + } + else + { + ivas_orient_trk_SetTrackingType( st_ivas->hCrend->hTrack, OTR_TRACKING_REF_ORIENT ); + } + + /* get current subframe quaternion and convert to euler angles */ + Quat2Euler( st_ivas->hHeadTrackData->Quaternions[subframe_idx], &( st_ivas->hCrend->m_fYaw ), &( st_ivas->hCrend->m_fPitch ), &( st_ivas->hCrend->m_fRoll ) ); + ivas_orient_trk_SetAbsoluteOrientation( st_ivas->hCrend->hTrack, st_ivas->hCrend->m_fYaw, st_ivas->hCrend->m_fPitch, st_ivas->hCrend->m_fRoll ); + ivas_orient_trk_Process( st_ivas->hCrend->hTrack ); + ivas_orient_trk_GetTrackedOrientation( st_ivas->hCrend->hTrack, &( st_ivas->hCrend->m_fYaw ), &( st_ivas->hCrend->m_fPitch ), &( st_ivas->hCrend->m_fRoll ) ); + } + + /* Rotation in SHD for: + MC with elevation (5_1_2 / 5_1_4 / 7_1_4) -> BINAURAL + SBA SPAR -> BINAURAL or BINAURAL_ROOM + */ + if ( intern_config == AUDIO_CONFIG_FOA || intern_config == AUDIO_CONFIG_HOA2 || intern_config == AUDIO_CONFIG_HOA3 ) + { + rotateFrame_shd( st_ivas->hHeadTrackData, output, subframe_len, st_ivas->hIntSetup, subframe_idx ); + } + /* Rotation in SD for MC -> BINAURAL_ROOM */ + else if ( st_ivas->ivas_format != ISM_FORMAT && st_ivas->hIntSetup.is_loudspeaker_setup ) + { + rotateFrame_sd( st_ivas->hHeadTrackData, output, subframe_len, st_ivas->hIntSetup, st_ivas->hEFAPdata, subframe_idx ); + } + } + + if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) + { + if ( ( intern_config == AUDIO_CONFIG_FOA ) || ( intern_config == AUDIO_CONFIG_HOA2 ) || ( intern_config == AUDIO_CONFIG_HOA3 ) || + ( intern_config == AUDIO_CONFIG_5_1 ) || ( intern_config == AUDIO_CONFIG_7_1 ) || + ( intern_config == AUDIO_CONFIG_5_1_2 ) || ( intern_config == AUDIO_CONFIG_5_1_4 ) || ( intern_config == AUDIO_CONFIG_7_1_4 ) ) + { + ivas_crend_convolver( st_ivas, output, pcm_tmp, subframe_idx ); + + if ( st_ivas->hCrend->hReverb != NULL ) + { + if ( ( error = ivas_reverb_process( st_ivas->hCrend->hReverb, intern_config, 1, output, pcm_tmp, subframe_idx ) ) != IVAS_ERR_OK ) + { + return error; + } + } + } + else + { + return IVAS_ERR_INVALID_INPUT_FORMAT; + } + } + else + { + return IVAS_ERR_INTERNAL_FATAL; + } + } + + /* move to output */ + for ( i = 0; i < nchan_out; i++ ) + { + mvr2r( pcm_tmp[i], output[i], output_frame ); + } + + pop_wmops(); + + return IVAS_ERR_OK; +} +#endif + + /*------------------------------------------------------------------------- * initCrend_from_rom() * @@ -197,10 +1416,17 @@ static ivas_error ivas_rend_initCrend( /* set BRIR flag */ use_brir = false; +#ifdef FIX_197_CREND_INTERFACE if ( ( ( hRendCfg != NULL ) && hRendCfg->roomAcoustics.use_brir ) || ( ( hRendCfg == NULL ) && ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) ) ) { use_brir = true; } +#else + if ( ( hRendCfg != NULL && hRendCfg->roomAcoustics.use_brir ) || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) + { + use_brir = true; + } +#endif if ( ( error = getAudioConfigNumChannels( inConfig, &nchan_in ) ) != IVAS_ERR_OK ) @@ -667,6 +1893,8 @@ static ivas_error ivas_rend_initCrend( return IVAS_ERR_OK; } +#ifdef FIX_197_CREND_INTERFACE +#ifdef FIX_329_ENABLE_TD_RENDERER_REVERB_MC /*------------------------------------------------------------------------- * ivas_rend_initCrendWrapper() * @@ -722,6 +1950,8 @@ ivas_error ivas_rend_initCrendWrapper( return IVAS_ERR_OK; } +#endif +#endif /*------------------------------------------------------------------------- * ivas_rend_openCrend() * @@ -729,11 +1959,15 @@ ivas_error ivas_rend_initCrendWrapper( *------------------------------------------------------------------------*/ ivas_error ivas_rend_openCrend( +#ifdef FIX_197_CREND_INTERFACE CREND_WRAPPER_HANDLE *pCrend, +#else + CREND_WRAPPER *pCrend, +#endif const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, -#ifndef FIX_I109_ORIENTATION_TRACKING +#ifdef FIX_197_CREND_INTERFACE int16_t Opt_Headrotation, #endif HRTFS_CREND_HANDLE hSetOfHRTF, @@ -747,14 +1981,35 @@ ivas_error ivas_rend_openCrend( ivas_error error; error = IVAS_ERR_OK; +#ifdef FIX_197_CREND_INTERFACE +#ifdef FIX_329_ENABLE_TD_RENDERER_REVERB_MC if ( ( error = ivas_rend_initCrendWrapper( pCrend ) ) != IVAS_ERR_OK ) { return error; } hCrend = ( *pCrend )->hCrend; +#else + if ( pCrend == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend Wrapper\n" ); + } + + if ( *pCrend == NULL ) + { + if ( ( *pCrend = (CREND_WRAPPER_HANDLE) malloc( sizeof( CREND_WRAPPER ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend Wrapper\n" ); + } + ( *pCrend )->binaural_latency_ns = 0; + ( *pCrend )->hCrend = NULL; + ( *pCrend )->hHrtfCrend = NULL; + } +#endif +#endif subframe_length = (int16_t) ( output_Fs / FRAMES_PER_SEC ) / MAX_PARAM_SPATIAL_SUBFRAMES; +#ifdef FIX_197_CREND_INTERFACE if ( ( *pCrend )->hHrtfCrend == NULL ) { if ( ( error = ivas_rend_initCrend( *pCrend, inConfig, outConfig, hRendCfg, hSetOfHRTF, output_Fs ) ) != IVAS_ERR_OK ) @@ -762,8 +2017,53 @@ ivas_error ivas_rend_openCrend( return error; } } +#else + if ( pCrend->hHrtfCrend == NULL ) + { + if ( ( error = ivas_rend_initCrend( pCrend, inConfig, outConfig, hRendCfg, hSetOfHRTF, output_Fs ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif + +#ifndef FIX_329_ENABLE_TD_RENDERER_REVERB_MC + + if ( ( hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for renderer handle" ); + } + + hCrend->lfe_delay_line = NULL; + + for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) + { + hCrend->freq_buffer_re[i] = NULL; + hCrend->freq_buffer_im[i] = NULL; + } + + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + hCrend->prev_out_buffer[i] = NULL; + } + + hCrend->freq_buffer_re_diffuse = NULL; + hCrend->freq_buffer_im_diffuse = NULL; + hCrend->hReverb = NULL; + hCrend->delay_line_rw_index = 0; + hCrend->diffuse_delay_line_rw_index = 0; + hCrend->hTrack = NULL; + hCrend->m_fYaw = 0; + hCrend->m_fPitch = 0; + hCrend->m_fRoll = 0; +#endif + +#ifdef FIX_197_CREND_INTERFACE hHrtf = ( *pCrend )->hHrtfCrend; +#else + hHrtf = pCrend->hHrtfCrend; +#endif if ( hHrtf != NULL ) { @@ -828,10 +2128,35 @@ ivas_error ivas_rend_openCrend( { hCrend->lfe_delay_line = NULL; } +#ifdef FIX_197_CREND_INTERFACE + if ( Opt_Headrotation ) +#else + if ( false ) /* TODO tmu : check renderer headrotation flag */ +#endif + { + if ( ( hCrend->hTrack = (ivas_orient_trk_state_t *) malloc( sizeof( ivas_orient_trk_state_t ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Orientation tracking" ); + } + + ivas_orient_trk_Init( hCrend->hTrack ); + } + else + { + hCrend->hTrack = NULL; + } if ( ( hRendCfg != NULL ) && ( hRendCfg->roomAcoustics.late_reverb_on ) ) { - if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), inConfig, ( *pCrend )->hHrtfCrend, hRendCfg, output_Fs ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), + inConfig, +#ifdef FIX_197_CREND_INTERFACE + ( *pCrend )->hHrtfCrend, +#else + pCrend->hHrtfCrend, +#endif + hRendCfg, + output_Fs ) ) != IVAS_ERR_OK ) { return error; } @@ -841,27 +2166,45 @@ ivas_error ivas_rend_openCrend( hCrend->hReverb = NULL; } +#ifdef FIX_197_CREND_INTERFACE ( *pCrend )->binaural_latency_ns = (int32_t) ( ( *pCrend )->hHrtfCrend->latency_s * 1000000000.f ); +#else + pCrend->binaural_latency_ns = (int32_t) ( pCrend->hHrtfCrend->latency_s * 1000000000.f ); +#endif } +#ifdef FIX_197_CREND_INTERFACE ( *pCrend )->hCrend = hCrend; +#else + pCrend->hCrend = hCrend; +#endif return IVAS_ERR_OK; } - /*------------------------------------------------------------------------- * ivas_crend_close() * * Deallocate Crend renderer handle *------------------------------------------------------------------------*/ +#ifdef FIX_197_CREND_INTERFACE void ivas_rend_closeCrend( CREND_WRAPPER_HANDLE *pCrend ) +#else +ivas_error ivas_rend_closeCrend( + CREND_WRAPPER *pCrend ) +#endif { int16_t i; - if ( pCrend == NULL || *pCrend == NULL ) +#ifdef FIX_197_CREND_INTERFACE + if ( pCrend == NULL ) + { + return; + } + + if ( *pCrend == NULL ) { return; } @@ -927,10 +2270,71 @@ void ivas_rend_closeCrend( free( *pCrend ); *pCrend = NULL; } - return; -} +#else + if ( pCrend->hHrtfCrend != NULL ) + { + ivas_hrtf_close( &pCrend->hHrtfCrend ); + } + + if ( pCrend->hCrend != NULL ) + { + + for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) + { + if ( pCrend->hCrend->freq_buffer_re[i] != NULL ) + { + free( pCrend->hCrend->freq_buffer_re[i] ); + pCrend->hCrend->freq_buffer_re[i] = NULL; + } + if ( pCrend->hCrend->freq_buffer_im[i] != NULL ) + { + free( pCrend->hCrend->freq_buffer_im[i] ); + pCrend->hCrend->freq_buffer_im[i] = NULL; + } + } + + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + if ( pCrend->hCrend->prev_out_buffer[i] != NULL ) + { + free( pCrend->hCrend->prev_out_buffer[i] ); + pCrend->hCrend->prev_out_buffer[i] = NULL; + } + } + + if ( pCrend->hCrend->lfe_delay_line != NULL ) + { + free( pCrend->hCrend->lfe_delay_line ); + pCrend->hCrend->lfe_delay_line = NULL; + } + + if ( pCrend->hCrend->freq_buffer_re_diffuse != NULL ) + { + free( pCrend->hCrend->freq_buffer_re_diffuse ); + pCrend->hCrend->freq_buffer_re_diffuse = NULL; + } + + if ( pCrend->hCrend->freq_buffer_im_diffuse != NULL ) + { + free( pCrend->hCrend->freq_buffer_im_diffuse ); + pCrend->hCrend->freq_buffer_im_diffuse = NULL; + } + + if ( pCrend->hCrend->hTrack != NULL ) + { + free( pCrend->hCrend->hTrack ); + pCrend->hCrend->hTrack = NULL; + } + + ivas_reverb_close( &pCrend->hCrend->hReverb ); + free( pCrend->hCrend ); + pCrend->hCrend = NULL; + } + return IVAS_ERR_OK; +#endif +} /*-----------------------------------------------------------------------------------------* * Function ivas_crend_convolver() @@ -1104,14 +2508,20 @@ ivas_error ivas_rend_crendProcess( const CREND_WRAPPER *pCrend, const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, +#ifdef FIX_197_CREND_INTERFACE DECODER_CONFIG_HANDLE hDecoderConfig, HEAD_TRACK_DATA_HANDLE hHeadTrackData, IVAS_OUTPUT_SETUP_HANDLE hIntSetup, EFAP_HANDLE hEFAPdata, +#endif float output[][L_FRAME48k], /* i/o: input/output audio channels */ const int32_t output_Fs ) { +#ifdef FIX_197_CREND_INTERFACE int16_t i, subframe_idx, output_frame, subframe_len; +#else + int16_t i, subframe_idx, output_frame; +#endif int16_t nchan_out; float pcm_tmp[BINAURAL_CHANNELS][L_FRAME48k]; AUDIO_CONFIG in_config; @@ -1125,7 +2535,11 @@ ivas_error ivas_rend_crendProcess( inRendConfig = getRendAudioConfigFromIvasAudioConfig( inConfig ); outRendConfig = getRendAudioConfigFromIvasAudioConfig( outConfig ); +#ifdef FIX_197_CREND_INTERFACE in_config = getIvasAudioConfigFromRendAudioConfig( inRendConfig ); +#else + in_config = rendAudioConfigToIvasAudioConfig( inRendConfig ); +#endif inConfigType = getAudioConfigType( inRendConfig ); @@ -1135,13 +2549,15 @@ ivas_error ivas_rend_crendProcess( } output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); +#ifdef FIX_197_CREND_INTERFACE subframe_len = output_frame / MAX_PARAM_SPATIAL_SUBFRAMES; +#endif for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { +#ifdef FIX_197_CREND_INTERFACE if ( hDecoderConfig && hDecoderConfig->Opt_Headrotation && hHeadTrackData && hHeadTrackData->num_quaternions >= 0 ) { /* Orientation tracking */ -#ifndef FIX_I109_ORIENTATION_TRACKING if ( pCrend->hCrend->hTrack != NULL ) { if ( hDecoderConfig->orientation_tracking == IVAS_ORIENT_TRK_AVG ) @@ -1164,7 +2580,6 @@ ivas_error ivas_rend_crendProcess( ivas_orient_trk_GetTrackedOrientation( pCrend->hCrend->hTrack, &( pCrend->hCrend->m_fYaw ), &( pCrend->hCrend->m_fPitch ), &( pCrend->hCrend->m_fRoll ) ); } -#endif /* Rotation in SHD for: MC with elevation (5_1_2 / 5_1_4 / 7_1_4) -> BINAURAL @@ -1180,6 +2595,7 @@ ivas_error ivas_rend_crendProcess( rotateFrame_sd( hHeadTrackData, output, subframe_len, *hIntSetup, hEFAPdata, subframe_idx ); } } +#endif if ( ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) || ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) ) { diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 58de4819e8..020dd27cfa 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -139,7 +139,22 @@ ivas_error ivas_dirac_dec_init_binaural_data( set_zero( hBinaural->ChCrossImOutPrev, nBins ); hBinaural->renderStereoOutputInsteadOfBinaural = 0; +#ifdef FIX_107_5MS_SUBFRAME_RENDERING hBinaural->useSubframeMode = 1; +#else + if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->sba_mode == SBA_MODE_SPAR ) /* Use subframe-mode with SPAR, since the metadata is not in sync on a frame level */ + { + hBinaural->useSubframeMode = 1; + } + else + { +#ifdef DEBUGGING + hBinaural->useSubframeMode = st_ivas->hDecoderConfig->forceSubframeBinauralization; +#else + hBinaural->useSubframeMode = 0; /* Default to 20 ms mode. */ +#endif + } +#endif hBinaural->useTdDecorr = 0; if ( st_ivas->ivas_format == SBA_FORMAT ) @@ -284,7 +299,7 @@ void ivas_dirac_dec_close_binaural_data( DIRAC_DEC_BIN_HANDLE *hBinaural /* i/o: decoder DirAC binaural data handle */ ) { - if ( hBinaural == NULL || *hBinaural == NULL ) + if ( *hBinaural == NULL ) { return; } diff --git a/lib_rend/ivas_hrtf.c b/lib_rend/ivas_hrtf.c index 2b1f16d025..b53c636932 100644 --- a/lib_rend/ivas_hrtf.c +++ b/lib_rend/ivas_hrtf.c @@ -116,6 +116,7 @@ void ivas_HRTF_CRend_binary_close( return; } + free( *hSetOfHRTF ); *hSetOfHRTF = NULL; @@ -201,3 +202,38 @@ void ivas_HRTF_parambin_binary_close( return; } + + +/*-----------------------------------------------------------------------* + * ivas_headTrack_open() + * + * Allocate and initialize Head-Tracking handle + *-----------------------------------------------------------------------*/ + +ivas_error ivas_headTrack_open( + HEAD_TRACK_DATA_HANDLE *hHeadTrackData /* o : head track handle */ +) +{ + int16_t i; + + /* Allocate Head-Tracking handle */ + if ( ( *hHeadTrackData = (HEAD_TRACK_DATA_HANDLE) malloc( sizeof( HEAD_TRACK_DATA ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for head-tracking memory\n" ) ); + } + + /* Initialization */ + ( *hHeadTrackData )->num_quaternions = 0; + ( *hHeadTrackData )->lrSwitchInterpVal = 0.0f; + ( *hHeadTrackData )->lrSwitchedCurrent = 0; + ( *hHeadTrackData )->lrSwitchedNext = 0; + + /* Initialise Rmat_prev to I, Rmat will be computed later */ + for ( i = 0; i < 3; i++ ) + { + set_zero( ( *hHeadTrackData )->Rmat_prev[i], 3 ); + ( *hHeadTrackData )->Rmat_prev[i][i] = 1.0f; + } + + return IVAS_ERR_OK; +} diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 67f73fab30..a8be0b5ba3 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -30,7 +30,6 @@ *******************************************************************************************************/ -#include "ivas_stat_rend.h" #include #include "options.h" #include "prot.h" @@ -48,9 +47,6 @@ *---------------------------------------------------------------------*/ static void TDREND_Clear_Update_flags( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd ); -#ifdef TD5 -static void angles_to_vec( const float radius, const float azimuth, const float elevation, float *vec ); -#endif /*---------------------------------------------------------------------* * ivas_td_binaural_open_unwrap() @@ -59,14 +55,11 @@ static void angles_to_vec( const float radius, const float azimuth, const float *---------------------------------------------------------------------*/ ivas_error ivas_td_binaural_open_unwrap( - TDREND_HRFILT_FiltSet_t **hHrtfTD, /* i/o: HR filter model (from file or NULL) */ - const int32_t output_Fs, /* i : Output sampling rate */ - const int16_t nchan_transport, /* i : Number of channels */ - const IVAS_FORMAT ivas_format, /* i : IVAS format (ISM/MC) */ - const AUDIO_CONFIG transport_config, /* i : Transport configuration */ -#ifdef TD5 - const float *directivity, /* i : Directivity pattern (used for ISM) */ -#endif + TDREND_HRFILT_FiltSet_t **hHrtfTD, /* i/o: HR filter model (from file or NULL) */ + const int32_t output_Fs, /* i : Output sampling rate */ + const int16_t nchan_transport, /* i : Number of channels */ + const IVAS_FORMAT ivas_format, /* i : IVAS format (ISM/MC) */ + const AUDIO_CONFIG transport_config, /* i : Transport configuration */ const IVAS_OUTPUT_SETUP hTransSetup, /* i : Loudspeaker layout */ BINAURAL_TD_OBJECT_RENDERER_HANDLE *hBinRendererTd, /* o : TD renderer handle */ int32_t *binaural_latency_ns /* i : Binauralization delay */ @@ -175,13 +168,9 @@ ivas_error ivas_td_binaural_open_unwrap( for ( nS = 0; nS < nchan_rend; nS++ ) { /* Set source positions according to loudspeaker layout */ -#ifdef TD5 - angles_to_vec( 1.0f, ls_azimuth[nS], ls_elevation[nS], Pos ); -#else Pos[0] = cosf( ls_elevation[nS] * PI_OVER_180 ) * cosf( ls_azimuth[nS] * PI_OVER_180 ); Pos[1] = cosf( ls_elevation[nS] * PI_OVER_180 ) * sinf( ls_azimuth[nS] * PI_OVER_180 ); Pos[2] = sinf( ls_elevation[nS] * PI_OVER_180 ); -#endif Dir[0] = 1.0f; Dir[1] = 0.0f; Dir[2] = 0.0f; @@ -197,35 +186,6 @@ ivas_error ivas_td_binaural_open_unwrap( TDREND_MIX_SRC_SetDirAtten( pBinRendTd, nS, DirAtten_p ); } } -#ifdef TD5 - if ( ivas_format == ISM_FORMAT ) - { - DirAtten_p = pBinRendTd->DirAtten_p; -#ifdef TD5_FIX_INVALID_MEMORY_ACCESS - if ( NULL == directivity ) - { - DirAtten_p->ConeInnerAngle = 360.0f; /* Front cone */ - DirAtten_p->ConeOuterAngle = 360.0f; /* Back cone */ - DirAtten_p->ConeOuterGain = 1.0f; /* Back attenuation */ - } - else - { - DirAtten_p->ConeInnerAngle = directivity[0]; - DirAtten_p->ConeOuterAngle = directivity[1]; - DirAtten_p->ConeOuterGain = directivity[2]; - } -#else - DirAtten_p->ConeInnerAngle = directivity[0]; - DirAtten_p->ConeOuterAngle = directivity[1]; - DirAtten_p->ConeOuterGain = directivity[2]; -#endif - - for ( nS = 0; nS < nchan_rend; nS++ ) - { - TDREND_MIX_SRC_SetDirAtten( pBinRendTd, nS, DirAtten_p ); - } - } -#endif *hBinRendererTd = pBinRendTd; *binaural_latency_ns = (int32_t) ( ( *hBinRendererTd )->HrFiltSet_p->latency_s * 1000000000.f ); @@ -267,20 +227,30 @@ void ivas_td_binaural_close( *---------------------------------------------------------------------*/ ivas_error ivas_td_binaural_renderer_unwrap( - const REVERB_HANDLE hReverb, /* i : Reverberator handle */ - const AUDIO_CONFIG transport_config, /* i : Transport configuration */ +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + REVERB_HANDLE hReverb, /* i : reverb handle */ +#else + RENDER_CONFIG_DATA *hRenderConfig, /* i : Renderer configuration */ + const int16_t ini_frame, /* i : Initialization frame counter */ +#ifdef FIX_197_CREND_INTERFACE + CREND_WRAPPER_HANDLE hCrendWrapper, /* i : Crend wrapper handle */ +#else + CREND_HANDLE hCrend, /* i : Crend handle */ +#endif +#endif + AUDIO_CONFIG transport_config, /* i : Transport configuration */ +#ifndef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + const int32_t output_Fs, /* i : Output sampling rate */ +#endif BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD binaural object renderer handle */ - const int16_t num_src, /* i : number of sources to render */ + const int16_t nchan_transport, /* i : Transport channels (ISms) */ const int16_t lfe_idx, /* i : LFE channel index */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ + IVAS_FORMAT ivas_format, /* i : IVAS format */ ISM_METADATA_HANDLE *hIsmMetaData, /* i : ISM metadata handle */ const int16_t Opt_Headrotation, /* i : Head rotation flag */ const IVAS_QUATERNION *Quaternions, /* i : Head tracking data per subframe */ -#ifdef TD5 - const IVAS_POSITION *Pos, /* i : Listener position data per subframe */ -#endif - float output[][L_FRAME48k], /* i/o: SCE channels / Binaural synthesis */ - const int16_t output_frame /* i : output frame length */ + float output[][L_FRAME48k], /* i/o: SCE channels / Binaural synthesis */ + const int16_t output_frame /* i : output frame length */ ) { int16_t subframe_length; @@ -289,25 +259,68 @@ ivas_error ivas_td_binaural_renderer_unwrap( ivas_error error; subframe_length = output_frame / MAX_PARAM_SPATIAL_SUBFRAMES; +#ifndef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + if ( hRenderConfig != NULL ) + { + + if ( hRenderConfig->roomAcoustics.late_reverb_on && ( ini_frame == 0 ) ) + { + ivas_reverb_open( +#ifdef FIX_197_CREND_INTERFACE + &hCrendWrapper->hCrend->hReverb, +#else + &hCrend->hReverb, +#endif + transport_config, + NULL, + hRenderConfig, + output_Fs ); + } + } +#endif /* Update object position(s) */ - TDREND_Update_object_positions( hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, output ); + TDREND_Update_object_positions( hBinRendererTd, nchan_transport, lfe_idx, ivas_format, hIsmMetaData, output ); for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { /* Update the listener's location/orientation */ -#ifdef TD5 - TDREND_Update_listener_orientation( hBinRendererTd, Opt_Headrotation, ( Quaternions != NULL ) ? &Quaternions[subframe_idx] : NULL, ( Pos != NULL ) ? &Pos[subframe_idx] : NULL ); -#else TDREND_Update_listener_orientation( hBinRendererTd, Opt_Headrotation, ( Quaternions != NULL ) ? &Quaternions[subframe_idx] : NULL ); -#endif - if ( hReverb != NULL && hReverb->pConfig.roomAcoustics.late_reverb_on ) +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + if ( ( hReverb != NULL ) && ( hReverb->pConfig.roomAcoustics.late_reverb_on ) ) +#else + if ( ( hRenderConfig != NULL ) && ( hRenderConfig->roomAcoustics.late_reverb_on ) ) +#endif { - if ( ( error = ivas_reverb_process( hReverb, transport_config, 0, output, reverb_signal, subframe_idx ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_process( +#ifdef FIX_197_CREND_INTERFACE +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + hReverb, +#else + hCrendWrapper->hCrend->hReverb, +#endif +#else + hCrend->hReverb, +#endif + transport_config, 0, output, reverb_signal, subframe_idx ) ) != IVAS_ERR_OK ) { return error; } + +#ifndef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + ivas_reverb_process( +#ifdef FIX_197_CREND_INTERFACE + hCrendWrapper->hCrend->hReverb, +#else + hCrend->hReverb, +#endif + transport_config, + 0, + output, + reverb_signal, + subframe_idx ); +#endif } /* Render subframe */ @@ -318,12 +331,24 @@ ivas_error ivas_td_binaural_renderer_unwrap( } - if ( hReverb != NULL && hReverb->pConfig.roomAcoustics.late_reverb_on ) +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + if ( ( hReverb != NULL ) && ( hReverb->pConfig.roomAcoustics.late_reverb_on ) ) { /* add reverb to rendered signals */ v_add( reverb_signal[0], output[0], output[0], output_frame ); v_add( reverb_signal[1], output[1], output[1], output_frame ); } +#else + if ( hRenderConfig != NULL ) /* Renderer Configuration not enabled in TD standalone renderer */ + { + if ( hRenderConfig->roomAcoustics.late_reverb_on ) + { + /* add reverb to rendered signals */ + v_add( reverb_signal[0], output[0], output[0], output_frame ); + v_add( reverb_signal[1], output[1], output[1], output_frame ); + } + } +#endif return IVAS_ERR_OK; } @@ -337,7 +362,7 @@ ivas_error ivas_td_binaural_renderer_unwrap( ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ - float output[][L_FRAME48k], /* i/o: ISM object synth / rendered output in 0,1 */ + float output[][L_FRAME48k], /* i/o: ISm object synth / rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ ) @@ -426,7 +451,7 @@ static void TDREND_Clear_Update_flags( void TDREND_Update_object_positions( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o : TD Renderer handle */ - const int16_t num_src, /* i : number of sources to render */ + const int16_t numSources, /* i : Number of sources to render */ const int16_t lfe_idx, /* i : Input LFE index */ const IVAS_FORMAT in_format, /* i : Format of input sources */ const ISM_METADATA_HANDLE *hIsmMetaData, /* i : Input metadata for ISM objects */ @@ -443,7 +468,7 @@ void TDREND_Update_object_positions( /* For each source, write the frame data to the source object*/ c_indx = 0; - for ( nS = 0; nS < num_src; nS++ ) + for ( nS = 0; nS < numSources; nS++ ) { if ( !( in_format == MC_FORMAT && nS == lfe_idx ) ) /* Skip LFE for MC */ { @@ -457,10 +482,6 @@ void TDREND_Update_object_positions( /* Update the source positions */ /* Source position and direction */ -#ifdef TD5 - angles_to_vec( hIsmMetaData[nS]->radius, hIsmMetaData[nS]->azimuth, hIsmMetaData[nS]->elevation, Pos ); - angles_to_vec( 1.0f, hIsmMetaData[nS]->yaw, hIsmMetaData[nS]->pitch, Dir ); -#else Pos[0] = cosf( hIsmMetaData[nS]->elevation * PI_OVER_180 ) * cosf( hIsmMetaData[nS]->azimuth * PI_OVER_180 ); Pos[1] = cosf( hIsmMetaData[nS]->elevation * PI_OVER_180 ) * sinf( hIsmMetaData[nS]->azimuth * PI_OVER_180 ); Pos[2] = sinf( hIsmMetaData[nS]->elevation * PI_OVER_180 ); @@ -468,7 +489,6 @@ void TDREND_Update_object_positions( Dir[1] = 0.0f; Dir[2] = 0.0f; -#endif /* Source directivity info */ DirAtten_p->ConeInnerAngle = 360.0f; DirAtten_p->ConeOuterAngle = 360.0f; @@ -495,29 +515,19 @@ void TDREND_Update_object_positions( void TDREND_Update_listener_orientation( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD Renderer handle */ const int16_t headRotEnabled, /* i : Headrotation flag */ -#ifdef TD5 - const IVAS_QUATERNION *headPosition, /* i : Listener orientation */ - const IVAS_POSITION *Pos /* i : Listener Position */ -#else - const IVAS_QUATERNION *headPosition /* i : Head Position */ -#endif + const IVAS_QUATERNION *headPosition /* i : Head Position */ ) { -#ifndef TD5 float Pos[3]; -#endif float FrontVec[3]; float UpVec[3]; float Rmat[3][3]; -#ifdef TD5 - float Pos_p[3]; -#else + /* Update the listener's location/orientation */ /* Listener at the origin */ Pos[0] = 0.0f; Pos[1] = 0.0f; Pos[2] = 0.0f; -#endif if ( headRotEnabled ) { @@ -531,12 +541,6 @@ void TDREND_Update_listener_orientation( UpVec[0] = Rmat[2][0]; UpVec[1] = Rmat[2][1]; UpVec[2] = Rmat[2][2]; -#ifdef TD5 - /* Input position */ - Pos_p[0] = ( *Pos ).x; - Pos_p[1] = ( *Pos ).y; - Pos_p[2] = ( *Pos ).z; -#endif } else { @@ -548,20 +552,10 @@ void TDREND_Update_listener_orientation( UpVec[0] = 0.0f; UpVec[1] = 0.0f; UpVec[2] = 1.0f; -#ifdef TD5 - /* Listener at the origin */ - Pos_p[0] = 0.0f; - Pos_p[1] = 0.0f; - Pos_p[2] = 0.0f; -#endif } /* Set the listener position and orientation:*/ -#ifdef TD5 - TDREND_MIX_LIST_SetPos( hBinRendererTd, Pos_p ); -#else TDREND_MIX_LIST_SetPos( hBinRendererTd, Pos ); -#endif TDREND_MIX_LIST_SetOrient( hBinRendererTd, FrontVec, UpVec ); return; @@ -577,9 +571,6 @@ void TDREND_Update_listener_orientation( ivas_error ivas_td_binaural_open_ext( TDREND_WRAPPER *pTDRend, IVAS_REND_AudioConfig inConfig, -#ifdef TD5 - RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ -#endif LSSETUP_CUSTOM_STRUCT *customLsInput, const int32_t outFs ) { @@ -588,9 +579,6 @@ ivas_error ivas_td_binaural_open_ext( IVAS_FORMAT ivas_format; IVAS_OUTPUT_SETUP hTransSetup; ivas_error error; -#ifdef TD5_FIX_INVALID_MEMORY_ACCESS - float *directivity = NULL; -#endif if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) { @@ -604,25 +592,16 @@ ivas_error ivas_td_binaural_open_ext( nchan_transport = customLsInput->num_spk; } +#ifdef FIX_197_CREND_INTERFACE transport_config = getIvasAudioConfigFromRendAudioConfig( inConfig ); +#else + transport_config = rendAudioConfigToIvasAudioConfig( inConfig ); +#endif ivas_format = ( getAudioConfigType( inConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) ? MC_FORMAT : ISM_FORMAT; hTransSetup.ls_azimuth = customLsInput->ls_azimuth; hTransSetup.ls_elevation = customLsInput->ls_elevation; -#ifdef TD5 -#ifdef TD5_FIX_INVALID_MEMORY_ACCESS - if ( NULL != hRendCfg ) - { - directivity = hRendCfg->directivity; - } - - return ivas_td_binaural_open_unwrap( &pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, directivity, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns ); -#else - return ivas_td_binaural_open_unwrap( &pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, hRendCfg->directivity, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns ); -#endif -#else return ivas_td_binaural_open_unwrap( &pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns ); -#endif } @@ -639,19 +618,28 @@ ivas_error ivas_td_binaural_renderer_ext( const LSSETUP_CUSTOM_STRUCT *customLsInput, /* i : Input custom loudspeaker layout */ const IVAS_REND_HeadRotData *headRotData, /* i : Input head positions */ const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */ - const REVERB_HANDLE hReverb, /* i : Reverberator handle */ - const int16_t output_frame, /* i : output frame length */ - float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + const REVERB_HANDLE reverb, /* i : reverb handle */ +#endif + const int16_t output_frame, /* i : output frame length */ + float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ ) { ISM_METADATA_FRAME hIsmMetaDataFrame; ISM_METADATA_HANDLE hIsmMetaData[1]; int16_t lfe_idx; int16_t num_src; +#ifndef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + /* TODO tmu : pass down renderer config struct */ + // float reverb_signal[BINAURAL_CHANNELS][L_FRAME48k]; +#endif IVAS_FORMAT ivas_format; IVAS_REND_AudioConfigType inConfigType; AUDIO_CONFIG transport_config; ivas_error error; +#ifndef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + int32_t output_Fs; +#endif push_wmops( "ivas_td_binaural_renderer_ext" ); @@ -662,7 +650,9 @@ ivas_error ivas_td_binaural_renderer_ext( if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { ivas_format = MC_FORMAT; +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND transport_config = getIvasAudioConfigFromRendAudioConfig( inConfig ); +#endif if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = getAudioConfigNumChannels( inConfig, &num_src ) ) != IVAS_ERR_OK ) @@ -680,51 +670,38 @@ ivas_error ivas_td_binaural_renderer_ext( { ivas_format = ISM_FORMAT; num_src = 1; +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND transport_config = AUDIO_CONFIG_ISM1; +#endif hIsmMetaData[0] = &hIsmMetaDataFrame; hIsmMetaData[0]->azimuth = currentPos->azimuth; hIsmMetaData[0]->elevation = currentPos->elevation; -#ifdef TD5 - hIsmMetaData[0]->yaw = currentPos->yaw; - hIsmMetaData[0]->pitch = currentPos->pitch; - hIsmMetaData[0]->radius = currentPos->radius; -#endif } - if ( ( error = ivas_td_binaural_renderer_unwrap( hReverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, headRotData->headRotEnabled, - ( headRotData != NULL ) ? headRotData->headPositions : NULL, -#ifdef TD5 - ( headRotData != NULL ) ? headRotData->Pos : NULL, output, output_frame ) ) != IVAS_ERR_OK ) +#ifndef FIX_330_ENABLE_TD_RENDERER_REVERB_REND +#ifdef FIX_197_CREND_INTERFACE + transport_config = getIvasAudioConfigFromRendAudioConfig( inConfig ); #else - output, output_frame ) ) != IVAS_ERR_OK ) + transport_config = rendAudioConfigToIvasAudioConfig( inConfig ); +#endif + output_Fs = output_frame * 50; #endif +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + if ( ( error = ivas_td_binaural_renderer_unwrap( reverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, headRotData->headRotEnabled, + ( headRotData != NULL ) ? headRotData->headPositions : NULL, output, output_frame ) ) != IVAS_ERR_OK ) + { + return error; + } +#else + if ( ( error = error = ivas_td_binaural_renderer_unwrap( NULL, 1, NULL, transport_config, output_Fs, pTDRend->hBinRendererTd, num_src, lfe_idx, + ivas_format, hIsmMetaData, headRotData->headRotEnabled, ( headRotData != NULL ) ? headRotData->headPositions : NULL, + output, output_frame ) ) != IVAS_ERR_OK ) { return error; } +#endif pop_wmops(); return IVAS_ERR_OK; } - -#ifdef TD5 -/*---------------------------------------------------------------------* - * angles_to_vec() - * - * Convert azimuth and elevation angles to position/orientation vector - *---------------------------------------------------------------------*/ - -static void angles_to_vec( - const float radius, /* i : radius */ - const float azimuth, /* i : Azimuth angle */ - const float elevation, /* i : Elevation angle */ - float *vec /* o : Pos/Dir vector */ -) -{ - vec[0] = radius * cosf( elevation * PI_OVER_180 ) * cosf( azimuth * PI_OVER_180 ); - vec[1] = radius * cosf( elevation * PI_OVER_180 ) * sinf( azimuth * PI_OVER_180 ); - vec[2] = radius * sinf( elevation * PI_OVER_180 ); - - return; -} -#endif diff --git a/lib_rend/ivas_objectRenderer_hrFilt.c b/lib_rend/ivas_objectRenderer_hrFilt.c index d28abdba30..0220b48145 100644 --- a/lib_rend/ivas_objectRenderer_hrFilt.c +++ b/lib_rend/ivas_objectRenderer_hrFilt.c @@ -69,21 +69,10 @@ ivas_error TDREND_REND_RenderSourceHRFilt( { float LeftOutputFrame[L_SPATIAL_SUBFR_48k]; float RightOutputFrame[L_SPATIAL_SUBFR_48k]; -#ifdef TD5 - float Gain; - - Gain = ( *Src_p->SrcRend_p->DirGain_p ) * ( *Src_p->SrcRend_p->DistGain_p ); -#endif TDREND_Apply_ITD( Src_p->InputFrame_p, LeftOutputFrame, RightOutputFrame, &Src_p->previtd, Src_p->itd, Src_p->mem_itd, subframe_length ); -#ifdef TD5 - TDREND_firfilt( LeftOutputFrame, Src_p->hrf_left_prev, hrf_left_delta, intp_count, Src_p->mem_hrf_left, subframe_length, Src_p->filterlength, Gain ); - TDREND_firfilt( RightOutputFrame, Src_p->hrf_right_prev, hrf_right_delta, intp_count, Src_p->mem_hrf_right, subframe_length, Src_p->filterlength, Gain ); -#else TDREND_firfilt( LeftOutputFrame, Src_p->hrf_left_prev, hrf_left_delta, intp_count, Src_p->mem_hrf_left, subframe_length, Src_p->filterlength ); TDREND_firfilt( RightOutputFrame, Src_p->hrf_right_prev, hrf_right_delta, intp_count, Src_p->mem_hrf_right, subframe_length, Src_p->filterlength ); -#endif - /* Copy to accumulative output frame */ v_add( LeftOutputFrame, output_buf[0], output_buf[0], subframe_length ); v_add( RightOutputFrame, output_buf[1], output_buf[1], subframe_length ); diff --git a/lib_rend/ivas_objectRenderer_sfx.c b/lib_rend/ivas_objectRenderer_sfx.c index 72493b0501..005025827b 100644 --- a/lib_rend/ivas_objectRenderer_sfx.c +++ b/lib_rend/ivas_objectRenderer_sfx.c @@ -182,7 +182,6 @@ static void sincResample( const float *p_sinc_forward; const float *p_sinc_backward; - /* Compute fractional time step */ t_step = (float) ( length_in ) / (float) ( length_out ); t_frac = 0; @@ -235,12 +234,7 @@ void TDREND_firfilt( const int16_t intp_count, /* i : interpolation count */ float *mem, /* i/o: filter memory */ const int16_t subframe_length, /* i : Length of signal */ -#ifdef TD5 - const int16_t filterlength, /* i : Filter length */ - const float Gain /* i : Gain */ -#else - const int16_t filterlength /* i : Filter length */ -#endif + const int16_t filterlength /* i : Filter length */ ) { float buffer[SFX_SPAT_BIN_MAX_FILTER_LENGTH - 1 + L_SUBFRAME5MS_48k]; @@ -266,11 +260,7 @@ void TDREND_firfilt( { tmp += ( *p_filter++ ) * ( *p_tmp-- ); } -#ifdef TD5 - signal[i] = tmp * Gain; -#else signal[i] = tmp; -#endif if ( i < intp_count ) { diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 2a13efc24c..d524228812 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -266,9 +266,6 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( TDREND_MIX_Listener_t *Listener_p; TDREND_HRFILT_FiltSet_t *HrFiltSet_p; float ListRelPos[3], ListRelDist; -#ifdef TD5 - float ListRelPosAbs[3]; /* Relative position, ignoring orientation of listener */ -#endif float Azim, Elev; float hrf_left[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; float hrf_right[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; @@ -290,22 +287,14 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( break; case TDREND_POSTYPE_ABSOLUTE: /* Absolute position */ -#ifdef TD5 - TDREND_SPATIAL_VecMapToNewCoordSystem( SrcSpatial_p->Pos_p, Listener_p->Pos, Listener_p->Front, Listener_p->Up, Listener_p->Right, ListRelPos, ListRelPosAbs ); -#else TDREND_SPATIAL_VecMapToNewCoordSystem( SrcSpatial_p->Pos_p, Listener_p->Pos, Listener_p->Front, Listener_p->Up, Listener_p->Right, ListRelPos ); -#endif break; default: /* Illegal position type */ #ifdef DEBUGGING printf( "Warning! TDREND_SRC_REND_UpdateFiltersFromSpatialParams: Invalid position type. Assuming absolute position!\n" ); #endif /* Assume absolute position */ -#ifdef TD5 - TDREND_SPATIAL_VecMapToNewCoordSystem( SrcSpatial_p->Pos_p, Listener_p->Pos, Listener_p->Front, Listener_p->Up, Listener_p->Right, ListRelPos, ListRelPosAbs ); -#else TDREND_SPATIAL_VecMapToNewCoordSystem( SrcSpatial_p->Pos_p, Listener_p->Pos, Listener_p->Front, Listener_p->Up, Listener_p->Right, ListRelPos ); -#endif break; } @@ -331,11 +320,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( *SrcRend_p->DirGain_p = 1.0f; if ( SrcSpatial_p->DirAttenEnabled ) { -#ifdef TD5 - *SrcRend_p->DirGain_p = TDREND_SRC_SPATIAL_GetDirGain( &SrcSpatial_p->DirAtten, SrcSpatial_p->Front_p, ListRelPosAbs ); -#else *SrcRend_p->DirGain_p = TDREND_SRC_SPATIAL_GetDirGain( &SrcSpatial_p->DirAtten, SrcSpatial_p->Front_p, ListRelPos ); -#endif } /* Distance gain */ diff --git a/lib_rend/ivas_objectRenderer_vec.c b/lib_rend/ivas_objectRenderer_vec.c index f17d769821..c3a780c725 100644 --- a/lib_rend/ivas_objectRenderer_vec.c +++ b/lib_rend/ivas_objectRenderer_vec.c @@ -111,22 +111,9 @@ void TDREND_SPATIAL_VecMapToNewCoordSystem( const float *DirVec_p, /* i : Direction vector */ const float *UpVec_p, /* i : Up vector */ const float *RightVec_p, /* i : Right vector */ -#ifdef TD5 - float *MappedVec_p, /* o : Transformed vector */ - float *LisRelPosAbs /* o : Transformed vector ignoring orientation */ -#else - float *MappedVec_p /* o : Transformed vector */ -#endif + float *MappedVec_p /* o : Transformed vector */ ) { -#ifdef TD5 - v_sub( Vec_p, TranslVec_p, LisRelPosAbs, 3 ); - /* Evalute the relative Vec in the coordinates of the Orientation vectors, */ - /* which form an orthonormal basis */ - MappedVec_p[0] = dotp( LisRelPosAbs, DirVec_p, 3 ); - MappedVec_p[1] = dotp( LisRelPosAbs, RightVec_p, 3 ); - MappedVec_p[2] = dotp( LisRelPosAbs, UpVec_p, 3 ); -#else float RelVec[3]; /* Evaluate Vec relative to the new origin given by TranslVec */ @@ -137,7 +124,7 @@ void TDREND_SPATIAL_VecMapToNewCoordSystem( MappedVec_p[0] = dotp( RelVec, DirVec_p, 3 ); MappedVec_p[1] = dotp( RelVec, RightVec_p, 3 ); MappedVec_p[2] = dotp( RelVec, UpVec_p, 3 ); -#endif + return; } diff --git a/lib_rend/ivas_orient_trk.c b/lib_rend/ivas_orient_trk.c index af71cbf543..4eec8ecd56 100644 --- a/lib_rend/ivas_orient_trk.c +++ b/lib_rend/ivas_orient_trk.c @@ -30,7 +30,6 @@ *******************************************************************************************************/ -#include "common_api_types.h" #include #include "options.h" #include "ivas_prot.h" @@ -50,332 +49,15 @@ #define MAX_TRACKED_ANGLE_AVG_ORIENT PI_OVER_2 #define MAX_TRACKED_ANGLE_REF_ORIENT EVS_PI -#define OTR_UPDATE_RATE (float) FRAMES_PER_SEC /* rate of the Process() calls [Hz]; 1x per IVAS frame */ - -/*------------------------------------------------------------------------------------------* - * Local functions - *------------------------------------------------------------------------------------------*/ - -#ifdef FIX_I109_ORIENTATION_TRACKING -/*------------------------------------------------------------------------------------------* - * IdentityQuaternion() - * - * - *------------------------------------------------------------------------------------------*/ - -static IVAS_QUATERNION IdentityQuaternion( - void ) -{ - IVAS_QUATERNION q; - - q.w = 1.0f; - q.x = q.y = q.z = 0.0f; - - return q; -} - - -/*------------------------------------------------------------------------------------------* - * QuaternionProduct() - * - * Quaternion product - *------------------------------------------------------------------------------------------*/ - -static void QuaternionProduct( - const IVAS_QUATERNION q1, - const IVAS_QUATERNION q2, - IVAS_QUATERNION *const r ) -{ - IVAS_QUATERNION tmp; - tmp.w = q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z; - tmp.x = q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y; - tmp.y = q1.w * q2.y - q1.x * q2.z + q1.y * q2.w + q1.z * q2.x; - tmp.z = q1.w * q2.z + q1.x * q2.y - q1.y * q2.x + q1.z * q2.w; - - *r = tmp; - - return; -} - -/*------------------------------------------------------------------------------------------* - * QuaternionDotProduct() - * - * Quaternion dot product - *------------------------------------------------------------------------------------------*/ - -static float QuaternionDotProduct( - const IVAS_QUATERNION q1, - const IVAS_QUATERNION q2 ) -{ - return q1.x * q2.x + q1.y * q2.y + q1.z * q2.z + q1.w * q2.w; -} - - -/*------------------------------------------------------------------------------------------* - * QuaternionDivision() - * - * Divides a quaternion by a scalar - *------------------------------------------------------------------------------------------*/ - -static void QuaternionDivision( - const IVAS_QUATERNION q, - const float d, - IVAS_QUATERNION *const r ) -{ - r->w = q.w / d; - r->x = q.x / d; - r->y = q.y / d; - r->z = q.z / d; - - return; -} - - -/*------------------------------------------------------------------------------------------* - * QuaternionNormalize() - * - * Normalizes a quaternion - *------------------------------------------------------------------------------------------*/ - -static void QuaternionNormalize( - const IVAS_QUATERNION q, - IVAS_QUATERNION *const r ) -{ - QuaternionDivision( q, sqrtf( QuaternionDotProduct( q, q ) ), r ); - - return; -} - - -/*------------------------------------------------------------------------------------------* - * QuaternionSlerp() - * - * Computes a spherical linear interpolation between two quaternions - *------------------------------------------------------------------------------------------*/ - -static void QuaternionSlerp( - const IVAS_QUATERNION q1, - const IVAS_QUATERNION q2, - const float t, - IVAS_QUATERNION *const r ) -{ - float angle, denom, s, s2; - - s = QuaternionDotProduct( q1, q2 ); - - if ( fabsf( s ) >= 1.0f ) - { - *r = q2; - return; - } - - angle = acosf( s ); - denom = sinf( angle ); - - s = sinf( ( 1 - t ) * angle ); - s2 = sinf( t * angle ); - r->x = ( q1.x * s + q2.x * s2 ) / denom; - r->y = ( q1.y * s + q2.y * s2 ) / denom; - r->z = ( q1.z * s + q2.z * s2 ) / denom; - r->w = ( q1.w * s + q2.w * s2 ) / denom; - - QuaternionNormalize( *r, r ); - - return; -} - - -/*------------------------------------------------------------------------------------------* - * QuaternionConjugate() - * - * Computes a quaternion conjugate - *------------------------------------------------------------------------------------------*/ - -static void QuaternionConjugate( - const IVAS_QUATERNION q, - IVAS_QUATERNION *const r ) -{ - r->w = q.w; - r->x = -q.x; - r->y = -q.y; - r->z = -q.z; - - return; -} - - -/*------------------------------------------------------------------------------------------* - * QuaternionAngle() - * - * Computes an angle between two quaternions - *------------------------------------------------------------------------------------------*/ - -static float QuaternionAngle( - const IVAS_QUATERNION q1, - const IVAS_QUATERNION q2 ) -{ - IVAS_QUATERNION q12; - float angle; - - QuaternionConjugate( q1, &q12 ); - QuaternionProduct( q12, q2, &q12 ); - angle = 2.0f * atan2f( sqrtf( q12.x * q12.x + q12.y * q12.y + q12.z * q12.z ), q12.w ); - - return angle; -} - - -/*------------------------------------------------------------------------------------------* - * QuaternionInverse() - * - * Computes an inverse quaternion - *------------------------------------------------------------------------------------------*/ - -static void QuaternionInverse( - const IVAS_QUATERNION q, - IVAS_QUATERNION *const r ) -{ - float dot_product; - - dot_product = QuaternionDotProduct( q, q ); - QuaternionConjugate( q, r ); - QuaternionDivision( *r, dot_product, r ); - - return; -} - - -#ifdef OTR_REFERENCE_VECTOR_TRACKING -/*------------------------------------------------------------------------------------------* - * VectorSubtract() - * - * Computes the difference of two vectors - *------------------------------------------------------------------------------------------*/ - -static IVAS_VECTOR3 VectorSubtract( - const IVAS_VECTOR3 p1, - const IVAS_VECTOR3 p2 ) -{ - IVAS_VECTOR3 result; - - result.x = p1.x - p2.x; - result.y = p1.y - p2.y; - result.z = p1.z - p2.z; - - return result; -} - - -/*------------------------------------------------------------------------------------------* - * VectorCrossProduct() - * - * Computes the cross product of two vectors - *------------------------------------------------------------------------------------------*/ - -static IVAS_VECTOR3 VectorCrossProduct( - const IVAS_VECTOR3 p1, - const IVAS_VECTOR3 p2 ) -{ - IVAS_VECTOR3 result; - result.x = p1.y * p2.z - p1.z * p2.y; - result.y = p1.z * p2.x - p1.x * p2.z; - result.z = p1.x * p2.y - p1.y * p2.x; - - return result; -} - - -/*------------------------------------------------------------------------------------------* - * VectorDotProduct( - * - * Computes the dot product of two vectors - *------------------------------------------------------------------------------------------*/ - -static float VectorDotProduct( - const IVAS_VECTOR3 p1, - const IVAS_VECTOR3 p2 ) -{ - return p1.x * p2.x + p1.y * p2.y + p1.z * p2.z; -} - - -/*------------------------------------------------------------------------------------------* - * VectorLength() - * - * Computes the length of a vector - *------------------------------------------------------------------------------------------*/ - -static float VectorLength( - const IVAS_VECTOR3 p ) -{ - return sqrtf( p.x * p.x + p.y * p.y + p.z * p.z ); -} +/* TODO relate to frame rate - assumed here 50Hz, i.e. 20ms frame length */ +#define OTR_UPDATE_RATE ( 50.0f ) /* rate of the Process() calls [Hz]; 1x per IVAS frame */ /*------------------------------------------------------------------------------------------* - * VectorNormalize() - * - * Normalizes a vector - *------------------------------------------------------------------------------------------*/ - -static IVAS_VECTOR3 VectorNormalize( - const IVAS_VECTOR3 p ) -{ - IVAS_VECTOR3 result; - - const float length = VectorLength( p ); - - result.x = p.x / length; - result.y = p.y / length; - result.z = p.z / length; - - return result; -} - - -/*------------------------------------------------------------------------------------------* - * VectorRotationToQuaternion() - * - * Computes a quaternion representing the rotation from vector p1 to vector p2 + * Local functions *------------------------------------------------------------------------------------------*/ -static void VectorRotationToQuaternion( - const IVAS_VECTOR3 p1, - const IVAS_VECTOR3 p2, - IVAS_QUATERNION *const r ) -{ - float dot_product; - IVAS_VECTOR3 cross_product, p1_normalized, p2_normalized; - - p1_normalized = VectorNormalize( p1 ); - p2_normalized = VectorNormalize( p2 ); - cross_product = VectorCrossProduct( p1_normalized, p2_normalized ); - dot_product = VectorDotProduct( p1_normalized, p2_normalized ); - - if ( dot_product < -0.999999 ) - { - /* happens when the p1 vector is parallel to p2, but direction is flipped */ - r->w = 0.0f; - r->x = 0.0f; - r->y = 0.0f; - r->z = 1.0f; - } - else - { - /* all regular cases */ - r->x = cross_product.x; - r->y = cross_product.y; - r->z = cross_product.z; - r->w = 1.0f + dot_product; - } - - QuaternionNormalize( *r, r ); - - return; -} -#endif /* OTR_REFERENCE_VECTOR_TRACKING */ -#else static float ClipAngle( const float angle, const float min_angle, @@ -413,7 +95,6 @@ static float ClipAngle( return result; } -#endif /*-------------------------------------------------------------------* * ivas_orient_trk_Init() @@ -421,27 +102,11 @@ static float ClipAngle( * *-------------------------------------------------------------------*/ -#ifdef FIX_I109_ORIENTATION_TRACKING -ivas_error ivas_orient_trk_Init( -#else void ivas_orient_trk_Init( -#endif - ivas_orient_trk_state_t *pOTR ) /* i/o : orientation tracker handle */ + ivas_orient_trk_state_t *pOTR ) { -#ifdef FIX_I109_ORIENTATION_TRACKING - IVAS_QUATERNION identity; - - if ( pOTR == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - identity.w = 1.0f; - identity.x = identity.y = identity.z = 0.0f; -#else /* Track relative to a reference orientation */ pOTR->trackingType = OTR_TRACKING_REF_ORIENT; -#endif /* configuration parameters */ pOTR->centerAdaptationRate = 1.0f / 30.0f; @@ -451,19 +116,6 @@ void ivas_orient_trk_Init( /* initial adaptivity filter coefficient, will be auto-adapted */ pOTR->alpha = sinf( PI2 * pOTR->offCenterAdaptationRate / OTR_UPDATE_RATE ); /* start adaptation at off-center rate = fastest rate */ -#ifdef FIX_I109_ORIENTATION_TRACKING -#ifdef OTR_REFERENCE_VECTOR_TRACKING - pOTR->trkRot = identity; -#endif /* OTR_REFERENCE_VECTOR_TRACKING */ - pOTR->absAvgRot = identity; - /* Use frontal and horiontal orientation as reference orientation, unless/until overridden */ - pOTR->refRot = identity; - - /* set safe default tracking mode */ - pOTR->trackingType = OTR_TRACKING_NONE; - - return IVAS_ERR_OK; -#else pOTR->absYaw = 0.0f; pOTR->absPitch = 0.0f; pOTR->absRoll = 0.0f; @@ -483,7 +135,6 @@ void ivas_orient_trk_Init( pOTR->trkRoll = 0.0f; return; -#endif } @@ -493,178 +144,16 @@ void ivas_orient_trk_Init( * *-------------------------------------------------------------------*/ -#ifdef FIX_I109_ORIENTATION_TRACKING -ivas_error ivas_orient_trk_SetTrackingType( - ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ - const OTR_TRACKING_T trackingType /* i/o: orientation tracking type */ -) -{ - if ( pOTR == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - pOTR->trackingType = trackingType; - - return IVAS_ERR_OK; -} -#else void ivas_orient_trk_SetTrackingType( - ivas_orient_trk_state_t *pOTR, /* i/o : orientation tracker handle */ - const OTR_TRACKING_T trackingType ) /* i/o : orientation tracking type */ + ivas_orient_trk_state_t *pOTR, + const OTR_TRACKING_T trackingType ) { pOTR->trackingType = trackingType; -} -#endif - -#ifdef FIX_I109_ORIENTATION_TRACKING -/*-------------------------------------------------------------------* - * ivas_orient_trk_SetReferenceRotation() - * - * - *-------------------------------------------------------------------*/ - -ivas_error ivas_orient_trk_SetReferenceRotation( - ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ - const IVAS_QUATERNION refRot /* i : reference rotation */ -) -{ - if ( pOTR == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - /* check for Euler angle signaling */ - if ( refRot.w == -3.0f ) - { - Euler2Quat( deg2rad( refRot.x ), deg2rad( refRot.y ), deg2rad( refRot.z ), &pOTR->refRot ); - } - else - { - pOTR->refRot = refRot; - } - - return IVAS_ERR_OK; -} - -/*-------------------------------------------------------------------* - * ivas_orient_trk_GetMainOrientation() - * - * - *-------------------------------------------------------------------*/ - -ivas_error ivas_orient_trk_GetMainOrientation( - ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ - IVAS_QUATERNION *pOrientation /* i/o: average/reference orientation */ -) -{ - if ( pOTR == NULL || pOrientation == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - switch ( pOTR->trackingType ) - { - case OTR_TRACKING_NONE: - *pOrientation = IdentityQuaternion(); - break; -#ifdef OTR_REFERENCE_VECTOR_TRACKING - case OTR_TRACKING_REF_VEC: - case OTR_TRACKING_REF_VEC_LEV: -#endif /* OTR_REFERENCE_VECTOR_TRACKING */ - case OTR_TRACKING_REF_ORIENT: - *pOrientation = pOTR->refRot; - break; - case OTR_TRACKING_AVG_ORIENT: - *pOrientation = pOTR->absAvgRot; - break; - } - - return IVAS_ERR_OK; -} - - -/*-------------------------------------------------------------------* - * ivas_orient_trk_GetTrackedRotation() - * - * - *-------------------------------------------------------------------*/ - -ivas_error ivas_orient_trk_GetTrackedRotation( - ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ - IVAS_QUATERNION *pRotation /* i/o: processed rotation */ -) -{ - if ( pOTR == NULL || pRotation == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - *pRotation = pOTR->trkRot; - - return IVAS_ERR_OK; + return; } -#ifdef OTR_REFERENCE_VECTOR_TRACKING -/*-------------------------------------------------------------------* - * ivas_orient_trk_SetReferenceVector() - * - * - *-------------------------------------------------------------------*/ - -ivas_error ivas_orient_trk_SetReferenceVector( - ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ - const IVAS_VECTOR3 listenerPos, /* i : Listener position */ - const IVAS_VECTOR3 refPos /* i : Reference position */ -) -{ - IVAS_VECTOR3 acousticFrontVector, ivasForwardVector; - IVAS_VECTOR3 listenerPosLevel, refPosLevel; - float acousticFrontVectorLength; - - if ( pOTR == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - switch ( pOTR->trackingType ) - { - case OTR_TRACKING_NONE: - case OTR_TRACKING_REF_ORIENT: - case OTR_TRACKING_AVG_ORIENT: - case OTR_TRACKING_REF_VEC: - acousticFrontVector = VectorSubtract( listenerPos, refPos ); - break; - case OTR_TRACKING_REF_VEC_LEV: - /* ignore the height difference between listener position and reference position */ - listenerPosLevel.z = refPosLevel.z = listenerPos.z; - listenerPosLevel.x = listenerPos.x; - listenerPosLevel.y = listenerPos.y; - refPosLevel.x = refPos.x; - refPosLevel.y = refPos.y; - acousticFrontVector = VectorSubtract( listenerPosLevel, refPosLevel ); - break; - default: - return IVAS_ERR_WRONG_PARAMS; - } - - acousticFrontVectorLength = VectorLength( acousticFrontVector ); - - /* if the length is zero, the user has entered insensible listener and reference positions */ - if ( acousticFrontVectorLength < 0.0001f ) - { - return IVAS_ERR_WRONG_PARAMS; - } - - ivasForwardVector.x = -1.0f; - ivasForwardVector.y = 0.0f; - ivasForwardVector.z = 0.0f; - VectorRotationToQuaternion( ivasForwardVector, acousticFrontVector, &pOTR->refRot ); - - return IVAS_ERR_OK; -} -#endif /* OTR_REFERENCE_VECTOR_TRACKING */ -#else /*-------------------------------------------------------------------* * ivas_orient_trk_SetAbsoluteOrientation() * @@ -684,7 +173,6 @@ void ivas_orient_trk_SetAbsoluteOrientation( return; } -#endif /*-------------------------------------------------------------------* @@ -693,99 +181,6 @@ void ivas_orient_trk_SetAbsoluteOrientation( * *-------------------------------------------------------------------*/ -#ifdef FIX_I109_ORIENTATION_TRACKING -ivas_error ivas_orient_trk_Process( - ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ - IVAS_QUATERNION absRot, /* i : absolute head rotation */ - float updateRate, /* i : rotation update rate [Hz] */ - IVAS_QUATERNION *pTrkRot /* o : tracked rotation */ -) -{ - float normalizedOrientation; - float relativeOrientationRate; - float rateRange; - float cutoffFrequency; - float alpha = pOTR->alpha; - float ang; - ivas_error result; - - if ( pOTR == NULL || pTrkRot == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - result = IVAS_ERR_OK; - - switch ( pOTR->trackingType ) - { - case OTR_TRACKING_NONE: - pOTR->trkRot = absRot; - break; -#ifdef OTR_REFERENCE_VECTOR_TRACKING - case OTR_TRACKING_REF_VEC: - case OTR_TRACKING_REF_VEC_LEV: -#endif /* OTR_REFERENCE_VECTOR_TRACKING */ - case OTR_TRACKING_REF_ORIENT: - /* Reset average orientation */ - pOTR->absAvgRot = absRot; - - /* Reset adaptation filter - start adaptation at center rate */ - pOTR->alpha = sinf( 2.0f * EVS_PI * pOTR->centerAdaptationRate / updateRate ); - - /* Compute relative orientation = (absolute orientation) - (reference orientation) */ - QuaternionInverse( pOTR->refRot, &pOTR->trkRot ); - QuaternionProduct( pOTR->trkRot, absRot, &pOTR->trkRot ); - break; - - case OTR_TRACKING_AVG_ORIENT: - /* Compute average (low-pass filtered) absolute orientation */ - QuaternionSlerp( pOTR->absAvgRot, absRot, alpha, &pOTR->absAvgRot ); - - /* Compute relative orientation = (absolute orientation) - (average absolute orientation) */ - QuaternionInverse( pOTR->absAvgRot, &pOTR->trkRot ); - QuaternionProduct( pOTR->trkRot, absRot, &pOTR->trkRot ); - - /* Adapt LPF constant based on orientation excursion relative to current mean: - - low cutoff (slow adaptation) for small excursions (around center) - - high cutoff (fast adaptation) for large excursions (off-center) - */ - ang = QuaternionAngle( absRot, pOTR->trkRot ); - normalizedOrientation = ang * ang; - - relativeOrientationRate = sqrtf( normalizedOrientation ) / pOTR->adaptationAngle; - /* 'if' assumed to perform comparison to 0 */ - if ( relativeOrientationRate > 1.0f ) - { - relativeOrientationRate = 1.0f; - } - - /* Compute range of the adaptation rate between center = lower rate and off-center = higher rate */ - rateRange = pOTR->offCenterAdaptationRate - pOTR->centerAdaptationRate; - /* 'if' assumed to perform comparison to 0 */ - if ( rateRange < 0.0f ) - { - rateRange = 0.0f; - } - - /* Compute adaptivity cutoff frequency: interpolate between minimum (center) and maximum (off-center) values */ - cutoffFrequency = pOTR->centerAdaptationRate + ( relativeOrientationRate * rateRange ); - - /* Compute filter coefficient corresponding to desired cutoff frequency */ - pOTR->alpha = sinf( 2.0f * EVS_PI * cutoffFrequency / updateRate ); - break; - default: - result = IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Non-supported orientation tracking adaptation type" ); - break; - } - - if ( result == IVAS_ERR_OK ) - { - *pTrkRot = pOTR->trkRot; - } - - return result; -} -#else ivas_error ivas_orient_trk_Process( ivas_orient_trk_state_t *pOTR ) { @@ -919,4 +314,3 @@ void ivas_orient_trk_GetTrackedOrientation( return; } -#endif diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 4c79280a86..9e92e45d57 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -54,7 +54,11 @@ ivas_error getAudioConfigNumChannels( int16_t *numChannels ); +#ifdef FIX_197_CREND_INTERFACE AUDIO_CONFIG getIvasAudioConfigFromRendAudioConfig( +#else +AUDIO_CONFIG rendAudioConfigToIvasAudioConfig( +#endif IVAS_REND_AudioConfig rendConfig ); IVAS_REND_AudioConfig getRendAudioConfigFromIvasAudioConfig( @@ -212,18 +216,28 @@ void ivas_HRTF_CRend_binary_close( *----------------------------------------------------------------------------------*/ ivas_error ivas_td_binaural_renderer_unwrap( - const REVERB_HANDLE hReverb, /* i : Reverberator handle */ - const AUDIO_CONFIG transport_config, /* i : Transport configuration */ +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + REVERB_HANDLE hReverb, /* i : reverb handle */ +#else + RENDER_CONFIG_DATA *hRenderConfig, /* i : Renderer configuration */ + const int16_t ini_frame, /* i : Initialization frame counter */ +#ifdef FIX_197_CREND_INTERFACE + CREND_WRAPPER_HANDLE hCrendWrapper, /* i : Crend wrapper handle */ +#else + CREND_HANDLE hCrend, /* i : Crend handle */ +#endif +#endif + AUDIO_CONFIG transport_config, /* i : Transport configuration */ +#ifndef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + const int32_t output_Fs, /* i : Output sampling rate */ +#endif BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD binaural object renderer handle */ - const int16_t num_src, /* i : number of sources to render */ + const int16_t nchan_transport, /* i : Transport channels (ISms) */ const int16_t lfe_idx, /* i : LFE channel index */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ + IVAS_FORMAT ivas_format, /* i : IVAS format */ ISM_METADATA_HANDLE *hIsmMetaData, /* i : ISM metadata handle */ const int16_t Opt_Headrotation, /* i : Head rotation flag */ const IVAS_QUATERNION *Quaternions, /* i : Head tracking data per subframe */ -#ifdef TD5 - const IVAS_POSITION *Pos, /* i : Listener position data per subframe */ -#endif float output[][L_FRAME48k], /* i/o: SCE channels / Binaural synthesis */ const int16_t output_frame /* i : output frame length */ ); @@ -234,7 +248,9 @@ ivas_error ivas_td_binaural_renderer_ext( const LSSETUP_CUSTOM_STRUCT *customLsInput, /* i : Input custom loudspeaker layout */ const IVAS_REND_HeadRotData *headRotData, /* i : Input head positions */ const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */ - const REVERB_HANDLE hReverb, /* i : Reverberator handle */ +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + const REVERB_HANDLE reverb, /* i : reverb handle */ +#endif const int16_t output_frame, /* i : output frame length */ float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ ); @@ -245,9 +261,6 @@ ivas_error ivas_td_binaural_open_unwrap( const int16_t nchan_transport, /* i : Number of channels */ const IVAS_FORMAT ivas_format, /* i : IVAS format (ISM/MC) */ const AUDIO_CONFIG transport_config, /* i : Transport configuration */ -#ifdef TD5 - const float *directivity, /* i : Directivity pattern (used for ISM) */ -#endif const IVAS_OUTPUT_SETUP hTransSetup, /* i : Loudspeaker layout */ BINAURAL_TD_OBJECT_RENDERER_HANDLE *hBinRendererTd, /* o : TD renderer handle */ int32_t *binaural_latency_ns /* i : Binauralization delay */ @@ -256,9 +269,6 @@ ivas_error ivas_td_binaural_open_unwrap( ivas_error ivas_td_binaural_open_ext( TDREND_WRAPPER *pTDRend, const IVAS_REND_AudioConfig inConfig, -#ifdef TD5 - RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ -#endif LSSETUP_CUSTOM_STRUCT *customLsInput, const int32_t output_Fs ); @@ -270,7 +280,7 @@ void ivas_td_binaural_close( ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ - float output[][L_FRAME48k], /* i/o: ISM object synth / rendered output in 0,1 */ + float output[][L_FRAME48k], /* i/o: ISm object synth / rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ ); @@ -278,17 +288,12 @@ ivas_error TDREND_GetMix( void TDREND_Update_listener_orientation( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD Renderer handle */ const int16_t headRotEnabled, /* i : Headrotation flag */ -#ifdef TD5 - const IVAS_QUATERNION *headPosition, /* i : Listener orientation */ - const IVAS_POSITION *Pos /* i : Listener Position */ -#else const IVAS_QUATERNION *headPosition /* i : Head Position */ -#endif ); void TDREND_Update_object_positions( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o : TD Renderer handle */ - const int16_t num_src, /* i : number of sources to render */ + const int16_t numSources, /* i : Number of sources to render */ const int16_t lfe_idx, /* i : Input LFE index */ const IVAS_FORMAT in_format, /* i : Format of input sources */ const ISM_METADATA_HANDLE *hIsmMetaData, /* i : Input metadata for ISM objects */ @@ -404,12 +409,7 @@ void TDREND_SPATIAL_VecMapToNewCoordSystem( const float *DirVec_p, /* i : Direction vector */ const float *UpVec_p, /* i : Up vector */ const float *RightVec_p, /* i : Right vector */ -#ifdef TD5 - float *MappedVec_p, /* o : Transformed vector */ - float *LisRelPosAbs /* o : Transformed vector ignoring orientation */ -#else float *MappedVec_p /* o : Transformed vector */ -#endif ); /*! r: Flag if the orientation has been updated */ @@ -475,12 +475,7 @@ void TDREND_firfilt( const int16_t intp_count, /* i : interpolation count */ float *mem, /* i/o: filter memory */ const int16_t subframe_length, /* i : Length of signal */ -#ifdef TD5 - const int16_t filterlength, /* i : Filter length */ - const float Gain /* i : Gain */ -#else const int16_t filterlength /* i : Filter length */ -#endif ); @@ -489,35 +484,59 @@ void TDREND_firfilt( *----------------------------------------------------------------------------------*/ ivas_error ivas_rend_openCrend( +#ifdef FIX_197_CREND_INTERFACE CREND_WRAPPER_HANDLE *pCrend, +#else + CREND_WRAPPER *pCrend, +#endif const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, -#ifndef FIX_I109_ORIENTATION_TRACKING +#ifdef FIX_197_CREND_INTERFACE int16_t Opt_Headrotation, #endif HRTFS_CREND_HANDLE hSetOfHRTF, const int32_t output_Fs ); +#ifdef FIX_197_CREND_INTERFACE void ivas_rend_closeCrend( CREND_WRAPPER_HANDLE *pCrend ); +#else +ivas_error ivas_rend_closeCrend( + CREND_WRAPPER *pCrend ); +#endif +#ifdef FIX_329_ENABLE_TD_RENDERER_REVERB_MC ivas_error ivas_rend_initCrendWrapper( CREND_WRAPPER_HANDLE *pCrend ); +#endif ivas_error ivas_rend_crendProcess( const CREND_WRAPPER *pCrend, const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, +#ifdef FIX_197_CREND_INTERFACE DECODER_CONFIG_HANDLE hDecoderConfig, HEAD_TRACK_DATA_HANDLE hHeadTrackData, IVAS_OUTPUT_SETUP_HANDLE hIntSetup, EFAP_HANDLE hEFAPdata, +#endif float output[][L_FRAME48k], /* i/o: input/output audio channels */ const int32_t output_Fs ); +#ifndef FIX_197_CREND_INTERFACE + +ivas_error ivas_crend_init_from_setofhrtf( + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ +); + +ivas_error ivas_crend_init_from_hrtf_handle( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + HRTFS_HANDLE hrtf); + +#endif @@ -581,12 +600,12 @@ void ivas_reverb_close( ); ivas_error ivas_reverb_process( - const REVERB_HANDLE hReverb, /* i : Reverberator handle */ + REVERB_HANDLE hReverb, /* i/o: reverb state */ const AUDIO_CONFIG input_audio_config, /* i : reverb. input audio configuration */ const int16_t mix_signals, /* i : add reverb to output signal */ float pcm_in[][L_FRAME48k], /* i : the PCM audio to apply reverb on */ float pcm_out[][L_FRAME48k], /* o : the PCM audio with reverb applied */ - const int16_t i_ts /* i : subframe index */ + const int16_t i_ts ); void ivas_rev_delay_line_init( @@ -771,29 +790,12 @@ ivas_error ivas_headTrack_open( HEAD_TRACK_DATA_HANDLE *hHeadTrackData /* o : head track handle */ ); -#ifdef FIX_I109_ORIENTATION_TRACKING -void ivas_headTrack_close( - HEAD_TRACK_DATA_HANDLE *hHeadTrackData /* i/o: head track handle */ -); - -void Euler2Quat( - const float yaw, /* i : yaw (x) */ - const float pitch, /* i : pitch (y) */ - const float roll, /* i : roll (z) */ - IVAS_QUATERNION *quat /* o : quaternion describing the rotation */ -); - -float deg2rad( float degrees ); - -#else void Quat2Euler( - const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ - float *yaw, /* o : yaw (z) */ - float *pitch, /* o : pitch (y) */ - float *roll /* o : roll (x) */ + const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ + float *yaw, /* o : yaw */ + float *pitch, /* o : pitch */ + float *roll /* o : roll */ ); -#endif - void QuatToRotMat( const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ @@ -872,57 +874,15 @@ ivas_error ivas_render_config_init_from_rom( * Orientation tracking *----------------------------------------------------------------------------------*/ -#ifdef FIX_I109_ORIENTATION_TRACKING -ivas_error ivas_orient_trk_Init( -#else -void ivas_orient_trk_Init( -#endif - ivas_orient_trk_state_t *pOTR /* i/o: orientation tracker handle */ +void ivas_orient_trk_Init( + ivas_orient_trk_state_t *pOTR ); -#ifdef FIX_I109_ORIENTATION_TRACKING -ivas_error ivas_orient_trk_SetTrackingType( -#else -void ivas_orient_trk_SetTrackingType( -#endif - ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ - const OTR_TRACKING_T trackingType /* i : orientation tracking type */ -); - -#ifdef FIX_I109_ORIENTATION_TRACKING -ivas_error ivas_orient_trk_SetReferenceRotation( - ivas_orient_trk_state_t *pOTR, /* i/o: orientatoin trakcer handle */ - const IVAS_QUATERNION refRot /* i : reference rotation */ -); - -#ifdef OTR_REFERENCE_VECTOR_TRACKING -ivas_error ivas_orient_trk_SetReferenceVector( - ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ - const IVAS_VECTOR3 listenerPos, /* i : Listener position */ - const IVAS_VECTOR3 refPos /* i : Reference position */ -); -#endif /* OTR_REFERENCE_VECTOR_TRACKING */ - -ivas_error ivas_orient_trk_GetMainOrientation( - ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ - IVAS_QUATERNION *pOrientation /* i/o: average/reference orientation */ -); - -ivas_error ivas_orient_trk_GetTrackedRotation( - ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ - IVAS_QUATERNION *pRotation /* i/o: processed rotation */ -); -#endif - -#ifdef FIX_I109_ORIENTATION_TRACKING -ivas_error ivas_orient_trk_Process( - ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ - IVAS_QUATERNION absRot, /* i : absolute head rotation */ - float updateRate, /* i : rotation update rate [Hz] */ - IVAS_QUATERNION *pTrkRot /* o : tracked rotation */ +void ivas_orient_trk_SetTrackingType( + ivas_orient_trk_state_t *pOTR, + const OTR_TRACKING_T trackingType ); -#else void ivas_orient_trk_SetAbsoluteOrientation( ivas_orient_trk_state_t *pOTR, const float yaw, @@ -931,7 +891,7 @@ void ivas_orient_trk_SetAbsoluteOrientation( ); ivas_error ivas_orient_trk_Process( - ivas_orient_trk_state_t *pOTR + ivas_orient_trk_state_t *pOTR ); void ivas_orient_trk_GetTrackedOrientation( @@ -940,7 +900,6 @@ void ivas_orient_trk_GetTrackedOrientation( float *pitch, float *roll ); -#endif /* clang-format on */ #endif /* IVAS_PROT_REND_H */ diff --git a/lib_rend/ivas_render_config.c b/lib_rend/ivas_render_config.c index 2fdbeff0eb..ccee4ffe72 100644 --- a/lib_rend/ivas_render_config.c +++ b/lib_rend/ivas_render_config.c @@ -103,7 +103,6 @@ ivas_error ivas_render_config_init_from_rom( const int16_t room_flag_on /* i : room effect on/off flag */ ) { - if ( hRenderConfig == NULL || *hRenderConfig == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Unexpected null pointer while attempting to fill renderer configuration from ROM" ); @@ -126,11 +125,5 @@ ivas_error ivas_render_config_init_from_rom( mvr2r( ivas_reverb_default_RT60, ( *hRenderConfig )->roomAcoustics.pAcoustic_rt60, IVAS_REVERB_DEFAULT_N_BANDS ); mvr2r( ivas_reverb_default_DSR, ( *hRenderConfig )->roomAcoustics.pAcoustic_dsr, IVAS_REVERB_DEFAULT_N_BANDS ); -#ifdef TD5 - ( *hRenderConfig )->directivity[0] = 360.0f; /* Front cone */ - ( *hRenderConfig )->directivity[1] = 360.0f; /* Back cone */ - ( *hRenderConfig )->directivity[2] = 1.0f; /* Back attenuation */ -#endif - return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index 7dc05cff09..3911c36601 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -675,34 +675,34 @@ static ivas_error calc_jot_t60_coeffs( *-----------------------------------------------------------------------------------------*/ static ivas_error initialize_reverb_filters( - REVERB_HANDLE hReverb ) + REVERB_HANDLE pState ) { ivas_error error; error = IVAS_ERR_OK; /* init correlation and coloration filters */ - if ( ( error = ivas_reverb_t2f_f2t_init( &hReverb->fft_filter_ols, hReverb->fft_size, hReverb->fft_subblock_size ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_t2f_f2t_init( &pState->fft_filter_ols, pState->fft_size, pState->fft_subblock_size ) ) != IVAS_ERR_OK ) { return error; } - if ( ( error = ivas_reverb_fft_filter_init( &hReverb->fft_filter_correl_0, hReverb->fft_size ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_fft_filter_init( &pState->fft_filter_correl_0, pState->fft_size ) ) != IVAS_ERR_OK ) { return error; } - if ( ( error = ivas_reverb_fft_filter_init( &hReverb->fft_filter_correl_1, hReverb->fft_size ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_fft_filter_init( &pState->fft_filter_correl_1, pState->fft_size ) ) != IVAS_ERR_OK ) { return error; } - if ( ( error = ivas_reverb_fft_filter_init( &hReverb->fft_filter_color_0, hReverb->fft_size ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_fft_filter_init( &pState->fft_filter_color_0, pState->fft_size ) ) != IVAS_ERR_OK ) { return error; } - if ( ( error = ivas_reverb_fft_filter_init( &hReverb->fft_filter_color_1, hReverb->fft_size ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_fft_filter_init( &pState->fft_filter_color_1, pState->fft_size ) ) != IVAS_ERR_OK ) { return error; } @@ -718,13 +718,13 @@ static ivas_error initialize_reverb_filters( *-----------------------------------------------------------------------------------------*/ static ivas_error set_t60_filter( - REVERB_HANDLE hReverb, + REVERB_HANDLE pState, const uint16_t branch, const uint16_t nr_taps, const float coefA[], const float coefB[] ) { - if ( branch >= hReverb->nr_of_branches ) + if ( branch >= pState->nr_of_branches ) { return IVAS_ERR_INTERNAL; } @@ -734,7 +734,7 @@ static ivas_error set_t60_filter( return IVAS_ERR_INTERNAL; } - ivas_reverb_iir_filt_set( &( hReverb->t60[branch] ), nr_taps, coefA, coefB ); + ivas_reverb_iir_filt_set( &( pState->t60[branch] ), nr_taps, coefA, coefB ); return IVAS_ERR_OK; } @@ -747,16 +747,16 @@ static ivas_error set_t60_filter( *-----------------------------------------------------------------------------------------*/ static ivas_error set_feedback_delay( - REVERB_HANDLE hReverb, + REVERB_HANDLE pState, const uint16_t branch, const int16_t fb_delay ) { - if ( branch >= hReverb->nr_of_branches ) + if ( branch >= pState->nr_of_branches ) { return IVAS_ERR_INTERNAL; } - hReverb->delay_line[branch].Delay = fb_delay; + pState->delay_line[branch].Delay = fb_delay; return IVAS_ERR_OK; } @@ -769,19 +769,19 @@ static ivas_error set_feedback_delay( *-----------------------------------------------------------------------------------------*/ static ivas_error set_feedback_gain( - REVERB_HANDLE hReverb, + REVERB_HANDLE pState, const uint16_t branch, const float *pGain ) { uint16_t gain_idx; - if ( branch >= hReverb->nr_of_branches ) + if ( branch >= pState->nr_of_branches ) { return IVAS_ERR_INTERNAL; } - for ( gain_idx = 0; gain_idx < hReverb->nr_of_branches; gain_idx++ ) + for ( gain_idx = 0; gain_idx < pState->nr_of_branches; gain_idx++ ) { - hReverb->gain_matrix[branch][gain_idx] = pGain[gain_idx]; + pState->gain_matrix[branch][gain_idx] = pGain[gain_idx]; } return IVAS_ERR_OK; @@ -795,7 +795,7 @@ static ivas_error set_feedback_gain( *-----------------------------------------------------------------------------------------*/ static ivas_error set_correl_fft_filter( - REVERB_HANDLE hReverb, + REVERB_HANDLE pState, const uint16_t channel, rv_fftwf_type_complex *pSpectrum ) { @@ -806,11 +806,11 @@ static ivas_error set_correl_fft_filter( if ( channel == 0 ) { - ivas_reverb_fft_filter_ConvertFFTWF_2_FFTR( pSpectrum, hReverb->fft_filter_correl_0.fft_spectrum, hReverb->fft_filter_correl_0.fft_size ); + ivas_reverb_fft_filter_ConvertFFTWF_2_FFTR( pSpectrum, pState->fft_filter_correl_0.fft_spectrum, pState->fft_filter_correl_0.fft_size ); } else { - ivas_reverb_fft_filter_ConvertFFTWF_2_FFTR( pSpectrum, hReverb->fft_filter_correl_1.fft_spectrum, hReverb->fft_filter_correl_1.fft_size ); + ivas_reverb_fft_filter_ConvertFFTWF_2_FFTR( pSpectrum, pState->fft_filter_correl_1.fft_spectrum, pState->fft_filter_correl_1.fft_size ); } return IVAS_ERR_OK; @@ -824,7 +824,7 @@ static ivas_error set_correl_fft_filter( *-----------------------------------------------------------------------------------------*/ static ivas_error set_color_fft_filter( - REVERB_HANDLE hReverb, + REVERB_HANDLE pState, const uint16_t channel, rv_fftwf_type_complex *pSpectrum ) { @@ -835,11 +835,11 @@ static ivas_error set_color_fft_filter( if ( channel == 0 ) { - ivas_reverb_fft_filter_ConvertFFTWF_2_FFTR( pSpectrum, hReverb->fft_filter_color_0.fft_spectrum, hReverb->fft_filter_color_0.fft_size ); + ivas_reverb_fft_filter_ConvertFFTWF_2_FFTR( pSpectrum, pState->fft_filter_color_0.fft_spectrum, pState->fft_filter_color_0.fft_size ); } else { - ivas_reverb_fft_filter_ConvertFFTWF_2_FFTR( pSpectrum, hReverb->fft_filter_color_1.fft_spectrum, hReverb->fft_filter_color_1.fft_size ); + ivas_reverb_fft_filter_ConvertFFTWF_2_FFTR( pSpectrum, pState->fft_filter_color_1.fft_spectrum, pState->fft_filter_color_1.fft_size ); } return IVAS_ERR_OK; @@ -853,7 +853,7 @@ static ivas_error set_color_fft_filter( *-----------------------------------------------------------------------------------------*/ static ivas_error set_mixer_level( - REVERB_HANDLE hReverb, + REVERB_HANDLE pState, const uint16_t channel, const float level[] ) { @@ -863,9 +863,9 @@ static ivas_error set_mixer_level( return IVAS_ERR_INTERNAL; } - for ( branch_idx = 0; branch_idx < hReverb->nr_of_branches; branch_idx++ ) + for ( branch_idx = 0; branch_idx < pState->nr_of_branches; branch_idx++ ) { - hReverb->mixer[channel][branch_idx] = level[branch_idx]; + pState->mixer[channel][branch_idx] = level[branch_idx]; } return IVAS_ERR_OK; @@ -879,7 +879,7 @@ static ivas_error set_mixer_level( *-----------------------------------------------------------------------------------------*/ static void clear_buffers( - REVERB_HANDLE hReverb ) + REVERB_HANDLE pState ) { int16_t branch_idx; ivas_rev_iir_filter_t *iirFilter; @@ -887,15 +887,15 @@ static void clear_buffers( for ( branch_idx = 0; branch_idx < IVAS_REV_MAX_NR_BRANCHES; branch_idx++ ) { - delay_line = &( hReverb->delay_line[branch_idx] ); + delay_line = &( pState->delay_line[branch_idx] ); set_f( delay_line->pBuffer, 0, delay_line->MaxDelay ); delay_line->BufferPos = 0; - iirFilter = &( hReverb->t60[branch_idx] ); + iirFilter = &( pState->t60[branch_idx] ); set_f( iirFilter->pBuffer, 0, iirFilter->MaxTaps ); } - ivas_reverb_t2f_f2t_ClearHistory( &hReverb->fft_filter_ols ); + ivas_reverb_t2f_f2t_ClearHistory( &pState->fft_filter_ols ); return; } @@ -908,31 +908,31 @@ static void clear_buffers( *-----------------------------------------------------------------------------------------*/ static void set_fft_and_datablock_sizes( - REVERB_HANDLE hReverb, + REVERB_HANDLE pState, const int16_t subframe_len ) { - hReverb->full_block_size = subframe_len; + pState->full_block_size = subframe_len; if ( subframe_len == L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES ) { - hReverb->fft_size = IVAS_REVERB_FFT_SIZE_48K; - hReverb->num_fft_subblocks = IVAS_REVERB_FFT_N_SUBBLOCKS_48K; + pState->fft_size = IVAS_REVERB_FFT_SIZE_48K; + pState->num_fft_subblocks = IVAS_REVERB_FFT_N_SUBBLOCKS_48K; } else if ( subframe_len == L_FRAME32k / MAX_PARAM_SPATIAL_SUBFRAMES ) { - hReverb->fft_size = IVAS_REVERB_FFT_SIZE_32K; - hReverb->num_fft_subblocks = IVAS_REVERB_FFT_N_SUBBLOCKS_32K; + pState->fft_size = IVAS_REVERB_FFT_SIZE_32K; + pState->num_fft_subblocks = IVAS_REVERB_FFT_N_SUBBLOCKS_32K; } else if ( subframe_len == L_FRAME16k / MAX_PARAM_SPATIAL_SUBFRAMES ) { - hReverb->fft_size = IVAS_REVERB_FFT_SIZE_16K; - hReverb->num_fft_subblocks = IVAS_REVERB_FFT_N_SUBBLOCKS_16K; + pState->fft_size = IVAS_REVERB_FFT_SIZE_16K; + pState->num_fft_subblocks = IVAS_REVERB_FFT_N_SUBBLOCKS_16K; } else { assert( 0 ); /* unsupported block size */ } - hReverb->fft_subblock_size = subframe_len / hReverb->num_fft_subblocks; + pState->fft_subblock_size = subframe_len / pState->num_fft_subblocks; return; } @@ -1030,7 +1030,7 @@ static void set_reverb_acoustic_data( *-----------------------------------------------------------------------------------------*/ static ivas_error setup_FDN_branches( - REVERB_HANDLE hReverb, + REVERB_HANDLE pState, ivas_reverb_params_t *pParams ) { int16_t nr_coefs, branch_idx, channel_idx; @@ -1041,12 +1041,12 @@ static ivas_error setup_FDN_branches( /* initialize feedback branches */ for ( branch_idx = 0; branch_idx < IVAS_REV_MAX_NR_BRANCHES; branch_idx++ ) { - ivas_rev_delay_line_init( &( hReverb->delay_line[branch_idx] ), hReverb->loop_delay_buffer[branch_idx], init_loop_delay[branch_idx], pParams->pLoop_delays[branch_idx] ); - ivas_reverb_iir_filt_init( &( hReverb->t60[branch_idx] ), IVAS_REV_MAX_IIR_FILTER_LENGTH ); - hReverb->mixer[0][branch_idx] = 0.0f; - hReverb->mixer[1][branch_idx] = 0.0f; + ivas_rev_delay_line_init( &( pState->delay_line[branch_idx] ), pState->loop_delay_buffer[branch_idx], init_loop_delay[branch_idx], pParams->pLoop_delays[branch_idx] ); + ivas_reverb_iir_filt_init( &( pState->t60[branch_idx] ), IVAS_REV_MAX_IIR_FILTER_LENGTH ); + pState->mixer[0][branch_idx] = 0.0f; + pState->mixer[1][branch_idx] = 0.0f; } - clear_buffers( hReverb ); + clear_buffers( pState ); nr_coefs = pParams->t60_filter_order + 1; if ( IVAS_REV_MAX_IIR_FILTER_LENGTH < nr_coefs ) @@ -1060,17 +1060,17 @@ static ivas_error setup_FDN_branches( pCoef_a = &pParams->pT60_filter_coeff[2 * nr_coefs * branch_idx + nr_coefs]; pCoef_b = &pParams->pT60_filter_coeff[2 * nr_coefs * branch_idx]; - if ( ( error = set_t60_filter( hReverb, branch_idx, nr_coefs, pCoef_a, pCoef_b ) ) != IVAS_ERR_OK ) + if ( ( error = set_t60_filter( pState, branch_idx, nr_coefs, pCoef_a, pCoef_b ) ) != IVAS_ERR_OK ) { return error; } - if ( ( error = set_feedback_delay( hReverb, branch_idx, pParams->pLoop_delays[branch_idx] ) ) != IVAS_ERR_OK ) + if ( ( error = set_feedback_delay( pState, branch_idx, pParams->pLoop_delays[branch_idx] ) ) != IVAS_ERR_OK ) { return error; } - if ( ( error = set_feedback_gain( hReverb, branch_idx, &( pParams->pLoop_feedback_matrix[branch_idx * pParams->nr_loops] ) ) ) != IVAS_ERR_OK ) + if ( ( error = set_feedback_gain( pState, branch_idx, &( pParams->pLoop_feedback_matrix[branch_idx * pParams->nr_loops] ) ) ) != IVAS_ERR_OK ) { return error; } @@ -1079,7 +1079,7 @@ static ivas_error setup_FDN_branches( for ( channel_idx = 0; channel_idx < pParams->nr_outputs; channel_idx++ ) { - if ( ( error = set_mixer_level( hReverb, channel_idx, &( pParams->pLoop_extract_matrix[channel_idx * pParams->nr_loops] ) ) ) != IVAS_ERR_OK ) + if ( ( error = set_mixer_level( pState, channel_idx, &( pParams->pLoop_extract_matrix[channel_idx * pParams->nr_loops] ) ) ) != IVAS_ERR_OK ) { return error; } @@ -1175,6 +1175,7 @@ ivas_error ivas_reverb_open( /* set up reverb acoustic data on the basis of HRTF data and renderer config */ set_reverb_acoustic_data( ¶ms, input_audio_config, hHrtf, &hRenderConfig->roomAcoustics, subframe_len, nr_fc_input, nr_fc_fft_filter ); +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND /* set reverb acoustic configuration based on renderer config */ #ifdef DEBUGGING pState->pConfig.renderer_type_override = hRenderConfig->renderer_type_override; @@ -1183,6 +1184,7 @@ ivas_error ivas_reverb_open( pState->pConfig.roomAcoustics.use_brir = hRenderConfig->roomAcoustics.use_brir; pState->pConfig.roomAcoustics.late_reverb_on = hRenderConfig->roomAcoustics.late_reverb_on; pState->pConfig.roomAcoustics.nBands = hRenderConfig->roomAcoustics.nBands; +#endif /* set up input downmix */ pState->dmx_gain = calc_dmx_gain(); @@ -1310,27 +1312,27 @@ void ivas_reverb_close( *-----------------------------------------------------------------------------------------*/ static void post_fft_filter( - REVERB_HANDLE hReverb, + REVERB_HANDLE pState, float *p0, float *p1, float *pBuffer_0, float *pBuffer_1 ) { - if ( hReverb->do_corr_filter ) + if ( pState->do_corr_filter ) { - ivas_reverb_t2f_f2t_in( &hReverb->fft_filter_ols, p0, p1, pBuffer_0, pBuffer_1 ); - ivas_reverb_fft_filter_ComplexMul( &hReverb->fft_filter_correl_0, pBuffer_0 ); - ivas_reverb_fft_filter_ComplexMul( &hReverb->fft_filter_correl_1, pBuffer_1 ); - ivas_reverb_fft_filter_CrossMix( pBuffer_0, pBuffer_1, hReverb->fft_filter_correl_0.fft_size ); + ivas_reverb_t2f_f2t_in( &pState->fft_filter_ols, p0, p1, pBuffer_0, pBuffer_1 ); + ivas_reverb_fft_filter_ComplexMul( &pState->fft_filter_correl_0, pBuffer_0 ); + ivas_reverb_fft_filter_ComplexMul( &pState->fft_filter_correl_1, pBuffer_1 ); + ivas_reverb_fft_filter_CrossMix( pBuffer_0, pBuffer_1, pState->fft_filter_correl_0.fft_size ); } else { - ivas_reverb_t2f_f2t_in( &hReverb->fft_filter_ols, p0, p1, pBuffer_0, pBuffer_1 ); + ivas_reverb_t2f_f2t_in( &pState->fft_filter_ols, p0, p1, pBuffer_0, pBuffer_1 ); } - ivas_reverb_fft_filter_ComplexMul( &hReverb->fft_filter_color_0, pBuffer_0 ); - ivas_reverb_fft_filter_ComplexMul( &hReverb->fft_filter_color_1, pBuffer_1 ); - ivas_reverb_t2f_f2t_out( &hReverb->fft_filter_ols, pBuffer_0, pBuffer_1, p0, p1 ); + ivas_reverb_fft_filter_ComplexMul( &pState->fft_filter_color_0, pBuffer_0 ); + ivas_reverb_fft_filter_ComplexMul( &pState->fft_filter_color_1, pBuffer_1 ); + ivas_reverb_t2f_f2t_out( &pState->fft_filter_ols, pBuffer_0, pBuffer_1, p0, p1 ); return; } @@ -1343,14 +1345,14 @@ static void post_fft_filter( *-----------------------------------------------------------------------------------------*/ static void reverb_block( - REVERB_HANDLE hReverb, + REVERB_HANDLE pState, float *pInput, float *pOut0, float *pOut1 ) { - uint16_t nr_branches = hReverb->nr_of_branches; - uint16_t bsize = hReverb->full_block_size; + uint16_t nr_branches = pState->nr_of_branches; + uint16_t bsize = pState->full_block_size; uint16_t inner_bsize = INNER_BLK_SIZE; uint16_t i, j, k, ns, branch_idx, blk_idx, start_sample_idx; @@ -1382,12 +1384,12 @@ static void reverb_block( for ( i = 0; i < nr_branches; i++ ) { float *pOutput_i = &ppOutput[i][0]; - float mixer_0_i = hReverb->mixer[0][i]; - float mixer_1_i = hReverb->mixer[1][i]; + float mixer_0_i = pState->mixer[0][i]; + float mixer_1_i = pState->mixer[1][i]; /* output and feedback are same, get sample from delay line ... */ - ivas_rev_delay_line_get_sample_blk( &( hReverb->delay_line[i] ), inner_bsize, pTemp ); - ivas_reverb_iir_filt_2taps_feed_blk( &( hReverb->t60[i] ), inner_bsize, pTemp, ppOutput[i] ); + ivas_rev_delay_line_get_sample_blk( &( pState->delay_line[i] ), inner_bsize, pTemp ); + ivas_reverb_iir_filt_2taps_feed_blk( &( pState->t60[i] ), inner_bsize, pTemp, ppOutput[i] ); for ( ns = 0; ns < inner_bsize; ns++ ) { pO0[ns] += pOutput_i[ns] * mixer_0_i; /* mixer ch 0 */ @@ -1406,7 +1408,7 @@ static void reverb_block( for ( j = 0; j < nr_branches; j++ ) { - float gain_matrix_j_i = hReverb->gain_matrix[j][i]; + float gain_matrix_j_i = pState->gain_matrix[j][i]; float *pOutput = &ppOutput[j][0]; for ( ns = 0; ns < inner_bsize; ns++ ) { @@ -1414,15 +1416,15 @@ static void reverb_block( } } - ivas_rev_delay_line_feed_sample_blk( &( hReverb->delay_line[i] ), inner_bsize, pFeedback_input ); + ivas_rev_delay_line_feed_sample_blk( &( pState->delay_line[i] ), inner_bsize, pFeedback_input ); } } /* Applying FFT filter to each sub-frame */ - for ( blk_idx = 0; blk_idx < hReverb->num_fft_subblocks; blk_idx++ ) + for ( blk_idx = 0; blk_idx < pState->num_fft_subblocks; blk_idx++ ) { - start_sample_idx = blk_idx * hReverb->fft_subblock_size; - post_fft_filter( hReverb, pOut0 + start_sample_idx, pOut1 + start_sample_idx, pFFT_buf[0], pFFT_buf[1] ); + start_sample_idx = blk_idx * pState->fft_subblock_size; + post_fft_filter( pState, pOut0 + start_sample_idx, pOut1 + start_sample_idx, pFFT_buf[0], pFFT_buf[1] ); } return; @@ -1436,14 +1438,14 @@ static void reverb_block( *-----------------------------------------------------------------------------------------*/ static ivas_error downmix_input_block( - const REVERB_HANDLE hReverb, + REVERB_HANDLE pState, float pcm_in[][L_FRAME48k], const AUDIO_CONFIG input_audio_config, float *pPcm_out, const int16_t input_offset ) { int16_t i, s, nchan_transport; - float dmx_gain = hReverb->dmx_gain; + float dmx_gain = pState->dmx_gain; switch ( input_audio_config ) { @@ -1459,7 +1461,7 @@ static ivas_error downmix_input_block( case AUDIO_CONFIG_ISM4: { nchan_transport = audioCfg2channels( input_audio_config ); - for ( s = 0; s < hReverb->full_block_size; s++ ) + for ( s = 0; s < pState->full_block_size; s++ ) { float temp = pcm_in[0][input_offset + s]; for ( i = 1; i < nchan_transport; i++ ) @@ -1475,7 +1477,7 @@ static ivas_error downmix_input_block( case AUDIO_CONFIG_HOA2: case AUDIO_CONFIG_HOA3: { - for ( s = 0; s < hReverb->full_block_size; s++ ) + for ( s = 0; s < pState->full_block_size; s++ ) { pPcm_out[s] = dmx_gain * pcm_in[0][input_offset + s]; } @@ -1497,35 +1499,35 @@ static ivas_error downmix_input_block( *-----------------------------------------------------------------------------------------*/ static void predelay_block( - const REVERB_HANDLE hReverb, + REVERB_HANDLE pState, float *pInput, float *pOutput ) { uint16_t i, idx, n_samples, blk_size; - uint16_t max_blk_size = (uint16_t) hReverb->predelay_line.Delay; + uint16_t max_blk_size = (uint16_t) pState->predelay_line.Delay; if ( max_blk_size < 2 ) { if ( max_blk_size == 0 ) /* zero-length delay line: just copy the data from input to output */ { - for ( i = 0; i < hReverb->full_block_size; i++ ) + for ( i = 0; i < pState->full_block_size; i++ ) { pOutput[i] = pInput[i]; } } else /* 1-sample length delay line: feed the data sample-by-sample */ { - for ( i = 0; i < hReverb->full_block_size; i++ ) + for ( i = 0; i < pState->full_block_size; i++ ) { - pOutput[i] = ivas_rev_delay_line_get_sample( &( hReverb->predelay_line ) ); - ivas_rev_delay_line_feed_sample( &( hReverb->predelay_line ), pInput[i] ); + pOutput[i] = ivas_rev_delay_line_get_sample( &( pState->predelay_line ) ); + ivas_rev_delay_line_feed_sample( &( pState->predelay_line ), pInput[i] ); } } } else /* multiple-sample length delay line: use block processing */ { idx = 0; - n_samples = hReverb->full_block_size; + n_samples = pState->full_block_size; while ( n_samples > 0 ) { blk_size = n_samples; @@ -1533,8 +1535,8 @@ static void predelay_block( { blk_size = max_blk_size; } - ivas_rev_delay_line_get_sample_blk( &( hReverb->predelay_line ), blk_size, &pOutput[idx] ); - ivas_rev_delay_line_feed_sample_blk( &( hReverb->predelay_line ), blk_size, &pInput[idx] ); + ivas_rev_delay_line_get_sample_blk( &( pState->predelay_line ), blk_size, &pOutput[idx] ); + ivas_rev_delay_line_feed_sample_blk( &( pState->predelay_line ), blk_size, &pInput[idx] ); idx += blk_size; n_samples -= blk_size; } @@ -1551,7 +1553,7 @@ static void predelay_block( *-----------------------------------------------------------------------------------------*/ static void mix_output_block( - const REVERB_HANDLE hReverb, + REVERB_HANDLE pState, const float *pInL, const float *pInR, float *pOutL, @@ -1559,7 +1561,7 @@ static void mix_output_block( { uint16_t i; - for ( i = 0; i < hReverb->full_block_size; i++ ) + for ( i = 0; i < pState->full_block_size; i++ ) { pOutL[i] += pInL[i]; pOutR[i] += pInR[i]; @@ -1576,13 +1578,12 @@ static void mix_output_block( *-----------------------------------------------------------------------------------------*/ ivas_error ivas_reverb_process( - const REVERB_HANDLE hReverb, /* i : Reverberator handle */ + REVERB_HANDLE hReverb, /* i/o: reverb state */ const AUDIO_CONFIG input_audio_config, /* i : reverb. input audio configuration */ const int16_t mix_signals, /* i : add reverb to output signal */ float pcm_in[][L_FRAME48k], /* i : the PCM audio to apply reverb on */ float pcm_out[][L_FRAME48k], /* o : the PCM audio with reverb applied */ - const int16_t i_ts /* i : subframe index */ -) + const int16_t i_ts ) { float tmp0[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES], tmp1[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES], tmp2[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; ivas_error error; diff --git a/lib_rend/ivas_rom_TdBinauralRenderer.c b/lib_rend/ivas_rom_TdBinauralRenderer.c index 4b56fb4883..70daa6dff9 100644 --- a/lib_rend/ivas_rom_TdBinauralRenderer.c +++ b/lib_rend/ivas_rom_TdBinauralRenderer.c @@ -41,7 +41,6 @@ #include "ivas_cnst.h" #include "wmc_auto.h" -#define WMC_TOOL_SKIP /*------------------------------------------------------------------------- * TD Binaural rendering related ROM tables @@ -12457,6 +12456,4 @@ const uint32_t orange53_rom_ITD_elevBsShape[28] = { 0x3ebda12f,0x3f12f685,0x3f2aaaab, }; -#undef WMC_TOOL_SKIP - /* clang-format on */ diff --git a/lib_rend/ivas_rom_binauralRenderer.c b/lib_rend/ivas_rom_binauralRenderer.c index 9708bac83a..763777ad28 100644 --- a/lib_rend/ivas_rom_binauralRenderer.c +++ b/lib_rend/ivas_rom_binauralRenderer.c @@ -41,8 +41,6 @@ /* clang-format off */ -#define WMC_TOOL_SKIP - /*------------------------------------------------------------------------- * Binaural rendering related ROM tables *------------------------------------------------------------------------*/ @@ -44079,6 +44077,4 @@ const float parametricEarlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX] = 0.016350f, 0.042709f, 0.077337f, 0.066238f, 0.042046f, 0.020017f, 0.007896f, 0.002947f, 0.000932f, 0.000152f }; -#undef WMC_TOOL_SKIP - /* clang-format on */ diff --git a/lib_rend/ivas_rom_binaural_crend_head.c b/lib_rend/ivas_rom_binaural_crend_head.c index 56a9a9ef53..a57d780378 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.c +++ b/lib_rend/ivas_rom_binaural_crend_head.c @@ -47,7 +47,6 @@ #include "cnst.h" #include "ivas_cnst.h" -#define WMC_TOOL_SKIP /********************** CRendBin_Combined_HRIR **********************/ #ifdef FIX_BINAURAL_DELAY_PRECISION @@ -6924,4 +6923,3 @@ const float CRendBin_Combined_BRIR_coeff_diffuse_im_16kHz[BINAURAL_CHANNELS][252 0.050578f, 0.012222f, 0.020049f, -0.020057f, -0.032135f, -0.002553f, -0.037541f, -0.023567f, -0.008392f, -0.012215f, 0.001644f, -0.001142f, 0.000540f, 0.001404f, -0.027979f, -0.022362f, -0.012091f, -0.022963f, 0.009075f, 0.010977f, -0.007069f, -0.000183f, -0.022228f, -0.001348f, 0.006548f, -0.003034f} }; -#undef WMC_TOOL_SKIP diff --git a/lib_rend/ivas_rom_rend.c b/lib_rend/ivas_rom_rend.c index dd8ca99d80..0dfdaf0d28 100644 --- a/lib_rend/ivas_rom_rend.c +++ b/lib_rend/ivas_rom_rend.c @@ -104,7 +104,7 @@ const float diffuseFieldCoherenceDifferenceZ[BINAURAL_COHERENCE_DIFFERENCE_BINS] /*----------------------------------------------------------------------------------* - * TD ISM binaural renderer ROM tables + * TD ISm binaural renderer ROM tables *----------------------------------------------------------------------------------*/ const int16_t HRTF_MODEL_N_CPTS_VAR[HRTF_MODEL_N_SECTIONS] = diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 2a45c6d61a..2622d02308 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -30,7 +30,6 @@ *******************************************************************************************************/ -#include "ivas_cnst.h" #include #include #include "options.h" @@ -44,83 +43,6 @@ #include "wmc_auto.h" -/*-----------------------------------------------------------------------* - * ivas_headTrack_open() - * - * Allocate and initialize Head-Tracking handle - *-----------------------------------------------------------------------*/ - -ivas_error ivas_headTrack_open( - HEAD_TRACK_DATA_HANDLE *hHeadTrackData /* o : head track handle */ -) -{ - int16_t i; - ivas_error error; - - /* Allocate Head-Tracking handle */ - if ( ( *hHeadTrackData = (HEAD_TRACK_DATA_HANDLE) malloc( sizeof( HEAD_TRACK_DATA ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for head-tracking memory\n" ) ); - } - - /* Initialization */ - ( *hHeadTrackData )->num_quaternions = 0; - ( *hHeadTrackData )->lrSwitchInterpVal = 0.0f; - ( *hHeadTrackData )->lrSwitchedCurrent = 0; - ( *hHeadTrackData )->lrSwitchedNext = 0; -#ifdef FIX_I109_ORIENTATION_TRACKING - if ( ( ( *hHeadTrackData )->OrientationTracker = (ivas_orient_trk_state_t *) malloc( sizeof( ivas_orient_trk_state_t ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Orientation tracking" ); - } - - if ( ( error = ivas_orient_trk_Init( ( *hHeadTrackData )->OrientationTracker ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif - - /* Initialise Rmat_prev to I, Rmat will be computed later */ - for ( i = 0; i < 3; i++ ) - { - set_zero( ( *hHeadTrackData )->Rmat_prev[i], 3 ); - ( *hHeadTrackData )->Rmat_prev[i][i] = 1.0f; - } - - return IVAS_ERR_OK; -} - - -#ifdef FIX_I109_ORIENTATION_TRACKING -/*-----------------------------------------------------------------------* - * ivas_headTrack_close() - * - * Deallocate Head-Tracking handle - *-----------------------------------------------------------------------*/ - -void ivas_headTrack_close( - HEAD_TRACK_DATA_HANDLE *hHeadTrackData /* i/o: head track handle */ -) -{ - if ( hHeadTrackData == NULL || *hHeadTrackData == NULL ) - { - return; - } - - if ( ( *hHeadTrackData )->OrientationTracker != NULL ) - { - free( ( *hHeadTrackData )->OrientationTracker ); - ( *hHeadTrackData )->OrientationTracker = NULL; - } - - free( ( *hHeadTrackData ) ); - *hHeadTrackData = NULL; - - return; -} -#endif - - /*---------------------------------------------------------------------------------- * QuatToRotMat() * @@ -132,21 +54,7 @@ void QuatToRotMat( float Rmat[3][3] /* o : real-space rotation matrix for this rotation */ ) { -#ifdef FIX_I109_ORIENTATION_TRACKING - Rmat[0][0] = quat.w * quat.w + quat.x * quat.x - quat.y * quat.y - quat.z * quat.z; - Rmat[0][1] = 2.0f * ( quat.x * quat.y - quat.w * quat.z ); - Rmat[0][2] = 2.0f * ( quat.x * quat.z + quat.w * quat.y ); - - Rmat[1][0] = 2.0f * ( quat.x * quat.y + quat.w * quat.z ); - Rmat[1][1] = quat.w * quat.w - quat.x * quat.x + quat.y * quat.y - quat.z * quat.z; - Rmat[1][2] = 2.0f * ( quat.y * quat.z - quat.w * quat.x ); - - Rmat[2][0] = 2.0f * ( quat.x * quat.z - quat.w * quat.y ); - Rmat[2][1] = 2.0f * ( quat.y * quat.z + quat.w * quat.x ); - Rmat[2][2] = quat.w * quat.w - quat.x * quat.x - quat.y * quat.y + quat.z * quat.z; -#else float s1, s2, s3, c1, c2, c3; - #ifdef DEBUGGING /* PrintQuat( quat ); */ #endif @@ -155,11 +63,7 @@ void QuatToRotMat( * Euler angles instead of quaternions. In this case, all the w values must * be set to -3.0 in the trajectory file to signal switching to Euler angles. * The x,y, and z components of the quaternion are then interpreted as -#ifdef FIX_I109_ORIENTATION_TRACKING * yaw-pitch-roll. -#else // see below: "Euler angles in R_X(roll)*R_Y(pitch)*R_Z(yaw) convention" - * roll-pitch-yaw. -#endif */ if ( quat.w != -3.0 ) { @@ -204,23 +108,21 @@ void QuatToRotMat( Rmat[2][1] = c3 * s1 + c1 * s2 * s3; Rmat[2][2] = c1 * c2; } -#endif return; } -#ifndef FIX_I109_ORIENTATION_TRACKING /*------------------------------------------------------------------------- * Quat2Euler() * - * Quaternion handling: calculate corresponding Euler angles in radians + * Quaternion handling: calculate corresponding Euler angles *------------------------------------------------------------------------*/ void Quat2Euler( const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ - float *yaw, /* o : yaw (z) */ - float *pitch, /* o : pitch (y) */ - float *roll /* o : roll (x) */ + float *yaw, /* o : yaw */ + float *pitch, /* o : pitch */ + float *roll /* o : roll */ ) { if ( quat.w != -3.0 ) @@ -244,57 +146,7 @@ void Quat2Euler( return; } -#endif - -#ifdef FIX_I109_ORIENTATION_TRACKING -/*------------------------------------------------------------------------- - * Euler2Quat() - * - * Calculate corresponding Quaternion from Euler angles in radians - *------------------------------------------------------------------------*/ -void Euler2Quat( - const float yaw, /* i : yaw (x) */ - const float pitch, /* i : pitch (y) */ - const float roll, /* i : roll (z) */ - IVAS_QUATERNION *quat /* o : quaternion describing the rotation */ -) -{ - float cr = cosf( roll * 0.5f ); - float sr = sinf( roll * 0.5f ); - float cp = cosf( pitch * 0.5f ); - float sp = sinf( -pitch * 0.5f ); - float cy = cosf( yaw * 0.5f ); - float sy = sinf( yaw * 0.5f ); - - quat->w = cr * cp * cy - sr * sp * sy; - quat->x = sr * cp * cy + cr * sp * sy; - quat->y = cr * sp * cy - sr * cp * sy; - quat->z = cr * cp * sy + sr * sp * cy; - - return; -} - -/*------------------------------------------------------------------------- - * deg2rad() - * - * Converts degrees to normalized radians - *------------------------------------------------------------------------*/ -float deg2rad( - float degrees ) -{ - while ( degrees >= 180.0f ) - { - degrees = degrees - 360.0f; - } - while ( degrees <= -180.0f ) - { - degrees = degrees + 360.0f; - } - - return PI_OVER_180 * degrees; -} -#endif /*------------------------------------------------------------------------- * rotateAziEle() diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 13c6084b2d..586a43c4f8 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -221,25 +221,39 @@ typedef struct EFAP } EFAP, *EFAP_HANDLE; + /*----------------------------------------------------------------------------------* - * Orientation tracking structure + * Head rotation data structure *----------------------------------------------------------------------------------*/ -#ifdef FIX_I109_ORIENTATION_TRACKING -typedef struct ivas_orient_trk_state_t +typedef struct { - OTR_TRACKING_T trackingType; - float centerAdaptationRate; - float offCenterAdaptationRate; - float adaptationAngle; + int8_t headRotEnabled; + IVAS_QUATERNION headPositions[RENDERER_HEAD_POSITIONS_PER_FRAME]; + float crossfade[L_FRAME48k / RENDERER_HEAD_POSITIONS_PER_FRAME]; - float alpha; - IVAS_QUATERNION absAvgRot; /* average absolute orientation */ - IVAS_QUATERNION refRot; /* reference orientation */ - IVAS_QUATERNION trkRot; /* tracked rotation */ +} IVAS_REND_HeadRotData; + +typedef struct ivas_binaural_head_track_struct +{ + int16_t num_quaternions; + IVAS_QUATERNION Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES]; + float Rmat[3][3]; + float Rmat_prev[3][3]; + + uint8_t lrSwitchedNext; + uint8_t lrSwitchedCurrent; + float lrSwitchInterpVal; + + int16_t shd_rot_max_order; + +} HEAD_TRACK_DATA, *HEAD_TRACK_DATA_HANDLE; + + +/*----------------------------------------------------------------------------------* + * Orientation tracking structure + *----------------------------------------------------------------------------------*/ -} ivas_orient_trk_state_t; -#else typedef struct ivas_orient_trk_state_t { OTR_TRACKING_T trackingType; @@ -266,52 +280,11 @@ typedef struct ivas_orient_trk_state_t float trkRoll; } ivas_orient_trk_state_t; -#endif - -/*----------------------------------------------------------------------------------* - * Head rotation data structure - *----------------------------------------------------------------------------------*/ - -typedef struct -{ - int8_t headRotEnabled; - IVAS_QUATERNION headPositions[RENDERER_HEAD_POSITIONS_PER_FRAME]; -#ifdef TD5 - IVAS_POSITION Pos[RENDERER_HEAD_POSITIONS_PER_FRAME]; -#endif - float crossfade[L_FRAME48k / RENDERER_HEAD_POSITIONS_PER_FRAME]; -#ifdef FIX_I109_ORIENTATION_TRACKING - ivas_orient_trk_state_t *hOrientationTracker; -#endif - -} IVAS_REND_HeadRotData; - -typedef struct ivas_binaural_head_track_struct -{ - int16_t num_quaternions; - IVAS_QUATERNION Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES]; -#ifdef TD5 - IVAS_POSITION Pos[MAX_PARAM_SPATIAL_SUBFRAMES]; -#endif - float Rmat[3][3]; - float Rmat_prev[3][3]; - uint8_t lrSwitchedNext; - uint8_t lrSwitchedCurrent; - float lrSwitchInterpVal; - - int16_t shd_rot_max_order; -#ifdef FIX_I109_ORIENTATION_TRACKING - ivas_orient_trk_state_t *OrientationTracker; -#endif - -} HEAD_TRACK_DATA, *HEAD_TRACK_DATA_HANDLE; /*----------------------------------------------------------------------------------* * Reverberator structure *----------------------------------------------------------------------------------*/ -/* Reverberator structures */ - typedef struct ivas_roomAcoustics_t { @@ -333,9 +306,6 @@ typedef struct ivas_render_config_t ivas_renderTypeOverride renderer_type_override; #endif ivas_roomAcoustics_t roomAcoustics; -#ifdef TD5 - float directivity[3]; -#endif } RENDER_CONFIG_DATA, *RENDER_CONFIG_HANDLE; @@ -419,7 +389,7 @@ typedef struct ivas_reverb_state_t /*----------------------------------------------------------------------------------* - * TD ISM Object Renderer structure + * TD ISm Object Renderer structure *----------------------------------------------------------------------------------*/ typedef struct diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 450eb896a1..574396ce0e 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -121,8 +121,14 @@ typedef struct IVAS_REND_AudioObjectPosition currentPos; IVAS_REND_AudioObjectPosition previousPos; TDREND_WRAPPER tdRendWrapper; +#ifdef FIX_197_CREND_INTERFACE CREND_WRAPPER_HANDLE crendWrapper; - REVERB_HANDLE hReverb; +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + REVERB_HANDLE reverb; +#endif +#else + CREND_WRAPPER crendWrapper; +#endif rotation_matrix rot_mat_prev; } input_ism; @@ -147,8 +153,14 @@ typedef struct LSSETUP_CUSTOM_STRUCT customLsInput; EFAP_WRAPPER efapInWrapper; TDREND_WRAPPER tdRendWrapper; +#ifdef FIX_197_CREND_INTERFACE CREND_WRAPPER_HANDLE crendWrapper; - REVERB_HANDLE hReverb; +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + REVERB_HANDLE reverb; +#endif +#else + CREND_WRAPPER crendWrapper; +#endif rotation_gains rot_gains_prev; lfe_routing lfeRouting; } input_mc; @@ -157,7 +169,11 @@ typedef struct { input_base base; pan_matrix hoaDecMtx; +#ifdef FIX_197_CREND_INTERFACE CREND_WRAPPER_HANDLE crendWrapper; +#else + CREND_WRAPPER crendWrapper; +#endif rotation_gains rot_gains_prev; } input_sba; @@ -319,7 +335,11 @@ static int32_t limitRendererOutput( * *-------------------------------------------------------------------*/ +#ifdef FIX_197_CREND_INTERFACE AUDIO_CONFIG getIvasAudioConfigFromRendAudioConfig( +#else +AUDIO_CONFIG rendAudioConfigToIvasAudioConfig( +#endif IVAS_REND_AudioConfig rendConfig ) { switch ( rendConfig ) @@ -907,16 +927,11 @@ static ivas_error getEfapGains( return IVAS_ERR_OK; } -#ifdef FIX_I109_ORIENTATION_TRACKING -static ivas_error initHeadRotation( -#else static void initHeadRotation( -#endif IVAS_REND_HANDLE hIvasRend ) { int16_t i, crossfade_len; float tmp; - ivas_error error; /* Head rotation is enabled by default */ hIvasRend->headRotData.headRotEnabled = 1; @@ -935,36 +950,9 @@ static void initHeadRotation( hIvasRend->headRotData.headPositions[i] = quaternionInit(); } -#ifdef FIX_I109_ORIENTATION_TRACKING - if ( ( hIvasRend->headRotData.hOrientationTracker = (ivas_orient_trk_state_t *) malloc( sizeof( ivas_orient_trk_state_t ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Orientation tracking" ); - } - - if ( ( error = ivas_orient_trk_Init( hIvasRend->headRotData.hOrientationTracker ) ) != IVAS_ERR_OK ) - { - return error; - } - - return IVAS_ERR_OK; -#else return; -#endif } -#ifdef FIX_I109_ORIENTATION_TRACKING -static void closeHeadRotation( - IVAS_REND_HANDLE hIvasRend ) -{ - if ( ( hIvasRend != NULL ) && ( hIvasRend->headRotData.hOrientationTracker != NULL ) ) - { - free( hIvasRend->headRotData.hOrientationTracker ); - } - - return; -} -#endif - static void initRotMatrix( rotation_matrix rot_mat ) { @@ -1023,11 +1011,6 @@ static IVAS_REND_AudioObjectPosition defaultObjectPosition( pos.azimuth = 0.0f; pos.elevation = 0.0f; -#ifdef TD5 - pos.radius = 1.0f; - pos.yaw = 0.0f; - pos.pitch = 0.0f; -#endif return pos; } @@ -1073,21 +1056,6 @@ static CREND_WRAPPER defaultCrendWrapper( return w; } -static bool isIoConfigPairSupported( - IVAS_REND_AudioConfig inConfig, - IVAS_REND_AudioConfig outConfig ) -{ - /* Rendering mono or stereo to binaural is not supported */ - if ( ( inConfig == IVAS_REND_AUDIO_CONFIG_MONO || inConfig == IVAS_REND_AUDIO_CONFIG_STEREO ) && - getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) - { - return false; - } - - /* If not returned so far, config pair is supported */ - return true; -} - static ivas_error setRendInputActiveIsm( void *input, const IVAS_REND_AudioConfig inConfig, @@ -1103,61 +1071,64 @@ static ivas_error setRendInputActiveIsm( rendCtx = inputIsm->base.ctx; outConfig = *rendCtx.pOutConfig; - if ( !isIoConfigPairSupported( inConfig, outConfig ) ) - { - return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; - } - initRendInputBase( &inputIsm->base, inConfig, id, rendCtx ); inputIsm->currentPos = defaultObjectPosition(); inputIsm->previousPos = defaultObjectPosition(); +#ifdef FIX_197_CREND_INTERFACE inputIsm->crendWrapper = NULL; - inputIsm->hReverb = NULL; +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + inputIsm->reverb = NULL; +#endif +#else + inputIsm->crendWrapper = defaultCrendWrapper(); +#endif inputIsm->tdRendWrapper = defaultTdRendWrapper(); initRotMatrix( inputIsm->rot_mat_prev ); error = IVAS_ERR_OK; if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL ) { -#ifdef TD5 - if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#else if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif { return error; } } else if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) { +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND if ( hRendCfg != NULL && hRendCfg->roomAcoustics.use_brir == 0 && hRendCfg->roomAcoustics.late_reverb_on ) { -#ifdef TD5 - if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#else if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif { return error; } - if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_open( &( inputIsm->reverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } } else { - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), hRendCfg, -#ifndef FIX_I109_ORIENTATION_TRACKING +#endif + if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, +#ifdef FIX_197_CREND_INTERFACE + getIvasAudioConfigFromRendAudioConfig( outConfig ), +#else + rendAudioConfigToIvasAudioConfig( outConfig ), +#endif + hRendCfg, +#ifdef FIX_197_CREND_INTERFACE 0, #endif NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND } +#endif } return IVAS_ERR_OK; @@ -1173,10 +1144,21 @@ static void clearInputIsm( initRendInputBase( &inputIsm->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx ); /* Free input's internal handles */ +#ifdef FIX_197_CREND_INTERFACE + if ( inputIsm->crendWrapper != NULL ) +#else + if ( inputIsm->crendWrapper.hCrend != NULL ) +#endif + { + ivas_rend_closeCrend( &inputIsm->crendWrapper ); + } - ivas_rend_closeCrend( &inputIsm->crendWrapper ); - - ivas_reverb_close( &inputIsm->hReverb ); +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + if ( inputIsm->reverb != NULL ) + { + ivas_reverb_close( &inputIsm->reverb ); + } +#endif if ( inputIsm->tdRendWrapper.hBinRendererTd != NULL ) { @@ -1234,8 +1216,6 @@ static void fillIdentityPanMatrix( { panMatrix[i][i] = 1.0f; } - - return; } static ivas_error initMcPanGainsWithIdentMatrix( @@ -1253,14 +1233,20 @@ static ivas_error initMcPanGainsWithConversionMapping( AUDIO_CONFIG ivasConfigIn, ivasConfigOut; int16_t i; +#ifdef FIX_197_CREND_INTERFACE ivasConfigIn = getIvasAudioConfigFromRendAudioConfig( inputMc->base.inConfig ); ivasConfigOut = getIvasAudioConfigFromRendAudioConfig( outConfig ); +#else + ivasConfigIn = rendAudioConfigToIvasAudioConfig( inputMc->base.inConfig ); + ivasConfigOut = rendAudioConfigToIvasAudioConfig( outConfig ); +#endif /* Find conversion mapping for current I/O config pair. * Stay with default panning matrix if conversion_matrix is NULL */ for ( i = 0; i < LS_SETUP_CONVERSION_NUM_MAPPINGS; ++i ) { - if ( ls_conversion_mapping[i].input_config == ivasConfigIn && ls_conversion_mapping[i].output_config == ivasConfigOut ) + if ( ls_conversion_mapping[i].input_config == ivasConfigIn && + ls_conversion_mapping[i].output_config == ivasConfigOut ) { /* Mapping found with valid matrix - copy */ if ( ls_conversion_mapping[i].conversion_matrix != NULL ) @@ -1816,9 +1802,21 @@ static ivas_error initMcBinauralRendering( inputMc->tdRendWrapper.hHrtfTD = NULL; } - ivas_rend_closeCrend( &inputMc->crendWrapper ); +#ifdef FIX_197_CREND_INTERFACE + if ( inputMc->crendWrapper != NULL ) +#else + if ( inputMc->crendWrapper.hCrend != NULL ) +#endif + { + ivas_rend_closeCrend( &inputMc->crendWrapper ); + } - ivas_reverb_close( &inputMc->hReverb ); +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + if ( inputMc->reverb != NULL ) + { + ivas_reverb_close( &inputMc->reverb ); + } +#endif if ( inputMc->efapInWrapper.hEfap != NULL ) { @@ -1845,27 +1843,32 @@ static ivas_error initMcBinauralRendering( // if ( initTDRend ) { -#ifdef TD5 - if ( ( error = ivas_td_binaural_open_ext( &inputMc->tdRendWrapper, inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate ) ) != IVAS_ERR_OK ) -#else if ( ( error = ivas_td_binaural_open_ext( &inputMc->tdRendWrapper, inConfig, &inputMc->customLsInput, outSampleRate ) ) != IVAS_ERR_OK ) -#endif { return error; } +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND if ( hRendCfg != NULL && hRendCfg->roomAcoustics.use_brir == 0 && hRendCfg->roomAcoustics.late_reverb_on ) { - if ( ( error = ivas_reverb_open( &( inputMc->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, outSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_open( &( inputMc->reverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, outSampleRate ) ) != IVAS_ERR_OK ) { return error; } } +#endif } { - if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) ? AUDIO_CONFIG_7_1_4 : getIvasAudioConfigFromRendAudioConfig( inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), hRendCfg, -#ifndef FIX_I109_ORIENTATION_TRACKING + if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, +#ifdef FIX_197_CREND_INTERFACE + ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) ? AUDIO_CONFIG_7_1_4 : getIvasAudioConfigFromRendAudioConfig( inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), +#else + ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) ? AUDIO_CONFIG_7_1_4 : rendAudioConfigToIvasAudioConfig( inConfig ), + rendAudioConfigToIvasAudioConfig( outConfig ), +#endif + hRendCfg, +#ifdef FIX_197_CREND_INTERFACE 0, #endif NULL, outSampleRate ) ) != IVAS_ERR_OK ) @@ -1892,7 +1895,7 @@ static lfe_routing defaultLfeRouting( const IVAS_REND_AudioConfig outConfig, const LSSETUP_CUSTOM_STRUCT customLsOut ) { - int16_t i; + int32_t i; lfe_routing routing; /* Set all output gains to zero, then route each input LFE consecutively to the next available output LFE. */ @@ -1959,17 +1962,18 @@ static ivas_error setRendInputActiveMc( rendCtx = inputMc->base.ctx; outConfig = *rendCtx.pOutConfig; - if ( !isIoConfigPairSupported( inConfig, outConfig ) ) - { - return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; - } - initRendInputBase( &inputMc->base, inConfig, id, rendCtx ); setZeroPanMatrix( inputMc->panGains ); inputMc->customLsInput = defaultCustomLs(); inputMc->tdRendWrapper = defaultTdRendWrapper(); +#ifdef FIX_197_CREND_INTERFACE inputMc->crendWrapper = NULL; - inputMc->hReverb = NULL; +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + inputMc->reverb = NULL; +#endif +#else + inputMc->crendWrapper = defaultCrendWrapper(); +#endif initRotGains( inputMc->rot_gains_prev ); inputMc->lfeRouting = defaultLfeRouting( inConfig, inputMc->customLsInput, outConfig, *inputMc->base.ctx.pCustomLsOut ); @@ -2004,9 +2008,21 @@ static void clearInputMc( efap_free_data( &inputMc->efapInWrapper.hEfap ); } - ivas_rend_closeCrend( &inputMc->crendWrapper ); +#ifdef FIX_197_CREND_INTERFACE + if ( inputMc->crendWrapper != NULL ) +#else + if ( inputMc->crendWrapper.hCrend != NULL ) +#endif + { + ivas_rend_closeCrend( &inputMc->crendWrapper ); + } - ivas_reverb_close( &inputMc->hReverb ); +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + if ( inputMc->reverb != NULL ) + { + ivas_reverb_close( &inputMc->reverb ); + } +#endif if ( inputMc->tdRendWrapper.hBinRendererTd != NULL ) { @@ -2044,7 +2060,11 @@ static ivas_error initSbaPanGainsForMcOut( case IVAS_REND_AUDIO_CONFIG_MONO: hOutSetup.ls_azimuth = ls_azimuth_CICP1; hOutSetup.ls_elevation = ls_elevation_CICP1; +#ifdef FIX_197_CREND_INTERFACE ivas_output_init( &hOutSetup, getIvasAudioConfigFromRendAudioConfig( outConfig ) ); +#else + ivas_output_init( &hOutSetup, rendAudioConfigToIvasAudioConfig( outConfig ) ); +#endif break; case IVAS_REND_AUDIO_CONFIG_STEREO: case IVAS_REND_AUDIO_CONFIG_5_1: @@ -2052,7 +2072,11 @@ static ivas_error initSbaPanGainsForMcOut( case IVAS_REND_AUDIO_CONFIG_5_1_2: case IVAS_REND_AUDIO_CONFIG_5_1_4: case IVAS_REND_AUDIO_CONFIG_7_1_4: +#ifdef FIX_197_CREND_INTERFACE ivas_output_init( &hOutSetup, getIvasAudioConfigFromRendAudioConfig( outConfig ) ); +#else + ivas_output_init( &hOutSetup, rendAudioConfigToIvasAudioConfig( outConfig ) ); +#endif break; case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM: ivas_ls_custom_setup( &hOutSetup, outSetupCustom ); @@ -2133,10 +2157,15 @@ static ivas_error updateSbaPanGains( { case IVAS_REND_AUDIO_CONFIG_BINAURAL: error = ivas_rend_openCrend( &inputSba->crendWrapper, +#ifdef FIX_197_CREND_INTERFACE getIvasAudioConfigFromRendAudioConfig( inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), +#else + rendAudioConfigToIvasAudioConfig( inConfig ), + rendAudioConfigToIvasAudioConfig( outConfig ), +#endif hRendCfg, -#ifndef FIX_I109_ORIENTATION_TRACKING +#ifdef FIX_197_CREND_INTERFACE 0, #endif NULL, @@ -2150,9 +2179,13 @@ static ivas_error updateSbaPanGains( error = ivas_rend_openCrend( &inputSba->crendWrapper, AUDIO_CONFIG_7_1_4, +#ifdef FIX_197_CREND_INTERFACE getIvasAudioConfigFromRendAudioConfig( outConfig ), +#else + rendAudioConfigToIvasAudioConfig( outConfig ), +#endif hRendCfg, -#ifndef FIX_I109_ORIENTATION_TRACKING +#ifdef FIX_197_CREND_INTERFACE 0, #endif NULL, @@ -2189,14 +2222,13 @@ static ivas_error setRendInputActiveSba( rendCtx = inputSba->base.ctx; outConfig = *rendCtx.pOutConfig; - if ( !isIoConfigPairSupported( inConfig, outConfig ) ) - { - return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; - } - initRendInputBase( &inputSba->base, inConfig, id, rendCtx ); setZeroPanMatrix( inputSba->hoaDecMtx ); +#ifdef FIX_197_CREND_INTERFACE inputSba->crendWrapper = NULL; +#else + inputSba->crendWrapper = defaultCrendWrapper(); +#endif initRotGains( inputSba->rot_gains_prev ); if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg ) ) != IVAS_ERR_OK ) @@ -2217,7 +2249,14 @@ static void clearInputSba( initRendInputBase( &inputSba->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx ); /* Free input's internal handles */ - ivas_rend_closeCrend( &inputSba->crendWrapper ); +#ifdef FIX_197_CREND_INTERFACE + if ( inputSba->crendWrapper != NULL ) +#else + if ( inputSba->crendWrapper.hCrend != NULL ) +#endif + { + ivas_rend_closeCrend( &inputSba->crendWrapper ); + } return; } @@ -2234,7 +2273,11 @@ static ivas_error initMasaDummyDecForMcOut( DecoderDummy *decDummy; decDummy = inputMasa->decDummy; +#ifdef FIX_197_CREND_INTERFACE output_config = getIvasAudioConfigFromRendAudioConfig( outConfig ); +#else + output_config = rendAudioConfigToIvasAudioConfig( outConfig ); +#endif decDummy->hDecoderConfig->output_config = output_config; decDummy->hDecoderConfig->ivas_total_brate = IVAS_512k; /* Todo Nokia: This is preventing initialization of 2TC as 1TC, should be fixed properly in ivas_dirac_dec_config() */ @@ -2271,6 +2314,9 @@ static ivas_error initMasaDummyDecForMcOut( { return error; } +#ifndef FIX_107_5MS_SUBFRAME_RENDERING + decDummy->hDiracDecBin->useSubframeMode = 0; /* Todo Nokia: This will disappear in later work but needs to be this now. */ +#endif } numCldfbAnalyses = decDummy->nchan_transport; @@ -2316,7 +2362,11 @@ static ivas_error initMasaDummyDecForSbaOut( decDummy = inputMasa->decDummy; +#ifdef FIX_197_CREND_INTERFACE output_config = getIvasAudioConfigFromRendAudioConfig( outConfig ); +#else + output_config = rendAudioConfigToIvasAudioConfig( outConfig ); +#endif decDummy->hDecoderConfig->output_config = output_config; decDummy->hDecoderConfig->ivas_total_brate = IVAS_512k; /* Todo Nokia: This is preventing initialization of 2TC as 1TC, should be fixed properly in ivas_dirac_dec_config() */ @@ -2383,7 +2433,11 @@ static ivas_error initMasaDummyDecForBinauralOut( decDummy = inputMasa->decDummy; +#ifdef FIX_197_CREND_INTERFACE output_config = getIvasAudioConfigFromRendAudioConfig( outConfig ); +#else + output_config = rendAudioConfigToIvasAudioConfig( outConfig ); +#endif decDummy->hDecoderConfig->output_config = output_config; output_config = decDummy->hDecoderConfig->output_config; @@ -2403,6 +2457,11 @@ static ivas_error initMasaDummyDecForBinauralOut( } decDummy->ivas_format = MASA_FORMAT; decDummy->transport_config = AUDIO_CONFIG_INVALID; +#ifndef REMOVE_FORCE_SUBFRAME_BIN +#ifdef DEBUGGING + decDummy->hDecoderConfig->forceSubframeBinauralization = 0; +#endif +#endif if ( ( error = ivas_dirac_dec_open( decDummy ) ) != IVAS_ERR_OK ) { @@ -2419,6 +2478,9 @@ static ivas_error initMasaDummyDecForBinauralOut( return error; } +#ifndef FIX_107_5MS_SUBFRAME_RENDERING + decDummy->hDiracDecBin->useSubframeMode = 0; /* Todo Nokia: This will disappear in later work but needs to be this now. */ +#endif for ( i = 0; i < BINAURAL_CHANNELS; i++ ) { @@ -2484,12 +2546,17 @@ static DecoderDummy *initDecoderDummy( decDummy = malloc( sizeof( DecoderDummy ) ); decDummy->hDecoderConfig = malloc( sizeof( DECODER_CONFIG ) ); decDummy->hDecoderConfig->output_Fs = sampleRate; - decDummy->hDecoderConfig->nchan_out = numOutChannels; + decDummy->hDecoderConfig->nchan_out = (int16_t) numOutChannels; decDummy->hDecoderConfig->Opt_Headrotation = 0; decDummy->hBinRenderer = NULL; decDummy->hEFAPdata = NULL; +#ifdef FIX_197_CREND_INTERFACE decDummy->hCrendWrapper = NULL; +#else + decDummy->hHrtf = NULL; + decDummy->hCrend = NULL; +#endif decDummy->hHrtfTD = NULL; decDummy->hSpar = NULL; decDummy->hoa_dec_mtx = NULL; @@ -2497,7 +2564,11 @@ static DecoderDummy *initDecoderDummy( decDummy->hMasa = NULL; decDummy->hDiracDecBin = NULL; decDummy->hQMetaData = NULL; +#ifdef FIX_197_CREND_INTERFACE decDummy->hDecoderConfig->output_config = getIvasAudioConfigFromRendAudioConfig( outConfig ); +#else + decDummy->hDecoderConfig->output_config = rendAudioConfigToIvasAudioConfig( outConfig ); +#endif decDummy->nchan_transport = numTransChannels; if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) @@ -2514,10 +2585,6 @@ static DecoderDummy *initDecoderDummy( decDummy->hHeadTrackData->lrSwitchInterpVal = 0.0f; decDummy->hHeadTrackData->lrSwitchedCurrent = 0; decDummy->hHeadTrackData->lrSwitchedNext = 0; -#ifdef FIX_I109_ORIENTATION_TRACKING - decDummy->hHeadTrackData->OrientationTracker = (ivas_orient_trk_state_t *) malloc( sizeof( ivas_orient_trk_state_t ) ); - ivas_orient_trk_Init( decDummy->hHeadTrackData->OrientationTracker ); -#endif } else { @@ -2557,18 +2624,13 @@ static ivas_error setRendInputActiveMasa( outConfig = *rendCtx.pOutConfig; (void) hRendCfg; /* Suppress warning */ - if ( !isIoConfigPairSupported( inConfig, outConfig ) ) - { - return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; - } - initRendInputBase( &inputMasa->base, inConfig, id, rendCtx ); if ( ( error = getAudioConfigNumChannels( inConfig, &numInChannels ) ) != IVAS_ERR_OK ) { return error; } - inputMasa->decDummy = initDecoderDummy( *rendCtx.pOutSampleRate, numInChannels, outConfig, 0 ); + inputMasa->decDummy = initDecoderDummy( *rendCtx.pOutSampleRate, (int16_t) numInChannels, outConfig, 0 ); inputMasa->metadataHasBeenFed = false; if ( ( error = updateMasaDummyDec( inputMasa, outConfig ) ) != IVAS_ERR_OK ) @@ -2595,15 +2657,8 @@ static void freeDecoderDummy( { free( pDecDummy->hDecoderConfig ); } - if ( pDecDummy->hHeadTrackData != NULL ) { -#ifdef FIX_I109_ORIENTATION_TRACKING - if ( pDecDummy->hHeadTrackData->OrientationTracker != NULL ) - { - free( pDecDummy->hHeadTrackData->OrientationTracker ); - } -#endif free( pDecDummy->hHeadTrackData ); } ivas_render_config_close( &pDecDummy->hRenderConfig ); @@ -2614,6 +2669,7 @@ static void freeDecoderDummy( if ( pDecDummy->cldfbAnaDec[i] != NULL ) { deleteCldfb( &( pDecDummy->cldfbAnaDec[i] ) ); + pDecDummy->cldfbAnaDec[i] = NULL; } } @@ -2622,11 +2678,16 @@ static void freeDecoderDummy( if ( pDecDummy->cldfbSynDec[i] != NULL ) { deleteCldfb( &( pDecDummy->cldfbSynDec[i] ) ); + pDecDummy->cldfbSynDec[i] = NULL; } } /* DirAC handle */ - ivas_dirac_dec_close( &( pDecDummy->hDirAC ) ); + if ( pDecDummy->hDirAC != NULL ) + { + ivas_dirac_dec_close( pDecDummy->hDirAC ); + pDecDummy->hDirAC = NULL; + } /* Qmetadata handle */ ivas_qmetadata_close( &pDecDummy->hQMetaData ); @@ -2673,7 +2734,10 @@ ivas_error IVAS_REND_Open( ivas_error error; int16_t numOutChannels; - /* Validate function arguments */ + /*-----------------------------------------------------------------* + * Validate function arguments + *-----------------------------------------------------------------*/ + if ( phIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -2718,14 +2782,7 @@ ivas_error IVAS_REND_Open( } /* Initialize headrotation data */ -#ifdef FIX_I109_ORIENTATION_TRACKING - if ( ( error = initHeadRotation( hIvasRend ) ) != IVAS_ERR_OK ) - { - return error; - } -#else initHeadRotation( hIvasRend ); -#endif /* Initialize EFAP */ if ( ( error = initEfap( &hIvasRend->efapOutWrapper, outConfig, &hIvasRend->customLsOut ) ) != IVAS_ERR_OK ) @@ -2737,8 +2794,14 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { initRendInputBase( &hIvasRend->inputsIsm[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) ); +#ifdef FIX_197_CREND_INTERFACE hIvasRend->inputsIsm[i].crendWrapper = NULL; - hIvasRend->inputsIsm[i].hReverb = NULL; +#else + hIvasRend->inputsIsm[i].crendWrapper.hCrend = NULL; +#endif +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + hIvasRend->inputsIsm[i].reverb = NULL; +#endif hIvasRend->inputsIsm[i].tdRendWrapper.hBinRendererTd = NULL; } @@ -2746,15 +2809,25 @@ ivas_error IVAS_REND_Open( { initRendInputBase( &hIvasRend->inputsMc[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) ); hIvasRend->inputsMc[i].efapInWrapper.hEfap = NULL; +#ifdef FIX_197_CREND_INTERFACE hIvasRend->inputsMc[i].crendWrapper = NULL; - hIvasRend->inputsMc[i].hReverb = NULL; +#else + hIvasRend->inputsMc[i].crendWrapper.hCrend = NULL; +#endif +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + hIvasRend->inputsMc[i].reverb = NULL; +#endif hIvasRend->inputsMc[i].tdRendWrapper.hBinRendererTd = NULL; } for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) { initRendInputBase( &hIvasRend->inputsSba[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) ); +#ifdef FIX_197_CREND_INTERFACE hIvasRend->inputsSba[i].crendWrapper = NULL; +#else + hIvasRend->inputsSba[i].crendWrapper.hCrend = NULL; +#endif } for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) @@ -2832,7 +2905,10 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( input_mc *inputMc; input_sba *inputSba; - /* Validate function arguments */ + /*-----------------------------------------------------------------* + * Validate function arguments + *-----------------------------------------------------------------*/ + if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -2914,7 +2990,10 @@ ivas_error IVAS_REND_NumOutChannels( { ivas_error error; - /* Validate function arguments */ + /*-----------------------------------------------------------------* + * Validate function arguments + *-----------------------------------------------------------------*/ + if ( hIvasRend == NULL || numOutChannels == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3137,7 +3216,10 @@ ivas_error IVAS_REND_AddInput( ivas_error ( *activateInput )( void *, IVAS_REND_AudioConfig, IVAS_REND_InputId, RENDER_CONFIG_DATA * ); int32_t inputIndex; - /* Validate function arguments */ + /*-----------------------------------------------------------------* + * Validate function arguments + *-----------------------------------------------------------------*/ + if ( hIvasRend == NULL || inputId == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3206,7 +3288,10 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( input_mc *inputMc; ivas_error error; - /* Validate function arguments */ + /*-----------------------------------------------------------------* + * Validate function arguments + *-----------------------------------------------------------------*/ + if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3272,7 +3357,10 @@ ivas_error IVAS_REND_SetInputGain( input_base *inputBase; ivas_error error; - /* Validate function arguments */ + /*-----------------------------------------------------------------* + * Validate function arguments + *-----------------------------------------------------------------*/ + if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3306,7 +3394,10 @@ ivas_error IVAS_REND_SetInputLfeMtx( input_mc *pInputMc; ivas_error error; - /* Validate function arguments */ + /*-----------------------------------------------------------------* + * Validate function arguments + *-----------------------------------------------------------------*/ + if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3357,7 +3448,10 @@ ivas_error IVAS_REND_SetInputLfePos( input_mc *pInputMc; ivas_error error; - /* Validate function arguments */ + /*-----------------------------------------------------------------* + * Validate function arguments + *-----------------------------------------------------------------*/ + if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3403,7 +3497,10 @@ ivas_error IVAS_REND_RemoveInput( ivas_error error; input_base *inputBase; - /* Validate function arguments */ + /*-----------------------------------------------------------------* + * Validate function arguments + *-----------------------------------------------------------------*/ + if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3451,7 +3548,10 @@ ivas_error IVAS_REND_GetInputNumChannels( ivas_error error; const input_base *pInput; - /* Validate function arguments */ + /*-----------------------------------------------------------------* + * Validate function arguments + *-----------------------------------------------------------------*/ + if ( hIvasRend == NULL || numChannels == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3490,7 +3590,10 @@ ivas_error IVAS_REND_GetDelay( int32_t latency_ns; int32_t max_latency_ns; - /* Validate function arguments */ + /*-----------------------------------------------------------------* + * Validate function arguments + *-----------------------------------------------------------------*/ + if ( hIvasRend == NULL || nSamples == NULL || timeScale == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3505,8 +3608,13 @@ ivas_error IVAS_REND_GetDelay( { if ( hIvasRend->inputsIsm[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) { +#ifdef FIX_197_CREND_INTERFACE latency_ns = max( ( hIvasRend->inputsIsm[i].crendWrapper != NULL ) ? hIvasRend->inputsIsm[i].crendWrapper->binaural_latency_ns : 0, hIvasRend->inputsIsm[i].tdRendWrapper.binaural_latency_ns ); +#else + latency_ns = max( hIvasRend->inputsIsm[i].crendWrapper.binaural_latency_ns, + hIvasRend->inputsIsm[i].tdRendWrapper.binaural_latency_ns ); +#endif max_latency_ns = max( max_latency_ns, latency_ns ); } } @@ -3515,8 +3623,13 @@ ivas_error IVAS_REND_GetDelay( { if ( hIvasRend->inputsMc[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) { +#ifdef FIX_197_CREND_INTERFACE latency_ns = max( ( hIvasRend->inputsMc[i].crendWrapper != NULL ) ? hIvasRend->inputsMc[i].crendWrapper->binaural_latency_ns : 0, hIvasRend->inputsMc[i].tdRendWrapper.binaural_latency_ns ); +#else + latency_ns = max( hIvasRend->inputsMc[i].crendWrapper.binaural_latency_ns, + hIvasRend->inputsMc[i].tdRendWrapper.binaural_latency_ns ); +#endif max_latency_ns = max( max_latency_ns, latency_ns ); } } @@ -3525,7 +3638,11 @@ ivas_error IVAS_REND_GetDelay( { if ( hIvasRend->inputsSba[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) { +#ifdef FIX_197_CREND_INTERFACE latency_ns = ( hIvasRend->inputsSba[i].crendWrapper != NULL ) ? hIvasRend->inputsSba[i].crendWrapper->binaural_latency_ns : 0; +#else + latency_ns = hIvasRend->inputsSba[i].crendWrapper.binaural_latency_ns; +#endif max_latency_ns = max( max_latency_ns, latency_ns ); } } @@ -3561,7 +3678,10 @@ ivas_error IVAS_REND_FeedInputAudio( input_base *inputBase; int16_t numInputChannels; - /* Validate function arguments */ + /*-----------------------------------------------------------------* + * Validate function arguments + *-----------------------------------------------------------------*/ + if ( hIvasRend == NULL || inputAudio.data == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3625,7 +3745,10 @@ ivas_error IVAS_REND_FeedInputObjectMetadata( input_ism *inputIsm; ivas_error error; - /* Validate function arguments */ + /*-----------------------------------------------------------------* + * Validate function arguments + *-----------------------------------------------------------------*/ + if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3666,7 +3789,10 @@ ivas_error IVAS_REND_FeedInputMasaMetadata( input_base *inputBase; input_masa *inputMasa; - /* Validate function arguments */ + /*-----------------------------------------------------------------* + * Validate function arguments + *-----------------------------------------------------------------*/ + if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3713,6 +3839,7 @@ ivas_error IVAS_REND_InitConfig( hIvasRend->rendererConfigEnabled = 0; } +#ifdef FIX_197_CREND_INTERFACE if ( rendererConfigEnabled ) { if ( ( error = ivas_render_config_open( &( hIvasRend->hRendererConfig ) ) ) != IVAS_ERR_OK ) @@ -3720,15 +3847,26 @@ ivas_error IVAS_REND_InitConfig( return error; } - if ( ( error = ivas_render_config_init_from_rom( &hIvasRend->hRendererConfig, hIvasRend->rendererConfigEnabled ) ) != IVAS_ERR_OK ) + if ( ivas_render_config_init_from_rom( &hIvasRend->hRendererConfig, hIvasRend->rendererConfigEnabled ) != IVAS_ERR_OK ) { - return error; + return IVAS_ERR_INTERNAL_FATAL; } } else { hIvasRend->hRendererConfig = NULL; } +#else + if ( ( error = ivas_render_config_open( &( hIvasRend->hRendererConfig ) ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( ivas_render_config_init_from_rom( &hIvasRend->hRendererConfig, hIvasRend->rendererConfigEnabled ) != IVAS_ERR_OK ) + { + return IVAS_ERR_INTERNAL_FATAL; + } +#endif return IVAS_ERR_OK; } @@ -3801,9 +3939,6 @@ int16_t IVAS_REND_FeedRenderConfig( } hRenderConfig = hIvasRend->hRendererConfig; -#ifdef TD5 - mvr2r( renderConfig.directivity, hRenderConfig->directivity, 3 ); -#endif #ifdef DEBUGGING hRenderConfig->renderer_type_override = RENDER_TYPE_OVERRIDE_NONE; if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_FASTCONV ) @@ -3836,21 +3971,16 @@ int16_t IVAS_REND_FeedRenderConfig( *-------------------------------------------------------------------*/ ivas_error IVAS_REND_SetHeadRotation( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ -#ifdef TD5 - const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME], /* i : head orientations for next rendering call */ - const IVAS_POSITION Pos[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : listener positions for next rendering call */ -#else + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : head positions for next rendering call */ -#endif ) { int16_t i; -#ifdef FIX_I109_ORIENTATION_TRACKING - IVAS_QUATERNION rotQuat; -#endif - /* Validate function arguments */ + /*-----------------------------------------------------------------* + * Validate function arguments + *-----------------------------------------------------------------*/ + if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3859,7 +3989,7 @@ ivas_error IVAS_REND_SetHeadRotation( if ( getAudioConfigType( hIvasRend->outputConfig ) != IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) { /* Head rotation can be set only with binaural output */ - return IVAS_ERR_INVALID_OUTPUT_FORMAT; + return IVAS_ERR_METADATA_NOT_EXPECTED; } if ( headRot == NULL ) @@ -3871,24 +4001,7 @@ ivas_error IVAS_REND_SetHeadRotation( hIvasRend->headRotData.headRotEnabled = 1; for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) { -#ifdef FIX_I109_ORIENTATION_TRACKING - /* check for Euler angle signaling */ - if ( headRot[i].w == -3.0f ) - { - Euler2Quat( deg2rad( headRot[i].x ), deg2rad( headRot[i].y ), deg2rad( headRot[i].z ), &rotQuat ); - } - else - { - rotQuat = headRot[i]; - } - - ivas_orient_trk_Process( hIvasRend->headRotData.hOrientationTracker, rotQuat, FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES, &hIvasRend->headRotData.headPositions[i] ); -#else hIvasRend->headRotData.headPositions[i] = headRot[i]; -#endif -#ifdef TD5 - hIvasRend->headRotData.Pos[i] = Pos[i]; -#endif } } @@ -3896,164 +4009,6 @@ ivas_error IVAS_REND_SetHeadRotation( } -#ifdef FIX_I109_ORIENTATION_TRACKING -/*-------------------------------------------------------------------* - * IVAS_REND_SetOrientationTrackingMode() - * - * - *-------------------------------------------------------------------*/ - -ivas_error IVAS_REND_SetOrientationTrackingMode( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const uint8_t otrMode /* i : Orientation tracking mode */ -) -{ - OTR_TRACKING_T mode; - ivas_error error; - - if ( hIvasRend == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - switch ( otrMode ) - { - case IVAS_ORIENT_TRK_AVG: - mode = OTR_TRACKING_AVG_ORIENT; - break; - case IVAS_ORIENT_TRK_REF: - mode = OTR_TRACKING_REF_ORIENT; - break; -#ifdef OTR_REFERENCE_VECTOR_TRACKING - case IVAS_ORIENT_TRK_REF_VEC: - mode = OTR_TRACKING_REF_VEC; - break; - case IVAS_ORIENT_TRK_REF_VEC_LEV: - mode = OTR_TRACKING_REF_VEC_LEV; - break; -#endif /* OTR_REFERENCE_VECTOR_TRACKING */ - case IVAS_ORIENT_TRK_NONE: - default: - mode = OTR_TRACKING_NONE; - break; - } - - if ( ( error = ivas_orient_trk_SetTrackingType( hIvasRend->headRotData.hOrientationTracker, mode ) ) != IVAS_ERR_OK ) - { - return error; - } - - return IVAS_ERR_OK; -} - - -/*-------------------------------------------------------------------* - * IVAS_REND_SetReferenceRotation() - * - * - *-------------------------------------------------------------------*/ - -ivas_error IVAS_REND_SetReferenceRotation( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const IVAS_QUATERNION refRot /* i : Reference rotation */ -) -{ - ivas_error error; - - /* Validate function arguments */ - if ( hIvasRend == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - if ( ( error = ivas_orient_trk_SetReferenceRotation( hIvasRend->headRotData.hOrientationTracker, refRot ) ) != IVAS_ERR_OK ) - { - return error; - } - - return IVAS_ERR_OK; -} - - -/*-------------------------------------------------------------------* - * IVAS_REND_GetMainOrientation() - * - * - *-------------------------------------------------------------------*/ - -ivas_error IVAS_REND_GetMainOrientation( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer for main orientation */ -) -{ - ivas_error error; - - if ( hIvasRend == NULL || pOrientation == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - if ( ( error = ivas_orient_trk_GetMainOrientation( hIvasRend->headRotData.hOrientationTracker, pOrientation ) ) != IVAS_ERR_OK ) - { - return error; - } - - return IVAS_ERR_OK; -} - - -/*-------------------------------------------------------------------* - * IVAS_REND_GetTrackedRotation() - * - * - *-------------------------------------------------------------------*/ - -ivas_error IVAS_REND_GetTrackedRotation( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - IVAS_QUATERNION *pRotation /* i/o: Quaternion pointer processed rotation */ -) -{ - ivas_error error; - - if ( hIvasRend == NULL || pRotation == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - if ( ( error = ivas_orient_trk_GetTrackedRotation( hIvasRend->headRotData.hOrientationTracker, pRotation ) ) != IVAS_ERR_OK ) - { - return error; - } - - return IVAS_ERR_OK; -} - - -#ifdef OTR_REFERENCE_VECTOR_TRACKING -/*---------------------------------------------------------------------* - * IVAS_REND_SetReferenceVector( ) - * - * Sets a reference vector spanning from listenerPos to refPos. Only - * available in OTR_TRACKING_REF_VEC and OTR_TRACKING_REF_VEC_LEV modes. - *---------------------------------------------------------------------*/ - -ivas_error IVAS_REND_SetReferenceVector( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const IVAS_VECTOR3 listenerPos, /* i : Listener position */ - const IVAS_VECTOR3 refPos /* i : Reference position */ -) -{ - if ( hIvasRend == NULL || hIvasRend->headRotData.hOrientationTracker == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - return ivas_orient_trk_SetReferenceVector( hIvasRend->headRotData.hOrientationTracker, listenerPos, refPos ); -} -#endif /* OTR_REFERENCE_VECTOR_TRACKING */ -#endif - - /*-------------------------------------------------------------------* * Local functions *-------------------------------------------------------------------*/ @@ -4190,7 +4145,7 @@ static ivas_error rotateFrameMc( /* initialize gains to passthrough */ for ( ch_in = 0; ch_in < nchan; ch_in++ ) { - set_zero( gains[ch_in], nchan ); + set_zero( gains[ch_in], (int16_t) nchan ); gains[ch_in][ch_in] = 1.f; } @@ -4329,18 +4284,7 @@ static ivas_error rotateFrameSba( ( 1 - headRotData->crossfade[i] ) * gains_prev[n][m] * ( *readPtr ); } } -#ifdef FIX_376_SBA_ROTATE - /* write back the result */ - for ( n = m1; n < m2; n++ ) - { - writePtr = getSmplPtr( outAudio, n, subframe_idx * subframe_len + i ); - ( *writePtr ) = tmpRot[n - m1]; - } - m1 = m2; - m2 += 2 * ( l + 1 ) + 1; -#endif } -#ifndef FIX_376_SBA_ROTATE /* write back the result */ for ( n = m1; n < m2; n++ ) { @@ -4349,7 +4293,6 @@ static ivas_error rotateFrameSba( } m1 = m2; m2 += 2 * ( l + 1 ) + 1; -#endif } /*unoptimized code for reference (full matrix multiplication)*/ @@ -4396,7 +4339,9 @@ static ivas_error renderIsmToBinaural( NULL, ismInput->base.ctx.pHeadRotData, &ismInput->currentPos, - ismInput->hReverb, +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + ismInput->reverb, +#endif outAudio.config.numSamplesPerChannel, tmpTDRendBuffer ) ) != IVAS_ERR_OK ) { @@ -4419,7 +4364,11 @@ static ivas_error renderIsmToBinauralRoom( int16_t subframe_idx, subframe_len; int16_t tmp; rotation_matrix Rmat; +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; +#else + float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; +#endif IVAS_QUATERNION quat; ivas_error error; pan_vector currentPanGains; @@ -4433,7 +4382,8 @@ static ivas_error renderIsmToBinauralRoom( headRotData = ismInput->base.ctx.pHeadRotData; rotatedPos = defaultObjectPosition(); - if ( ismInput->hReverb != NULL && ismInput->hReverb->pConfig.roomAcoustics.use_brir == 0 && ismInput->hReverb->pConfig.roomAcoustics.late_reverb_on == 1 && headRotData->headRotEnabled ) +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + if ( ismInput->reverb != NULL && ismInput->reverb->pConfig.roomAcoustics.use_brir == 0 && ismInput->reverb->pConfig.roomAcoustics.late_reverb_on == 1 && headRotData->headRotEnabled ) { copyBufferTo2dArray( ismInput->base.inputBuffer, tmpRendBuffer ); @@ -4443,16 +4393,21 @@ static ivas_error renderIsmToBinauralRoom( NULL, ismInput->base.ctx.pHeadRotData, &ismInput->currentPos, - ismInput->hReverb, +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + ismInput->reverb, +#endif outAudio.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) { return error; } +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND accumulate2dArrayToBuffer( tmpRendBuffer, &outAudio ); +#endif } else { +#endif if ( headRotData->headRotEnabled ) { @@ -4524,18 +4479,43 @@ static ivas_error renderIsmToBinauralRoom( renderBufferChannelLerp( ismInput->base.inputBuffer, 0, currentPanGains, previousPanGains, tmpMcBuffer ); +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND copyBufferTo2dArray( tmpMcBuffer, tmpRendBuffer ); +#else + copyBufferTo2dArray( tmpMcBuffer, tmpCrendBuffer ); +#endif + - if ( ( error = ivas_rend_crendProcess( ismInput->crendWrapper, AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM, - NULL, NULL, NULL, NULL, tmpRendBuffer, *ismInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( +#ifdef FIX_197_CREND_INTERFACE + ismInput->crendWrapper, +#else + &ismInput->crendWrapper, +#endif + AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM, +#ifdef FIX_197_CREND_INTERFACE + NULL, NULL, NULL, NULL, +#endif +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + tmpRendBuffer, +#else + tmpCrendBuffer, +#endif + *ismInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND accumulate2dArrayToBuffer( tmpRendBuffer, &outAudio ); +#else + accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); +#endif free( tmpMcBuffer.data ); +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND } +#endif pop_wmops(); return IVAS_ERR_OK; @@ -4614,7 +4594,6 @@ static ivas_error renderIsmToSba( { return error; } - if ( ( error = getAmbisonicsOrder( outConfig, &ambiOrderOut ) ) != IVAS_ERR_OK ) { return error; @@ -4669,6 +4648,7 @@ static ivas_error renderInputIsm( /* Apply input gain to new audio */ v_multc( inAudio.data, ismInput->base.gain, inAudio.data, inAudio.config.numSamplesPerChannel * inAudio.config.numChannels ); + switch ( getAudioConfigType( outConfig ) ) { case IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED: @@ -4792,12 +4772,21 @@ static ivas_error renderMcToBinaural( headRotEnabled = mcInput->base.ctx.pHeadRotData->headRotEnabled; inConfig = mcInput->base.inConfig; - if ( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) || ( headRotEnabled && ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ) ) + if ( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) || + ( headRotEnabled && ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ) ) { copyBufferTo2dArray( mcInput->base.inputBuffer, tmpRendBuffer ); - if ( ( error = ivas_td_binaural_renderer_ext( &mcInput->tdRendWrapper, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, NULL, - mcInput->hReverb, mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_td_binaural_renderer_ext( &mcInput->tdRendWrapper, + mcInput->base.inConfig, + &mcInput->customLsInput, + mcInput->base.ctx.pHeadRotData, + NULL, +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + mcInput->reverb, +#endif + mcInput->base.inputBuffer.config.numSamplesPerChannel, + tmpRendBuffer ) ) != IVAS_ERR_OK ) { return error; } @@ -4811,8 +4800,13 @@ static ivas_error renderMcToBinaural( tmpRotBuffer.data = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); set_zero( tmpRotBuffer.data, tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels ); - if ( ( error = rotateFrameMc( mcInput->base.inputBuffer, mcInput->base.inConfig, mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, - mcInput->rot_gains_prev, mcInput->efapInWrapper.hEfap, tmpRotBuffer ) ) != IVAS_ERR_OK ) + if ( ( error = rotateFrameMc( mcInput->base.inputBuffer, + mcInput->base.inConfig, + mcInput->customLsInput, + mcInput->base.ctx.pHeadRotData, + mcInput->rot_gains_prev, + mcInput->efapInWrapper.hEfap, + tmpRotBuffer ) ) != IVAS_ERR_OK ) { return error; } @@ -4826,8 +4820,16 @@ static ivas_error renderMcToBinaural( } /* call CREND */ - if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( +#ifdef FIX_197_CREND_INTERFACE + mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), + NULL, NULL, NULL, NULL, +#else + &mcInput->crendWrapper, + rendAudioConfigToIvasAudioConfig( mcInput->base.inConfig ), + rendAudioConfigToIvasAudioConfig( outConfig ), +#endif + tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } @@ -4851,60 +4853,106 @@ static ivas_error renderMcToBinauralRoom( const IVAS_REND_AudioConfig outConfig, IVAS_REND_AudioBuffer outAudio ) { +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND int8_t headRotEnabled; float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; IVAS_REND_AudioConfig inConfig; +#else + float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; +#endif ivas_error error; IVAS_REND_AudioBuffer tmpRotBuffer; push_wmops( "renderMcToBinauralRoom" ); +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND headRotEnabled = mcInput->base.ctx.pHeadRotData->headRotEnabled; inConfig = mcInput->base.inConfig; - if ( ( mcInput->hReverb != NULL && mcInput->hReverb->pConfig.roomAcoustics.use_brir == 0 && mcInput->hReverb->pConfig.roomAcoustics.late_reverb_on == 1 ) && ( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) || ( headRotEnabled && ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ) ) ) + if ( ( mcInput->reverb != NULL && mcInput->reverb->pConfig.roomAcoustics.use_brir == 0 && mcInput->reverb->pConfig.roomAcoustics.late_reverb_on == 1 ) && ( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) || ( headRotEnabled && ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ) ) ) { copyBufferTo2dArray( mcInput->base.inputBuffer, tmpRendBuffer ); - if ( ( error = ivas_td_binaural_renderer_ext( &mcInput->tdRendWrapper, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, - NULL, mcInput->hReverb, mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_td_binaural_renderer_ext( &mcInput->tdRendWrapper, + mcInput->base.inConfig, + &mcInput->customLsInput, + mcInput->base.ctx.pHeadRotData, + NULL, + mcInput->reverb, + mcInput->base.inputBuffer.config.numSamplesPerChannel, + tmpRendBuffer ) ) != IVAS_ERR_OK ) { return error; } } else { + /* apply rotation */ if ( headRotEnabled ) +#else + /* apply rotation */ + if ( mcInput->base.ctx.pHeadRotData->headRotEnabled ) +#endif { tmpRotBuffer = mcInput->base.inputBuffer; tmpRotBuffer.data = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); set_zero( tmpRotBuffer.data, tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels ); - if ( ( error = rotateFrameMc( mcInput->base.inputBuffer, mcInput->base.inConfig, mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, - mcInput->rot_gains_prev, mcInput->efapInWrapper.hEfap, tmpRotBuffer ) ) != IVAS_ERR_OK ) + if ( ( error = rotateFrameMc( mcInput->base.inputBuffer, + mcInput->base.inConfig, + mcInput->customLsInput, + mcInput->base.ctx.pHeadRotData, + mcInput->rot_gains_prev, + mcInput->efapInWrapper.hEfap, + tmpRotBuffer ) ) != IVAS_ERR_OK ) { return error; } +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND copyBufferTo2dArray( tmpRotBuffer, tmpRendBuffer ); +#else + copyBufferTo2dArray( tmpRotBuffer, tmpCrendBuffer ); +#endif free( tmpRotBuffer.data ); } else { +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND copyBufferTo2dArray( mcInput->base.inputBuffer, tmpRendBuffer ); +#else + copyBufferTo2dArray( mcInput->base.inputBuffer, tmpCrendBuffer ); +#endif } /* call CREND */ - if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( +#ifdef FIX_197_CREND_INTERFACE + mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), + NULL, NULL, NULL, NULL, +#else + &mcInput->crendWrapper, + rendAudioConfigToIvasAudioConfig( mcInput->base.inConfig ), + rendAudioConfigToIvasAudioConfig( outConfig ), +#endif +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + tmpRendBuffer, +#else + tmpCrendBuffer, +#endif + *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } +#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND } - accumulate2dArrayToBuffer( tmpRendBuffer, &outAudio ); +#else + accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); +#endif + /* TODO tmu : needs delay compensation */ if ( ( error = renderLfeToBinaural( mcInput, outAudio ) ) != IVAS_ERR_OK ) { @@ -4957,7 +5005,7 @@ static ivas_error renderMcCustomLsToBinauralRoom( return error; } - tmpMcBuffer.config.numChannels = tmp; + tmpMcBuffer.config.numChannels = (int16_t) tmp; tmpMcBuffer.data = malloc( tmpMcBuffer.config.numSamplesPerChannel * tmpMcBuffer.config.numChannels * sizeof( float ) ); set_zero( tmpMcBuffer.data, tmpMcBuffer.config.numSamplesPerChannel * tmpMcBuffer.config.numChannels ); @@ -4969,8 +5017,15 @@ static ivas_error renderMcCustomLsToBinauralRoom( copyBufferTo2dArray( tmpMcBuffer, tmpCrendBuffer ); /* call CREND */ - if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, NULL, NULL, NULL, - tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( +#ifdef FIX_197_CREND_INTERFACE + mcInput->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, NULL, NULL, NULL, +#else + &mcInput->crendWrapper, + AUDIO_CONFIG_7_1_4, + rendAudioConfigToIvasAudioConfig( outConfig ), +#endif + tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } @@ -5198,8 +5253,15 @@ static ivas_error renderSbaToBinaural( } /* call CREND */ - if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( sbaInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( +#ifdef FIX_197_CREND_INTERFACE + sbaInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( sbaInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, NULL, NULL, NULL, +#else + &sbaInput->crendWrapper, + rendAudioConfigToIvasAudioConfig( sbaInput->base.inConfig ), + rendAudioConfigToIvasAudioConfig( outConfig ), +#endif + tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } @@ -5254,7 +5316,7 @@ static ivas_error renderSbaToBinauralRoom( return error; } - tmpMcBuffer.config.numChannels = tmp; + tmpMcBuffer.config.numChannels = (int16_t) tmp; tmpMcBuffer.data = malloc( tmpMcBuffer.config.numSamplesPerChannel * tmpMcBuffer.config.numChannels * sizeof( float ) ); set_zero( tmpMcBuffer.data, tmpMcBuffer.config.numChannels * tmpMcBuffer.config.numSamplesPerChannel ); @@ -5267,8 +5329,16 @@ static ivas_error renderSbaToBinauralRoom( copyBufferTo2dArray( tmpMcBuffer, tmpCrendBuffer ); /* call CREND */ - if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( +#ifdef FIX_197_CREND_INTERFACE + sbaInput->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), + NULL, NULL, NULL, NULL, +#else + &sbaInput->crendWrapper, + AUDIO_CONFIG_7_1_4, + rendAudioConfigToIvasAudioConfig( outConfig ), +#endif + tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } @@ -5516,7 +5586,7 @@ static ivas_error renderActiveInputsMasa( IVAS_REND_HANDLE hIvasRend, IVAS_REND_AudioBuffer outAudio ) { - int16_t i; + int32_t i; input_masa *pCurrentInput; ivas_error error; @@ -5552,7 +5622,10 @@ ivas_error IVAS_REND_GetSamples( ivas_error error; int16_t numOutChannels; - /* Validate function arguments */ + /*-----------------------------------------------------------------* + * Validate function arguments + *-----------------------------------------------------------------*/ + if ( hIvasRend == NULL || outAudio.data == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -5630,7 +5703,10 @@ void IVAS_REND_Close( uint16_t i; IVAS_REND_HANDLE hIvasRend; - /* Validate function arguments */ + /*-----------------------------------------------------------------* + * Validate function arguments + *-----------------------------------------------------------------*/ + if ( phIvasRend == NULL || *phIvasRend == NULL ) { return; @@ -5665,10 +5741,6 @@ void IVAS_REND_Close( ivas_limiter_close( &hIvasRend->hLimiter ); -#ifdef FIX_I109_ORIENTATION_TRACKING - closeHeadRotation( hIvasRend ); -#endif - free( hIvasRend ); *phIvasRend = NULL; diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index b313bea5c1..6db5fd91dc 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -244,43 +244,8 @@ int16_t IVAS_REND_FeedRenderConfig( ivas_error IVAS_REND_SetHeadRotation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ -#ifdef TD5 - const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME], /* i : head orientations for next rendering call */ - const IVAS_POSITION Pos[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : listener positions for next rendering call */ -#else const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : head positions for next rendering call */ -#endif -); - -#ifdef FIX_I109_ORIENTATION_TRACKING -ivas_error IVAS_REND_SetOrientationTrackingMode( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const uint8_t otrMode /* i : Orientation tracking mode */ -); - -ivas_error IVAS_REND_SetReferenceRotation( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const IVAS_QUATERNION refRot /* i : Reference rotation */ -); - -ivas_error IVAS_REND_GetMainOrientation( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer for main orientation */ -); - -ivas_error IVAS_REND_GetTrackedRotation( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - IVAS_QUATERNION *pRotation /* i/o: Quaternion pointer for processed rotation */ -); - -#ifdef OTR_REFERENCE_VECTOR_TRACKING -ivas_error IVAS_REND_SetReferenceVector( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const IVAS_VECTOR3 listenerPos, /* i : Listener position */ - const IVAS_VECTOR3 refPos /* i : Reference position */ ); -#endif /* OTR_REFERENCE_VECTOR_TRACKING */ -#endif /* FIX_I109_ORIENTATION_TRACKING */ ivas_error IVAS_REND_GetSamples( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ diff --git a/lib_util/audio_file_reader.c b/lib_util/audio_file_reader.c index 4f6bd0c34d..c7feefd7b7 100644 --- a/lib_util/audio_file_reader.c +++ b/lib_util/audio_file_reader.c @@ -40,7 +40,9 @@ struct AudioFileReader { FILE *rawFile; WAVEFILEIN *wavFile; +#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS uint32_t samplingRate; +#endif int16_t numChannels; }; @@ -55,12 +57,26 @@ static int8_t AudioFileReader_open_raw( static int8_t AudioFileReader_open_wav( AudioFileReader *self, - const char *fileName ) + const char *fileName +#ifndef FIX_94_VERIFY_WAV_NUM_CHANNELS + , + int32_t *sampleRate +#endif +) { +#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS uint32_t samplesInFile; +#else + uint32_t sampleRate_, samplesInFile; +#endif int16_t bps; +#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS self->wavFile = OpenWav( fileName, &self->samplingRate, &self->numChannels, &samplesInFile, &bps ); +#else + self->wavFile = OpenWav( fileName, &sampleRate_, &self->numChannels, &samplesInFile, &bps ); + *sampleRate = sampleRate_; +#endif if ( !self->wavFile ) { @@ -76,6 +92,10 @@ static int8_t AudioFileReader_open_wav( ivas_error AudioFileReader_open( AudioFileReader **audioReader, /* o : AudioFileReader handle */ const char *fileName /* i : path to wav/raw pcm file */ +#ifndef FIX_94_VERIFY_WAV_NUM_CHANNELS + , + int32_t *sampleRate /* o : sample rate of wav file, unused with pcm */ +#endif ) { AudioFileReader *self; @@ -98,12 +118,19 @@ ivas_error AudioFileReader_open( return IVAS_ERR_FAILED_FILE_OPEN; } self = calloc( sizeof( AudioFileReader ), 1 ); +#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS self->samplingRate = 0; +#endif self->numChannels = 0; if ( fileNameLen > wavSuffixLen && strncmp( fileName + fileNameLen - wavSuffixLen, wavSuffix, wavSuffixLen ) == 0 ) { - retCode = AudioFileReader_open_wav( self, fileName ); + retCode = AudioFileReader_open_wav( self, fileName +#ifndef FIX_94_VERIFY_WAV_NUM_CHANNELS + , + sampleRate +#endif + ); } else { @@ -179,6 +206,7 @@ ivas_error AudioFileReader_read( return error; } +#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS ivas_error AudioFileReader_getSamplingRate( AudioFileReader *self, int32_t *samplingRate ) @@ -229,3 +257,17 @@ ivas_error AudioFileReader_getNumChannels( return IVAS_ERR_OK; } +#else +/*! r: number of channels of the opened file */ +int16_t AudioFileReader_getNumChannels( + AudioFileReader *self /* i/o: AudioFileReader handle */ +) +{ + if ( self != NULL ) + { + return self->numChannels; + } + + return 0; +} +#endif diff --git a/lib_util/audio_file_reader.h b/lib_util/audio_file_reader.h index 0fd4da5ac7..a944c85dc1 100644 --- a/lib_util/audio_file_reader.h +++ b/lib_util/audio_file_reader.h @@ -43,6 +43,9 @@ typedef struct AudioFileReader AudioFileReader; ivas_error AudioFileReader_open( AudioFileReader **audioReader, /* o : AudioFileReader handle */ const char *fileName /* i : path to wav/raw pcm file */ +#ifndef FIX_94_VERIFY_WAV_NUM_CHANNELS + ,int32_t *sampleRate /* o : sample rate of wav file, unused with pcm */ +#endif ); ivas_error AudioFileReader_read( @@ -52,6 +55,7 @@ ivas_error AudioFileReader_read( int16_t *numSamplesRead /* i : number of samples actualy read */ ); +#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS /*! r: ivas error - in particular, IVAS_ERR_SAMPLING_RATE_UNKNOWN if the opened file has no sampling rate metadata */ ivas_error AudioFileReader_getSamplingRate( AudioFileReader *self, /* i/o: AudioFileReader handle */ @@ -63,6 +67,12 @@ ivas_error AudioFileReader_getNumChannels( AudioFileReader *self, /* i/o: AudioFileReader handle */ int16_t * numChannels /* o : number fo channels in opened audio file */ ); +#else +/*! r: number of channels of the opened file */ +int16_t AudioFileReader_getNumChannels( + AudioFileReader *self /* i/o: AudioFileReader handle */ +); +#endif void AudioFileReader_close( AudioFileReader **selfPtr /* i/o: pointer to AudioFileReader handle */ diff --git a/lib_util/audio_file_writer.c b/lib_util/audio_file_writer.c index b27a8ceca6..d6cbb1810e 100644 --- a/lib_util/audio_file_writer.c +++ b/lib_util/audio_file_writer.c @@ -98,11 +98,7 @@ ivas_error AudioFileWriter_open( int8_t retCode; -#ifdef FIX_I109_ORIENTATION_TRACKING - if ( ( fileNameLen > wavSuffixLen ) && ( strncmp( fileName + fileNameLen - wavSuffixLen, wavSuffix, wavSuffixLen ) == 0 ) ) -#else if ( fileNameLen > wavSuffixLen && strncmp( fileName + fileNameLen - wavSuffixLen, wavSuffix, wavSuffixLen ) == 0 ) -#endif { retCode = AudioFileWriter_open_wav( self, fileName, sampleRate, numChannels ); } diff --git a/lib_util/head_rotation_file_reader.c b/lib_util/head_rotation_file_reader.c index 500fdd2b7a..533c14a651 100644 --- a/lib_util/head_rotation_file_reader.c +++ b/lib_util/head_rotation_file_reader.c @@ -91,125 +91,39 @@ ivas_error HeadRotationFileReader_open( * Read values from the trajectory file *-----------------------------------------------------------------------*/ -#ifdef FIX_I109_ORIENTATION_TRACKING ivas_error HeadRotationFileReading( HeadRotFileReader *headRotReader, /* i/o: HeadRotFileReader handle */ -#ifdef TD5 - IVAS_QUATERNION *pQuaternion, /* o : head-tracking data */ - IVAS_POSITION *pPos /* o : listener position */ -#else - IVAS_QUATERNION *pQuaternion /* o : head-tracking data */ -#endif -) -{ - float w, x, y, z; -#ifdef TD5 - float posx, posy, posz; - int32_t read_values; - - posx = 0.0f; - posy = 0.0f; - posz = 0.0f; -#endif - -#ifdef TD5 - read_values = fscanf( headRotReader->trajFile, "%f,%f,%f,%f,%f,%f,%f", &w, &x, &y, &z, &posx, &posy, &posz ); - if ( ( read_values != 4 ) && ( read_values != 7 ) ) /* Allow either orientation (4) or orientation+position (4+3) */ -#else - if ( 4 != fscanf( headRotReader->trajFile, "%f,%f,%f,%f", &w, &x, &y, &z ) ) -#endif - { - if ( feof( headRotReader->trajFile ) ) - { - rewind( headRotReader->trajFile ); - headRotReader->fileRewind = true; -#ifdef TD5 - return HeadRotationFileReading( headRotReader, pQuaternion, pPos ); -#else - return HeadRotationFileReading( headRotReader, pQuaternion ); -#endif - } - return IVAS_ERR_FAILED_FILE_PARSE; - } - - ( headRotReader->frameCounter )++; - - pQuaternion->w = w; - pQuaternion->x = x; - pQuaternion->y = y; - pQuaternion->z = z; -#ifdef TD5 - if ( pPos != NULL ) - { - pPos->x = posx; - pPos->y = posy; - pPos->z = posz; - } -#endif - - return IVAS_ERR_OK; -} - -#else -ivas_error HeadRotationFileReading( - HeadRotFileReader *headRotReader, /* i/o: HeadRotFileReader handle */ - IVAS_QUATERNION *Quaternions, /* o : head-tracking data, listener orientation */ -#ifdef TD5 - IVAS_POSITION *Pos /* o : listener position */ -#else - const int32_t frame_dec /* i : decoded frame number */ -#endif + IVAS_QUATERNION *Quaternions, /* o : head-tracking data */ + const int32_t frame_dec /* i : decoded frame number */ ) { uint16_t i; float w, x, y, z; -#ifdef TD5 - float posx, posy, posz; - int32_t read_values; - - posx = 0.0f; - posy = 0.0f; - posz = 0.0f; -#endif for ( i = 0; i < IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { -#ifdef TD5 - read_values = fscanf( headRotReader->trajFile, "%f,%f,%f,%f,%f,%f,%f", &w, &x, &y, &z, &posx, &posy, &posz ); - if ( ( read_values != 4 ) && ( read_values != 7 ) ) /* Allow either orientation (4) or orientation+position (4+3) */ -#else if ( 4 != fscanf( headRotReader->trajFile, "%f,%f,%f,%f", &w, &x, &y, &z ) ) -#endif { if ( feof( headRotReader->trajFile ) ) { rewind( headRotReader->trajFile ); headRotReader->fileRewind = true; -#ifdef TD5 - return HeadRotationFileReading( headRotReader, Quaternions, Pos ); -#else return HeadRotationFileReading( headRotReader, Quaternions, frame_dec ); -#endif } return IVAS_ERR_FAILED_FILE_PARSE; } + ( headRotReader->frameCounter )++; Quaternions[i].w = w; Quaternions[i].x = x; Quaternions[i].y = y; Quaternions[i].z = z; -#ifdef TD5 - Pos[i].x = posx; - Pos[i].y = posy; - Pos[i].z = posz; -#endif } return IVAS_ERR_OK; } -#endif /*-----------------------------------------------------------------------* diff --git a/lib_util/head_rotation_file_reader.h b/lib_util/head_rotation_file_reader.h index d735423e2c..e70281401a 100644 --- a/lib_util/head_rotation_file_reader.h +++ b/lib_util/head_rotation_file_reader.h @@ -57,27 +57,11 @@ ivas_error HeadRotationFileReader_open( * Read values from the trajectory file *-----------------------------------------------------------------------*/ -#ifdef FIX_I109_ORIENTATION_TRACKING -ivas_error HeadRotationFileReading( - HeadRotFileReader *headRotReader, /* i/o: HeadRotFileReader handle */ -#ifdef TD5 - IVAS_QUATERNION *pQuaternion, /* o : head-tracking data */ - IVAS_POSITION *pPos /* o : listener position */ -#else - IVAS_QUATERNION *pQuaternion /* o : head-tracking data */ -#endif -); -#else ivas_error HeadRotationFileReading( HeadRotFileReader *headRotReader, /* i/o: HeadRotFileReader handle */ IVAS_QUATERNION *Quaternions, /* o : head-tracking data */ -#ifdef TD5 - IVAS_POSITION *Pos /* o : listener position */ -#else - const int32_t frame_dec /* i : decoded frame number */ -#endif + const int32_t frame_dec /* i : decoded frame number */ ); -#endif /*-----------------------------------------------------------------------* * HeadRotationFileReader_close() diff --git a/lib_util/ism_file_reader.c b/lib_util/ism_file_reader.c index d60a7c1984..77912f5c58 100644 --- a/lib_util/ism_file_reader.c +++ b/lib_util/ism_file_reader.c @@ -36,13 +36,8 @@ #include -#define META_LINE_LENGTH 200 /* max number of characters at one line of metadata input/output file */ -#ifdef TD5 -#define NUM_ISM_METADATA_PER_LINE 7 /* Number of ISM metadata per line in a metadata file */ -#define NUM_MIN_ISM_METADATA 2 /* Minimum number of metadata parameters (azimuth and elevation) */ -#else -#define NUM_ISM_METADATA_PER_LINE 5 /* Number of ISM metadata per line in a metadata file */ -#endif +#define META_LINE_LENGTH 200 /* max number of characters at one line of metadata input/output file */ +#define NUM_ISM_METADATA_PER_LINE 5 /* Number of ISM metadata per line in a metadata file */ struct IsmFileReader @@ -59,7 +54,7 @@ struct IsmFileReader *---------------------------------------------------------------------*/ IsmFileReader *IsmFileReader_open( - const char *filePath /* i : path to ISM metadata file */ + const char *filePath /* i : path to ism metadata file */ ) { IsmFileReader *self; @@ -95,26 +90,15 @@ IsmFileReader *IsmFileReader_open( /*! r: error code */ ivas_error IsmFileReader_readNextFrame( IsmFileReader *self, /* i/o: IsmFileReader handle */ - IVAS_ISM_METADATA *ismMetadata /* o : ISM metadata read from the opened file */ + IVAS_ISM_METADATA *ismMetadata /* o ISM : metadata read from the opened file */ ) { char char_buff[META_LINE_LENGTH]; float meta_prm[NUM_ISM_METADATA_PER_LINE]; -#ifdef TD5 - const float meta_prm_default[NUM_ISM_METADATA_PER_LINE] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f }; -#endif char *char_ptr; int16_t i; FILE *file; -#ifdef TD5 - /* Set default metadata parameters */ - for ( i = 0; i < NUM_ISM_METADATA_PER_LINE; i++ ) - { - meta_prm[i] = meta_prm_default[i]; - } -#endif - if ( ismMetadata == NULL || self->file == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -143,34 +127,24 @@ ivas_error IsmFileReader_readNextFrame( meta_prm[i++] = (float) atof( char_ptr ); } -#ifdef TD5 - /* Check if minimum number of metadata values were read. Additional values are ignored. */ - if ( i < NUM_MIN_ISM_METADATA ) -#else + if ( i != NUM_ISM_METADATA_PER_LINE ) -#endif { /* Not enough values provided in one line */ return IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT; } -#ifndef TD5 if ( char_ptr != NULL ) { /* Too many values provided in one line */ return IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT; } -#endif ismMetadata->azimuth = meta_prm[0]; ismMetadata->elevation = meta_prm[1]; ismMetadata->radius = meta_prm[2]; ismMetadata->spread = meta_prm[3]; ismMetadata->gainFactor = meta_prm[4]; -#ifdef TD5 - ismMetadata->yaw = meta_prm[5]; - ismMetadata->pitch = meta_prm[6]; -#endif /* verify whether the read metadata values are in an expected range */ if ( ismMetadata->azimuth > 180 || ismMetadata->azimuth < -180 ) @@ -197,17 +171,6 @@ ivas_error IsmFileReader_readNextFrame( { return IVAS_ERR_ISM_INVALID_METADATA_VALUE; } -#ifdef TD5 - if ( ismMetadata->yaw > 180 || ismMetadata->yaw < -180 ) - { - return IVAS_ERR_ISM_INVALID_METADATA_VALUE; - } - - if ( ismMetadata->pitch > 90 || ismMetadata->pitch < -90 ) - { - return IVAS_ERR_ISM_INVALID_METADATA_VALUE; - } -#endif return IVAS_ERR_OK; } diff --git a/lib_util/ism_file_writer.c b/lib_util/ism_file_writer.c index 870cf33586..c4dffe38b0 100644 --- a/lib_util/ism_file_writer.c +++ b/lib_util/ism_file_writer.c @@ -35,10 +35,8 @@ #include -#define META_LINE_LENGTH 200 /* max number of characters at one line of metadata input/output file */ -#ifndef TD5 -#define NUM_ISM_METADATA_PER_LINE 5 /* Number of ISM metadata per line in a metadata file */ -#endif +#define META_LINE_LENGTH 200 /* max number of characters at one line of metadata input/output file */ +#define NUM_ISM_METADATA_PER_LINE 5 /* Number of ISM metadata per line in a metadata file */ struct IsmFileWriter @@ -56,7 +54,7 @@ struct IsmFileWriter /*! r: error code */ ivas_error IsmFileWriter_open( const char *filePathWav, /* i : path to output file */ - const int16_t obj_num, /* i : number of ISM channels */ + const int16_t obj_num, /* i : ISm number */ IsmFileWriter **ismWriter /* o : IsmFileWriter handle */ ) { @@ -117,18 +115,7 @@ ivas_error IsmFileWriter_writeFrame( file = ismWriter->file; /* IVAS_fmToDo: work in progress; currently position_azimuth, position_elevation, position_radius, spread, gain_factor */ -#ifdef FIX_293_EXT_RENDERER_CLI -#ifdef TD5 - sprintf( char_buff, "%+07.2f,%+06.2f,%05.2f,%06.2f,%04.2f,%+07.2f,%+06.2f\n", ismMetadata.azimuth, ismMetadata.elevation, ismMetadata.radius, ismMetadata.spread, ismMetadata.gainFactor, ismMetadata.yaw, ismMetadata.pitch ); -#else - sprintf( char_buff, "%+07.2f,%+06.2f,%05.2f,%06.2f,%04.2f\n", ismMetadata.azimuth, ismMetadata.elevation, ismMetadata.radius, ismMetadata.spread, ismMetadata.gainFactor ); -#endif -#endif -#ifdef TD5 - snprintf( char_buff, sizeof( char_buff ), "%+07.2f,%+06.2f,%05.2f,%06.2f,%04.2f,%+07.2f,%+06.2f\n", ismMetadata.azimuth, ismMetadata.elevation, ismMetadata.radius, ismMetadata.spread, ismMetadata.gainFactor, ismMetadata.yaw, ismMetadata.pitch ); -#else snprintf( char_buff, sizeof( char_buff ), "%+07.2f,%+06.2f,%05.2f,%06.2f,%04.2f\n", ismMetadata.azimuth, ismMetadata.elevation, ismMetadata.radius, ismMetadata.spread, ismMetadata.gainFactor ); -#endif if ( file ) { diff --git a/lib_util/ism_file_writer.h b/lib_util/ism_file_writer.h index d9f731e87e..24b4c58bd4 100644 --- a/lib_util/ism_file_writer.h +++ b/lib_util/ism_file_writer.h @@ -43,7 +43,7 @@ typedef struct IsmFileWriter IsmFileWriter; /*! r: error code */ ivas_error IsmFileWriter_open( const char *filePathWav, /* i : path to output file */ - const int16_t obj_num, /* i : number of ISM channels */ + const int16_t obj_num, /* i : ISm number */ IsmFileWriter **ismWriter /* o : IsmFileReader handle */ ); diff --git a/lib_util/ls_custom_file_reader.c b/lib_util/ls_custom_file_reader.c index 9b39fab486..f73022e849 100644 --- a/lib_util/ls_custom_file_reader.c +++ b/lib_util/ls_custom_file_reader.c @@ -52,7 +52,7 @@ struct LsCustomFileReader ivas_error CustomLsReader_open( const char *LsFilePath, /* i : LS custom layout file name */ - LsCustomFileReader **hLsCustomReader /* o : LsCustomFileReader handle */ + LsCustomFileReader **hLsCustomReader /* o : HeadRotFileReader handle */ ) { LsCustomFileReader *self; @@ -89,7 +89,7 @@ ivas_error CustomLsReader_open( *-----------------------------------------------------------------------*/ void CustomLsReader_close( - LsCustomFileReader **hLsCustomReader /* i/o: LsCustomFileReader handle */ + LsCustomFileReader **hLsCustomReader /* i/o: HeadRotFileReader handle */ ) { if ( hLsCustomReader == NULL || *hLsCustomReader == NULL ) @@ -228,7 +228,7 @@ static void CustomLoudspeakerLayout_print_info( *-------------------------------------------------------------------------*/ LS_CUSTOM_FILEREADER_ERROR CustomLsFileReading( - LsCustomFileReader *hLsCustomReader, /* i/o: LsCustomFileReader handle */ + LsCustomFileReader *hLsCustomReader, /* i/o: HeadRotFileReader handle */ IVAS_CUSTOM_LS_DATA *hLsCustomData /* o : Custom loudspeaker setup data */ ) { diff --git a/lib_util/ls_custom_file_reader.h b/lib_util/ls_custom_file_reader.h index df7fe6bde7..70c854aa9c 100644 --- a/lib_util/ls_custom_file_reader.h +++ b/lib_util/ls_custom_file_reader.h @@ -64,7 +64,7 @@ typedef enum _LS_CUSTOM_FILEREADER_ERROR ivas_error CustomLsReader_open( const char *LsFilePath, /* i : LS custom layout file name */ - LsCustomFileReader **hLsCustomReader /* o : LsCustomFileReader handle */ + LsCustomFileReader **hLsCustomReader /* o : HeadRotFileReader handle */ ); /*-----------------------------------------------------------------------* @@ -74,7 +74,7 @@ ivas_error CustomLsReader_open( *-----------------------------------------------------------------------*/ void CustomLsReader_close( - LsCustomFileReader **hLsCustomReader /* i/o: LsCustomFileReader handle */ + LsCustomFileReader **hLsCustomReader /* i/o: HeadRotFileReader handle */ ); /*-------------------------------------------------------------------------* @@ -84,7 +84,7 @@ void CustomLsReader_close( *-------------------------------------------------------------------------*/ LS_CUSTOM_FILEREADER_ERROR CustomLsFileReading( - LsCustomFileReader *hLsCustomReader, /* i/o: LsCustomFileReader handle */ + LsCustomFileReader *hLsCustomReader, /* i/o: HeadRotFileReader handle */ IVAS_CUSTOM_LS_DATA *hLsCustomData /* o : Custom loudspeaker setup data */ ); diff --git a/lib_util/masa_file_writer.c b/lib_util/masa_file_writer.c index 74429f9185..5667968ece 100644 --- a/lib_util/masa_file_writer.c +++ b/lib_util/masa_file_writer.c @@ -67,10 +67,8 @@ struct MasaFileWriter *-----------------------------------------------------------------------*/ #ifndef FIX_350_MASA_DELAY_COMP -#ifndef FIX_373_MASA_DELAY_COMP_MSAN #define SPH_IDX_FRONT ( MASA_NO_POINTS_EQUATOR / 2 ) /* Spherical index corresponding to front direction for setting as default value */ #endif -#endif /*-----------------------------------------------------------------------* * Local functions diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 907d148a6e..9fe7f019eb 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -522,15 +522,6 @@ ivas_error RenderConfigReader_read( errorHandler( pValue, ERROR_VALUE_INVALID ); } } -#ifdef TD5 - else if ( strcmp( item, "DIRECTIVITY" ) == 0 ) - { - if ( read_vector( pValue, 3, hRenderConfig->directivity ) ) - { - errorHandler( item, ERROR_VALUE_INVALID ); - } - } -#endif #ifdef DEBUGGING else { diff --git a/lib_util/vector3_pair_file_reader.c b/lib_util/vector3_pair_file_reader.c deleted file mode 100644 index 1b8a95bc88..0000000000 --- a/lib_util/vector3_pair_file_reader.c +++ /dev/null @@ -1,166 +0,0 @@ -/****************************************************************************************************** - - (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. - -*******************************************************************************************************/ - -#include "vector3_pair_file_reader.h" -#include -#include -#include -#include -#include "prot.h" -#include "options.h" /* only included to get access to the feature-defines */ - -#ifdef OTR_REFERENCE_VECTOR_TRACKING - -struct Vector3PairFileReader -{ - FILE *trajFile; - char *file_path; -}; - -/*-----------------------------------------------------------------------* - * Vector3PairFileReader_open() - * - * Allocate and initialize reader - *-----------------------------------------------------------------------*/ - -ivas_error Vector3PairFileReader_open( - const char *trajFilePath, /* i : trajectory file name */ - Vector3PairFileReader **vector3PairReader /* o : Vector3PairFileReader handle */ -) -{ - Vector3PairFileReader *self; - FILE *trajFile; - - /* Open trajectory file */ - if ( strlen( trajFilePath ) < 1 ) - { - return IVAS_ERR_FAILED_FILE_OPEN; - } - - trajFile = fopen( trajFilePath, "r" ); - - if ( !trajFile ) - { - return IVAS_ERR_FAILED_FILE_OPEN; - } - - self = calloc( sizeof( Vector3PairFileReader ), 1 ); - self->trajFile = trajFile; - self->file_path = calloc( sizeof( char ), strlen( trajFilePath ) + 1 ); - strcpy( self->file_path, trajFilePath ); - - *vector3PairReader = self; - - return IVAS_ERR_OK; -} - - -/*-----------------------------------------------------------------------* - * Vector3PairFileReader_read() - * - * Read one line of values from the trajectory file - *-----------------------------------------------------------------------*/ - -ivas_error Vector3PairFileReader_read( - Vector3PairFileReader *vector3PairReader, /* i/o: Vector3PairFileReader handle */ - IVAS_VECTOR3 *pFirst, /* o : first x,y,z position in the line */ - IVAS_VECTOR3 *pSecond /* o : second x,y,z position in the line */ -) -{ - float x1, y1, z1, x2, y2, z2; - - if ( vector3PairReader == NULL || pFirst == NULL || pSecond == NULL ) - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - - if ( 6 != fscanf( vector3PairReader->trajFile, "%f,%f,%f,%f,%f,%f", &x1, &y1, &z1, &x2, &y2, &z2 ) ) - { - if ( feof( vector3PairReader->trajFile ) ) - { - rewind( vector3PairReader->trajFile ); - return Vector3PairFileReader_read( vector3PairReader, pFirst, pSecond ); - } - return IVAS_ERR_FAILED_FILE_PARSE; - } - - pFirst->x = x1; - pFirst->y = y1; - pFirst->z = z1; - pSecond->x = x2; - pSecond->y = y2; - pSecond->z = z2; - - return IVAS_ERR_OK; -} - -/*-----------------------------------------------------------------------* - * Vector3PairFileReader_close() - * - * Deallocates memory for the Head-Tracking reader - *-----------------------------------------------------------------------*/ - -void Vector3PairFileReader_close( - Vector3PairFileReader **reader /* i/o: Vector3PairFileReader handle */ -) -{ - if ( reader == NULL || *reader == NULL ) - { - return; - } - - fclose( ( *reader )->trajFile ); - free( ( *reader )->file_path ); - free( *reader ); - *reader = NULL; - - return; -} - - -/*-----------------------------------------------------------------------* - * Vector3PairFileReader_getFilePath() - * - * - *-----------------------------------------------------------------------*/ - -const char *Vector3PairFileReader_getFilePath( - Vector3PairFileReader *reader /* i/o: Vector3PairFileReader handle */ -) -{ - if ( reader == NULL ) - { - return NULL; - } - - return reader->file_path; -} - -#endif /* OTR_REFERENCE_VECTOR_TRACKING */ diff --git a/lib_util/vector3_pair_file_reader.h b/lib_util/vector3_pair_file_reader.h deleted file mode 100644 index a2fd706fc2..0000000000 --- a/lib_util/vector3_pair_file_reader.h +++ /dev/null @@ -1,89 +0,0 @@ -/****************************************************************************************************** - - (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. - -*******************************************************************************************************/ - -#ifndef IVAS_V3PAIR_FILE_READER_H -#define IVAS_V3PAIR_FILE_READER_H - -#include "common_api_types.h" -#include "ivas_error.h" -#include "options.h" /* only included to get access to the feature-defines */ - -#ifdef OTR_REFERENCE_VECTOR_TRACKING - -typedef struct Vector3PairFileReader Vector3PairFileReader; - -/*-----------------------------------------------------------------------* - * Vector3PairFileReader_open() - * - * Allocate and initialize Head-Tracking handle - *-----------------------------------------------------------------------*/ - -ivas_error Vector3PairFileReader_open( - const char *trajFilePath, /* i : trajectory file name */ - Vector3PairFileReader **vector3PairReader /* o : Vector3PairFileReader handle */ -); - -/*-----------------------------------------------------------------------* - * Vector3PairFileReader_read() - * - * Read one line of values from the trajectory file - *-----------------------------------------------------------------------*/ - -ivas_error Vector3PairFileReader_read( - Vector3PairFileReader *vector3PairReader, /* i/o: Vector3PairFileReader handle */ - IVAS_VECTOR3 *pFirst, /* o : first x,y,z position in the line */ - IVAS_VECTOR3 *pSecond /* o : second x,y,z position in the line */ -); - -/*-----------------------------------------------------------------------* - * Vector3PairFileReader_close() - * - * Deallocates memory for the handle - *-----------------------------------------------------------------------*/ - -void Vector3PairFileReader_close( - Vector3PairFileReader **vector3PairReader /* i/o: Vector3PairFileReader handle */ -); - -/*-----------------------------------------------------------------------* - * Vector3PairFileReader_getFilePath() - * - * - *-----------------------------------------------------------------------*/ - -const char *Vector3PairFileReader_getFilePath( - Vector3PairFileReader *vector3PairReader /* i/o: Vector3PairFileReader handle */ -); - -#endif /* OTR_REFERENCE_VECTOR_TRACKING */ - -#endif /* IVAS_V3PAIR_FILE_READER_H */ diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index f26fba423a..223ac0352c 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -161,19 +161,19 @@ ../IVAS_dec STEREO 48 bit testv/stvST48c.wav_stereo_32000_48-48_bandwidth_sw.tst // stereo at 32 kbps, 48kHz in, 32kHz out, random FEC at 6% -../IVAS_cod -stereo 32000 48 testv/stvST48c.wav bit +../IVAS_cod -stereo -max_band FB 32000 48 testv/stvST48c.wav bit ../IVAS_dec -fec testv/FEC_6pct.bin STEREO 32 bit testv/stvST48c.wav_stereo_32000_48-32_FEC5.tst // stereo at 32 kbps, 48kHz in, 48kHz out, DTX on, random FEC at 5% -../IVAS_cod -stereo -dtx 32000 48 testv/stvST48n.wav bit +../IVAS_cod -stereo -dtx -max_band FB 32000 48 testv/stvST48n.wav bit ../IVAS_dec -fec 5 STEREO 48 bit testv/stvST48n.wav_stereo_32000_48-48_DTX_FEC5.tst // stereo at 32 kbps, 48kHz in, 48kHz out, DTX on, MONO out, random FEC at 5% -../IVAS_cod -stereo -dtx 32000 48 testv/stvST48n.wav bit +../IVAS_cod -stereo -dtx -max_band FB 32000 48 testv/stvST48n.wav bit ../IVAS_dec -fec 5 MONO 48 bit testv/stvST48n.wav_stereo_32000_48-48_DTX_MONO_FEC5.tst // stereo at 32 kbps, 48kHz in, 16kHz out, DTX on, MONO out, random FEC at 5% -../IVAS_cod -stereo -dtx 32000 48 testv/stvST48n.wav bit +../IVAS_cod -stereo -dtx -max_band FB 32000 48 testv/stvST48n.wav bit ../IVAS_dec -fec 5 MONO 16 bit testv/stvST48n.wav_stereo_32000_48-16_DTX_MONO_FEC5.tst // stereo at 48 kbps, 16kHz in, 16kHz out @@ -250,175 +250,153 @@ -// 1 ISM with metadata at 13.2 kbps, 48 kHz in, 48 kHz out, MONO out +// 1 ISm with metadata at 13.2 kbps, 48 kHz in, 48 kHz out, MONO out ../IVAS_cod -ism 1 testv/stvISM1.csv 13200 48 testv/stv1ISM48s.wav bit ../IVAS_dec MONO 48 bit testv/stv1ISM48s.wav_13200_48-48_MONO.tst -// 1 ISM with metadata at 13.2 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL out, random FEC at 5% +// 1 ISm with metadata at 13.2 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL out, random FEC at 5% ../IVAS_cod -dtx -ism 1 testv/stvISM1.csv 13200 48 testv/stv48n.wav bit ../IVAS_dec -fec 5 BINAURAL 48 bit testv/stv48n.wav_13200_48-48_DTX_FEC5_BINAURAL.tst -// 2 ISM with metadata at 16.4 kbps, 48 kHz in, 48 kHz out, STEREO out +// 2 ISm with metadata at 16.4 kbps, 48 kHz in, 48 kHz out, STEREO out ../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 16400 48 testv/stv2ISM48s.wav bit ../IVAS_dec STEREO 48 bit testv/stv2ISM48s.wav_16400_48-48_STEREO.tst -// 2 ISM with metadata at 16.4 kbps, 48 kHz in, 48 kHz out, BINAURAL out -../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 16400 48 testv/stv2ISM48s.wav bit -../IVAS_dec BINAURAL 48 bit testv/stv2ISM48s.wav_16400_48-48_binaural.tst - -// 1 ISM with metadata at 16.4 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out -../IVAS_cod -ism 1 testv/stvISM1.csv 16400 48 testv/stv1ISM48s.wav bit -../IVAS_dec BINAURAL_ROOM 48 bit testv/stv1ISM48s.wav_16400_48-48_binaural_room.tst - -// 3 ISM with metadata at 24.4 kbps, 48 kHz in, 48 kHz out, 7_1 out +// 3 ISm with metadata at 24.4 kbps, 48 kHz in, 48 kHz out, 7_1 out ../IVAS_cod -ism 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 24400 48 testv/stv3ISM48s.wav bit ../IVAS_dec 7_1 48 bit testv/stv3ISM48s.wav_24400_48-48_7_1.tst -// 3 ISM with metadata at 24.4 kbps, 48 kHz in, 48 kHz out, MONO out, random FEC at 5% +// 3 ISm with metadata at 24.4 kbps, 48 kHz in, 48 kHz out, MONO out, random FEC at 5% ../IVAS_cod -ism 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 24400 48 testv/stv3ISM48s.wav bit ../IVAS_dec -fec 5 MONO 48 bit testv/stv3ISM48s.wav_24400_48-48_MONO_FEC5.tst -// 3 ISM with metadata at 24.4 kbps, 48 kHz in, 48 kHz out, BINAURAL out -../IVAS_cod -ism 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 24400 48 testv/stv3ISM48s.wav bit -../IVAS_dec BINAURAL 48 bit testv/stv3ISM48s.wav_24400_48-48_binaural.tst - -// 1 ISM with metadata at 32 kbps, 32 kHz in, 32 kHz out, DTX on, MONO out +// 1 ISm with metadata at 32 kbps, 32 kHz in, 32 kHz out, DTX on, MONO out ../IVAS_cod -dtx -ism 1 testv/stvISM1.csv 32000 32 testv/stv32n.wav bit ../IVAS_dec MONO 32 bit testv/stv32n.wav_32000_32-32_DTX_MONO.tst -// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, FOA out +// 4 ISm with metadata at 32 kbps, 48 kHz in, 48 kHz out, FOA out ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48s.wav bit ../IVAS_dec FOA 48 bit testv/stv4ISM48s.wav_32000_48-48_FOA.tst -// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, STEREO out +// 4 ISm with metadata at 32 kbps, 48 kHz in, 48 kHz out, STEREO out ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48s.wav bit ../IVAS_dec STEREO 48 bit testv/stv4ISM48s.wav_32000_48-48_STEREO.tst -// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, BINAURAL out -../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48s.wav bit -../IVAS_dec BINAURAL 48 bit testv/stv4ISM48s.wav_32000_48-48_binaural.tst - -// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL out -../IVAS_cod -dtx -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48n.wav bit -../IVAS_dec BINAURAL 48 bit testv/stv4ISM48n.wav_32000_48-48_DTX_BINAURAL.tst - -// 2 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, DTX on, HOA2 out -../IVAS_cod -dtx -ism 2 testv/stvISM1.csv testv/stvISM2.csv 32000 48 testv/stvST48c.wav bit -../IVAS_dec HOA2 48 bit testv/stv2ST48c.wav_32000_48-48_DTX_HOA2.tst +// 3 ISm with metadata at 48 kbps, 48 kHz in, 48 kHz out, MONO out +../IVAS_cod -ism 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 48000 48 testv/stv3ISM48s.wav bit +../IVAS_dec MONO 48 bit testv/stv43ISM48s_48000_48-48_MONO.tst +// 2 ISm with metadata at 64 kbps, 48 kHz in, 32 kHz out, 5_1 out +../IVAS_cod -max_band FB -ism 2 testv/stvISM1.csv testv/stvISM2.csv 64000 48 testv/stv2ISM48s.wav bit +../IVAS_dec 5_1 32 bit testv/stv2ISM48s.wav_64000_48-32_5_1.tst -// 2 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, EXTERNAL out -../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 32000 48 testv/stv2ISM48s.wav bit -../IVAS_dec EXT 48 bit testv/stv2ISM48s.wav_32000_48-48_external.tst +// 4 ISm with metadata at 80 kbps, 48 kHz in, 48 kHz out, HOA2 out +../IVAS_cod -max_band FB -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 80000 48 testv/stv4ISM48s.wav bit +../IVAS_dec HOA2 48 bit testv/stv4ISM48s.wav_80000_48-48_HOA2.tst -// 2 ISM with metadata at 64 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out -../IVAS_cod -ism 2 testv/stvISM3.csv testv/stvISM4.csv 64000 48 testv/stv2ISM48s.wav bit -../IVAS_dec BINAURAL_ROOM 48 bit testv/stv2ISM48s.wav_64000_48-48_binaural_room.tst +// 4 ISm with metadata at 96 kbps, 48 kHz in, 48 kHz out, Custom LS setup out +../IVAS_cod -max_band FB -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 96000 48 testv/stv4ISM48s.wav bit +../IVAS_dec testv/ls_setup_16ch_8+4+4.txt 48 bit testv/stv4ISM48s.wav_96000_48-48_MC_custom_setup.tst -// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out, random FEC at 5% -../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48s.wav bit -../IVAS_dec -fec 5 BINAURAL_ROOM 48 bit testv/stv4ISM48s.wav_32000_48-48_binaural_room_FEC5.tst +// 3 ISm with metadata at 128 kbps, 48 kHz in, 32 kHz out, HOA3 out, random FEC at 5% +../IVAS_cod -max_band FB -ism 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 128000 48 testv/stv3ISM48s.wav bit +../IVAS_dec -fec 5 HOA3 32 bit testv/stv3ISM48s.wav_128000_48-32_HOA3_FEC5.tst -// 3 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, MONO out -../IVAS_cod -ism 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 48000 48 testv/stv3ISM48s.wav bit -../IVAS_dec MONO 48 bit testv/stv43ISM48s_48000_48-48_MONO.tst +// 4 ISm with metadata at 160 kbps, 48 kHz in, 48 kHz out, STEREO out +../IVAS_cod -max_band FB -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 160000 48 testv/stv4ISM48s.wav bit +../IVAS_dec STEREO 48 bit testv/stv4ISM48s.wav_160000_48-48_STEREO.tst -// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL out -../IVAS_cod -dtx -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48n.wav bit -../IVAS_dec BINAURAL 48 bit testv/stv4ISM48n.wav_32000_48-48_DTX_BINAURAL.tst +// 2 ISm with metadata at 16.4 kbps, 48 kHz in, 48 kHz out, BINAURAL out +../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 16400 48 testv/stv2ISM48s.wav bit +../IVAS_dec BINAURAL 48 bit testv/stv2ISM48s.wav_16400_48-48_binaural.tst -// 4 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL ROOM out, random FEC at 5% -../IVAS_cod -dtx -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 48000 48 testv/stv4ISM48n.wav bit -../IVAS_dec -fec 5 BINAURAL_ROOM 48 bit testv/stv4ISM48n.wav_48000_48-48_DTX_TD_binaural_room_FEC5.tst +// 3 ISm with metadata at 24.4 kbps, 48 kHz in, 48 kHz out, BINAURAL out +../IVAS_cod -ism 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 24400 48 testv/stv3ISM48s.wav bit +../IVAS_dec BINAURAL 48 bit testv/stv3ISM48s.wav_24400_48-48_binaural.tst -// 2 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL out, random FEC at 5% +// 2 ISm with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL out, random FEC at 5% ../IVAS_cod -ism 2 testv/stvISM3.csv testv/stvISM4.csv 48000 48 testv/stv2ISM48s.wav bit ../IVAS_dec -fec 5 BINAURAL 48 bit testv/stv2ISM48s.wav_48000_48-48_binaural_FEC5.tst -// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out, head rotation, random FEC at 5% -../IVAS_cod -ism 1 testv/stvISM1.csv 48000 48 testv/stv1ISM48s.wav bit -../IVAS_dec -fec 5 -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM 48 bit testv/stv1ISM48s.wav_64000_48-48_binaural_room_HR.tst +// 4 ISm with metadata at 32 kbps, 48 kHz in, 48 kHz out, BINAURAL out +../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48s.wav bit +../IVAS_dec BINAURAL 48 bit testv/stv4ISM48s.wav_32000_48-48_binaural.tst -// 2 ISM with metadata at 64 kbps, 48 kHz in, 32 kHz out, 5_1 out -../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 64000 48 testv/stv2ISM48s.wav bit -../IVAS_dec 5_1 32 bit testv/stv2ISM48s.wav_64000_48-32_5_1.tst +// 1 ISm with metadata at 16.4 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out +../IVAS_cod -ism 1 testv/stvISM1.csv 16400 48 testv/stv1ISM48s.wav bit +../IVAS_dec BINAURAL_ROOM 48 bit testv/stv1ISM48s.wav_16400_48-48_binaural_room.tst -// 4 ISM with metadata at 64 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out -../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 64000 48 testv/stv4ISM48s.wav bit -../IVAS_dec BINAURAL_ROOM 48 bit testv/stv4ISM48s.wav_64000_48-48_binaural_room.tst +// 2 ISm with metadata at 32 kbps, 48 kHz in, 48 kHz out, EXTERNAL out +../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 32000 48 testv/stv2ISM48s.wav bit +../IVAS_dec EXT 48 bit testv/stv2ISM48s.wav_32000_48-48_external.tst -// 2 ISM with metadata at 80 kbps, 48 kHz in, 48 kHz out, DTX on, stereo out -../IVAS_cod -dtx -ism 2 testv/stvISM1.csv testv/stvISM2.csv 80000 48 testv/stvST48c.wav bit -../IVAS_dec STEREO 48 bit testv/stv2ST48c.wav_80000_48-48_DTX_STEREO.tst +// 2 ISm with metadata at 64 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out +../IVAS_cod -ism 2 testv/stvISM3.csv testv/stvISM4.csv 64000 48 testv/stv2ISM48s.wav bit +../IVAS_dec BINAURAL_ROOM 48 bit testv/stv2ISM48s.wav_64000_48-48_binaural_room.tst -// 4 ISM with metadata at 80 kbps, 48 kHz in, 48 kHz out, HOA2 out -../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 80000 48 testv/stv4ISM48s.wav bit -../IVAS_dec HOA2 48 bit testv/stv4ISM48s.wav_80000_48-48_HOA2.tst +// 4 ISm with metadata at 32 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out, random FEC at 5% +../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48s.wav bit +../IVAS_dec -fec 5 BINAURAL_ROOM 48 bit testv/stv4ISM48s.wav_32000_48-48_binaural_room_FEC5.tst -// 1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), head rotation, random FEC at 5% -../IVAS_cod -ism 1 testv/stvISM1.csv 80000 48 testv/stv1ISM48s.wav bit -../IVAS_dec -fec 5 -t testv/headrot_case00_3000_q.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit testv/stv2ISM48s.wav_80000_48-16_binaural_file_TDHR_FEC5.tst +// 4 ISm with metadata at 64 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out +../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 64000 48 testv/stv4ISM48s.wav bit +../IVAS_dec BINAURAL_ROOM 48 bit testv/stv4ISM48s.wav_64000_48-48_binaural_room.tst -// 4 ISM with metadata at 96 kbps, 48 kHz in, 48 kHz out, Custom LS setup out -../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 96000 48 testv/stv4ISM48s.wav bit -../IVAS_dec testv/ls_setup_16ch_8+4+4.txt 48 bit testv/stv4ISM48s.wav_96000_48-48_MC_custom_setup.tst +// 1 ISm with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out, head rotation, random FEC at 5% +../IVAS_cod -ism 1 testv/stvISM1.csv 48000 48 testv/stv1ISM48s.wav bit +../IVAS_dec -fec 5 -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM 48 bit testv/stv1ISM48s.wav_64000_48-48_binaural_room_HR.tst -// 1 ISM with metadata at 96 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file) +// 1 ISm with metadata at 96 kbps, 48 kHz in, 16 kHz out, TD BINAURAL out (Model from file) ../IVAS_cod -ism 1 testv/stvISM1.csv 96000 48 testv/stv1ISM48s.wav bit -../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit testv/stv2ISM48s.wav_96000_48-16_binaural.tst - -// 3 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, HOA3 out, random FEC at 5% -../IVAS_cod -ism 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 128000 48 testv/stv3ISM48s.wav bit -../IVAS_dec -fec 5 HOA3 32 bit testv/stv3ISM48s.wav_128000_48-32_HOA3_FEC5.tst +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit testv/stv2ISM48s.wav_96000_48-16_TD_binaural.tst +// 2 ISm with metadata at 160 kbps, 48 kHz in, 32 kHz out, TD BINAURAL out +../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 160000 48 testv/stv2ISM48s.wav bit +../IVAS_dec BINAURAL 32 bit testv/stv2ISM48s.wav_160000_48-32_TD_binaural.tst -// 2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), head rotation -../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 128000 48 testv/stv2ISM48s.wav bit -../IVAS_dec -t testv/headrot_case01_3000_q.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin BINAURAL 32 bit testv/stv2ISM48s.wav_128000_48-32_binaural_file_TDHR.tst +// 3 ISm with metadata at 192 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out (Model from file) +../IVAS_cod -ism 3 testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 192000 48 testv/stv3ISM48s.wav bit +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL 48 bit testv/stv3ISM48s.wav_192000_48-48_TD_binaural.tst -// 4 ISM with metadata at 160 kbps, 48 kHz in, 48 kHz out, STEREO out -../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 160000 48 testv/stv4ISM48s.wav bit -../IVAS_dec STEREO 48 bit testv/stv4ISM48s.wav_160000_48-48_STEREO.tst +// 4 ISm with metadata at 256 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out +../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit +../IVAS_dec BINAURAL 48 bit testv/stv4ISM48s.wav_256000_48-48_TD_binaural.tst -// 2 ISM with metadata at 160 kbps, 48 kHz in, 32 kHz out, BINAURAL out -../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 160000 48 testv/stv2ISM48s.wav bit -../IVAS_dec BINAURAL 32 bit testv/stv2ISM48s.wav_160000_48-32_binaural.tst +// 1 ISm with metadata at 80 kbps, 48 kHz in, 16 kHz out, TD BINAURAL out (Model from file), head rotation, random FEC at 5% +../IVAS_cod -ism 1 testv/stvISM1.csv 80000 48 testv/stv1ISM48s.wav bit +../IVAS_dec -fec 5 -t testv/headrot_case00_3000_q.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit testv/stv2ISM48s.wav_80000_48-16_TDHR_FEC5.tst -// 3 ISM with metadata at 192 kbps, 48 kHz in, 48 kHz out, BINAURAL out (Model from file) -../IVAS_cod -ism 3 testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 192000 48 testv/stv3ISM48s.wav bit -../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL 48 bit testv/stv3ISM48s.wav_192000_48-48_binaural)file.tst +// 2 ISm with metadata at 128 kbps, 48 kHz in, 32 kHz out, TD BINAURAL out (Model from file), head rotation +../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 128000 48 testv/stv2ISM48s.wav bit +../IVAS_dec -t testv/headrot_case01_3000_q.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin BINAURAL 32 bit testv/stv2ISM48s.wav_128000_48-32_TDHR.tst -// 3 ISM with metadata at 192 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, random FEC at 5% +// 3 ISm with metadata at 192 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out, head rotation, random FEC at 5% ../IVAS_cod -ism 3 testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 192000 48 testv/stv3ISM48s.wav bit -../IVAS_dec -fec 5 -t testv/headrot_case02_3000_q.csv BINAURAL 48 bit testv/stv3ISM48s.wav_192000_48-48_binaural_file_TDHR_FEC5.tst +../IVAS_dec -fec 5 -t testv/headrot_case02_3000_q.csv BINAURAL 48 bit testv/stv3ISM48s.wav_192000_48-48_TDHR_FEC5.tst -// 4 ISM with metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out +// 4 ISm with metadata at 256 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out, head rotation ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit -../IVAS_dec BINAURAL 48 bit testv/stv4ISM48s.wav_256000_48-48_binaural.tst +../IVAS_dec -t testv/headrot_case03_3000_q.csv BINAURAL 48 bit testv/stv4ISM48s.wav_256000_48-48_TDHR.tst -// 4 ISM with metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation -../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit -../IVAS_dec -t testv/headrot_case03_3000_q.csv BINAURAL 48 bit testv/stv4ISM48s.wav_256000_48-48_binaural_file_TDHR.tst - -// 3 ISM with metadata at 384 kbps, 48 kHz in, 32 kHz out, 7_1_4 out +// 3 ISm with metadata at 384 kbps, 48 kHz in, 32 kHz out, 7_1_4 out ../IVAS_cod -ism 3 testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 384000 48 testv/stv3ISM48s.wav bit ../IVAS_dec 7_1_4 32 bit testv/stv3ISM48s.wav_384000_48-32_7_1_4.tst -// 4 ISM with metadata at 512 kbps, 48 kHz in, 48 kHz out, 5_1 +// 4 ISm with metadata at 512 kbps, 48 kHz in, 48 kHz out, 5_1 ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 512000 48 testv/stv4ISM48s.wav bit ../IVAS_dec 5_1 48 bit testv/stv4ISM48s.wav_512000_48-48_5_1.tst -// 1 ISM with metadata bitrate switching from 13.2 kbps to 128 kbps, 32 kHz in, 32 kHz out, mono out, DTX on +// 1 ISm with metadata bitrate switching from 13.2 kbps to 128 kbps, 32 kHz in, 32 kHz out, mono out, DTX on ../IVAS_cod -dtx -ism 1 testv/stvISM1.csv ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 32 testv/stv32c.wav bit ../IVAS_dec MONO 32 bit testv/stv32c.wav_brate_sw_32-32_mono_dtx.tst -// 4 ISM with metadata bitrate switching from 24.4 kbps to 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out +// 4 ISm with metadata bitrate switching from 24.4 kbps to 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv4ISM48s.wav bit -../IVAS_dec BINAURAL 48 bit testv/stv4ISM48s.wav_brate_sw_48-48_binaural.tst +../IVAS_dec BINAURAL 48 bit testv/stv4ISM48s.wav_brate_sw_48-48_BINAURAL.tst -// 4 ISm with and without metadata bitrate switching from 24.4 kbps to 256 kbps, 48 kHz in, 48 kHz out, DTX on, HOA3 out -../IVAS_cod -dtx -ism 4 testv/stvISM1.csv NULL NULL testv/stvISM4.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv4ISM48s.wav bit -../IVAS_dec HOA3 48 bit testv/stv4ISM48s.wav_brate_sw_48-48_DTX_hoa3.tst +// 4 ISm with metadata at 256 kbps, 48 kHz in, 48 kHz out, DTX on, TD BINAURAL out +../IVAS_cod -dtx -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48n.wav bit +../IVAS_dec BINAURAL 48 bit testv/stv4ISM48n.wav_256000_48-48_DTX_TD_binaural.tst @@ -515,7 +493,7 @@ ../IVAS_dec -fec 5 FOA 32 bit testv/stvFOA32c.wav_SBA_64000_32-32_DTX_FOA.tst // SBA at 64 kbps, 48kHz in, 48kHz out, 5_1_4 out -../IVAS_cod -sba 1 64000 48 testv/stvFOA48c.wav bit +../IVAS_cod -max_band FB -sba 1 64000 48 testv/stvFOA48c.wav bit ../IVAS_dec 5_1_4 48 bit testv/stvFOA48c.wav_SBA_64000_48-48_5_1_4.tst // SBA at 64 kbps, 48kHz in, 48kHz out, 7_1_4 out diff --git a/scripts/testv/stv16c.wav b/scripts/testv/stv16c.wav index d107fe711d..6923cea4ed 100644 --- a/scripts/testv/stv16c.wav +++ b/scripts/testv/stv16c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:61f9eca5dafeb46a6aa29c82a8252ebb4ffd4e7a7255f5a4653d8335e685872e -size 640046 +oid sha256:787f5198da219f4a449b2269d9f2a7c592abdbc9554a991b8b9656d53aac1884 +size 640108 diff --git a/scripts/testv/stv16n.wav b/scripts/testv/stv16n.wav index 9a9c8798e5..dd94fc0e63 100644 --- a/scripts/testv/stv16n.wav +++ b/scripts/testv/stv16n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7d0ac0846c3046d91843b390fbef3a0180dac92b7d53e4079b3541d43b8af188 -size 620846 +oid sha256:831f2439e3d728595e3583fea053a5f7130e5f09b69832e686b76a69d93bbcee +size 620908 diff --git a/scripts/testv/stv1ISM48s.wav b/scripts/testv/stv1ISM48s.wav index da05075565..ddcd5d3324 100644 --- a/scripts/testv/stv1ISM48s.wav +++ b/scripts/testv/stv1ISM48s.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dfd1f55af3964c73b423efe64c7400c02ea3c5f289bf347b019350fe3165bcf3 -size 2880044 +oid sha256:c6914081054030a4a99ab3556f86ecd817b477a132df8d837a8b11568debd49e +size 2880106 diff --git a/scripts/testv/stv1MASA1TC48c.wav b/scripts/testv/stv1MASA1TC48c.wav index 263f109000..60c2de7967 100644 --- a/scripts/testv/stv1MASA1TC48c.wav +++ b/scripts/testv/stv1MASA1TC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2409df48bf501463db0e468aeeee11e5aa866f0adf91ef714a7c6fc506235aa1 -size 288044 +oid sha256:e9d4810b9aeee2f374c77ab3a0377c478e49e52d9e81b9ec2a01ddd0e8a0f8d4 +size 288106 diff --git a/scripts/testv/stv1MASA1TC48n.wav b/scripts/testv/stv1MASA1TC48n.wav index 1b0012d886..541ded9f6d 100644 --- a/scripts/testv/stv1MASA1TC48n.wav +++ b/scripts/testv/stv1MASA1TC48n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:81065ed959b13b8c2a4bb1a05ef14095f523912bc3007fdd172cce87a8398046 -size 1927724 +oid sha256:c0a85059ba982f249e77391188a0d030acf6853fe326ab5ade480239ce80f07f +size 1927786 diff --git a/scripts/testv/stv1MASA2TC48c.wav b/scripts/testv/stv1MASA2TC48c.wav index 982e69fb20..aefec77efe 100644 --- a/scripts/testv/stv1MASA2TC48c.wav +++ b/scripts/testv/stv1MASA2TC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1bd8440cbf857f9376d053f780572213964c32a267f325948f3a3a02805dc998 -size 1152044 +oid sha256:ab7437cdf41e56338c93f5e593118a112a48bae5138be2cdd301eff5da59bb06 +size 1152106 diff --git a/scripts/testv/stv1MASA2TC48n.wav b/scripts/testv/stv1MASA2TC48n.wav index f25eb24353..d5e9d955b2 100644 --- a/scripts/testv/stv1MASA2TC48n.wav +++ b/scripts/testv/stv1MASA2TC48n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:97f1a7a43012ce166b929df59bd756f5d96433ea00ce0a1005380368c01619a0 +oid sha256:8f745778ed4fa70a704f530049022827696fc4e0dd3389a4076a8658ed514926 size 3855404 diff --git a/scripts/testv/stv2ISM48s.wav b/scripts/testv/stv2ISM48s.wav index 02de53114d..a945db6b00 100644 --- a/scripts/testv/stv2ISM48s.wav +++ b/scripts/testv/stv2ISM48s.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e042a1a219fcd4f8a82d1d200071139b76c749d97a7b627774431ba961486b2c -size 5760044 +oid sha256:777052eddbd7cb2ddcf4539a064368efcb6c5155e08ce42fa7a508d98dd5f8c5 +size 5760106 diff --git a/scripts/testv/stv2MASA1TC48c.wav b/scripts/testv/stv2MASA1TC48c.wav index afe705b0b1..43096765fd 100644 --- a/scripts/testv/stv2MASA1TC48c.wav +++ b/scripts/testv/stv2MASA1TC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0d500a55bcc63dda1fd93329bcef272a21eb49731ceb0a60e546ef02e07cdd9b -size 576044 +oid sha256:ccf03f372e4836c9d5ef71d75cf92a00642a13f77464e7c0fcf5f46c961a7f8d +size 576106 diff --git a/scripts/testv/stv2MASA2TC48c.wav b/scripts/testv/stv2MASA2TC48c.wav index e159c4f9ae..0f72267ea0 100644 --- a/scripts/testv/stv2MASA2TC48c.wav +++ b/scripts/testv/stv2MASA2TC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:60a713ed1b97cf94b16849806951ef83d8f41c8ee455b267ec0a292c695cbbc1 -size 576044 +oid sha256:a5a0379965053087ef1ce4775c85384e8c06aaa8161f12888f5e5c06d8612c1f +size 576106 diff --git a/scripts/testv/stv2OA32c.wav b/scripts/testv/stv2OA32c.wav index 86d288de72..071c4866e0 100644 --- a/scripts/testv/stv2OA32c.wav +++ b/scripts/testv/stv2OA32c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1824c3afe43861b2ed1e4ff94591932f34bb1885d96796e282d3839906e50aed -size 11520350 +oid sha256:d608b108d8e38750d78f1691ed92cac2e92f48a86a4488a3dab9a893cfa6ecf2 +size 11520436 diff --git a/scripts/testv/stv2OA48c.wav b/scripts/testv/stv2OA48c.wav index 24bb1f0872..6ba780a84a 100644 --- a/scripts/testv/stv2OA48c.wav +++ b/scripts/testv/stv2OA48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f573744bd97ad3dcb8e86c39d1770725a34f3c43c37c62c26d670a7f722a880e -size 17280494 +oid sha256:ef0935e08a571a9e88f2257e64c45394633252766a0fb91da582eabf5537a49e +size 17280580 diff --git a/scripts/testv/stv32c.wav b/scripts/testv/stv32c.wav index 640532cc12..1267f189de 100644 --- a/scripts/testv/stv32c.wav +++ b/scripts/testv/stv32c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:00089d67aa513a9f6b2f73526e94d5c32437c6944ec6467072dc27ccaa1f5080 -size 1389542 +oid sha256:9babeb07a95e9e23068a9c15eea1996a7c366e6000cf8347ce70661631e04ec4 +size 1389700 diff --git a/scripts/testv/stv32n.wav b/scripts/testv/stv32n.wav index 6a23d99d6e..888bbe819c 100644 --- a/scripts/testv/stv32n.wav +++ b/scripts/testv/stv32n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1a92be333a359a77ec70324815d71282398dede88e59ac19a31f8d18913c0505 -size 1241644 +oid sha256:acbf022e8fbaafb811c14f75f78ec503ef8a1529ce4b04eabbb00c5066635592 +size 1241706 diff --git a/scripts/testv/stv3ISM48s.wav b/scripts/testv/stv3ISM48s.wav index c52500f610..12f31ee40a 100644 --- a/scripts/testv/stv3ISM48s.wav +++ b/scripts/testv/stv3ISM48s.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2a29dfd720edab2367f86c394d4abc9f641596d50697539be70cdfe178d2a28d -size 8640044 +oid sha256:ac91a0d2d1584c52799d7fb52eaa2741df9c6927f94f9d5293dd214938f18a50 +size 8640130 diff --git a/scripts/testv/stv3OA32c.wav b/scripts/testv/stv3OA32c.wav index 07cda52674..88c473707d 100644 --- a/scripts/testv/stv3OA32c.wav +++ b/scripts/testv/stv3OA32c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bdd1fd31b318bef4439a35baf2252c8edabb826198c75d705095b68dfa288fb0 -size 20480588 +oid sha256:7376200d96aafc156cd4f9907e0b727e1e04921bfcbdb580ac8ff58fea4a60d6 +size 20480674 diff --git a/scripts/testv/stv3OA48c.wav b/scripts/testv/stv3OA48c.wav index 960d9e2019..39a208555f 100644 --- a/scripts/testv/stv3OA48c.wav +++ b/scripts/testv/stv3OA48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7ce54b1708a76f34eeedc40b01e806cb92d32b0813e8ac23bfceaaa8d25262e6 -size 30720844 +oid sha256:3d1bf1ccd3a2d59b8fd768df58c49f9abd2b090664745256eec7d23aa0ea8c70 +size 30720930 diff --git a/scripts/testv/stv48c.wav b/scripts/testv/stv48c.wav index 1be5a1dc3c..d6df0e8fe2 100644 --- a/scripts/testv/stv48c.wav +++ b/scripts/testv/stv48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:59f39e02d601b453170cde1e49d50e58b58ff5154ba54c75fc5d79f4964d1e48 -size 1920044 +oid sha256:2a2553784fc796c20b2f7d12e159661e9a480438b0ca71bfaf613757c841a1bb +size 1920106 diff --git a/scripts/testv/stv48n.wav b/scripts/testv/stv48n.wav index 2d79cee520..040040fadc 100644 --- a/scripts/testv/stv48n.wav +++ b/scripts/testv/stv48n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3c774e6fe4e22274ef72552901c4b4870d56d825fa67e8e3e59a30cc0a44dbfa -size 1862444 +oid sha256:621ec6a05e4e5064bd2f5699129e81335ac64f257e3dee293b0245ac1adcdb6b +size 1862506 diff --git a/scripts/testv/stv4ISM48n.wav b/scripts/testv/stv4ISM48n.wav index 0ca6e5f3f5..5294260a0f 100644 --- a/scripts/testv/stv4ISM48n.wav +++ b/scripts/testv/stv4ISM48n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:74697fcb6241db1bed87121244c09a3499ea4024cdf15d279feafbedbca6123a +oid sha256:b48c4030982641afcaa0c61182f35d6648e2bea4a952d9430f710989e4e4646c size 7680044 diff --git a/scripts/testv/stv4ISM48s.wav b/scripts/testv/stv4ISM48s.wav index de034819ea..faffedc961 100644 --- a/scripts/testv/stv4ISM48s.wav +++ b/scripts/testv/stv4ISM48s.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:70433aebd892f38df31f12f10e71caaa1e794c64abb7d3e75fe895676e63609e -size 11520044 +oid sha256:361001b64a7ff11a22267df08ccd261728b9a455c2c4860f84f99ce2dc6dd485 +size 11520130 diff --git a/scripts/testv/stv512MC48c.wav b/scripts/testv/stv512MC48c.wav index e21644a5d9..a0c66dc86c 100644 --- a/scripts/testv/stv512MC48c.wav +++ b/scripts/testv/stv512MC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3be0c6dccbf26f8755200683bba42553eb36feed297110e289afcec32e0c8459 -size 2304044 +oid sha256:0f2bcf911eda4dc1069e113d82f2e72b0849db5fb28ebdd619a59971f16fc909 +size 2304130 diff --git a/scripts/testv/stv514MC48c.wav b/scripts/testv/stv514MC48c.wav index 113cd6219a..22d0c6e0ab 100644 --- a/scripts/testv/stv514MC48c.wav +++ b/scripts/testv/stv514MC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d2097dd80fa69f239689b06a62a44eb592bf2fe699e549347ae4567c1b690170 -size 2880044 +oid sha256:6ca93376cae09017177a1a49e2d7d006f5bf61c4c94b9e466dedee6e03a45efb +size 2880130 diff --git a/scripts/testv/stv51MC48c.wav b/scripts/testv/stv51MC48c.wav index e5f4bae7d4..7c98cc83d3 100644 --- a/scripts/testv/stv51MC48c.wav +++ b/scripts/testv/stv51MC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:daccececb4336a7f2492185767d108dbc5594a7d6e2841d861f43ef44437a377 -size 11520044 +oid sha256:377961aefebcea8dd87e5a63af8c17f6b0db588f328cee9ae6db5be95e23cd05 +size 11520130 diff --git a/scripts/testv/stv714MC48c.wav b/scripts/testv/stv714MC48c.wav index cabcb790b0..53c36268d0 100644 --- a/scripts/testv/stv714MC48c.wav +++ b/scripts/testv/stv714MC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:da62e19b166089efae2f22e68d76b82d3295d15785a4967465a04bc1c75b0462 -size 3456044 +oid sha256:6fa104a2015be912ea80d015ddb0a42774edea137bc9427954767efcae5e0b1c +size 3456130 diff --git a/scripts/testv/stv71MC48c.wav b/scripts/testv/stv71MC48c.wav index 72b3337e59..2a0b012ab0 100644 --- a/scripts/testv/stv71MC48c.wav +++ b/scripts/testv/stv71MC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3fb15d0c109c41d5e629b2e15a47be72ca8d209919ac39f79a7947e9cd2e5e02 -size 2304044 +oid sha256:d0ac38ddb16b2ce9cbca27965c5aedaf1af857a6fdce340bc01322794311e92d +size 2304130 diff --git a/scripts/testv/stv8c.wav b/scripts/testv/stv8c.wav index 5f3b0ed4d9..0ee4ea2b7a 100644 --- a/scripts/testv/stv8c.wav +++ b/scripts/testv/stv8c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:722081dcfaaee1c04254b0bde8436c73748a44f6760067907194a1ba24b199d7 -size 320046 +oid sha256:8659d17c088387b59f3a02e698c5dd32746f541493d68be1883a217f4d1b08cf +size 320108 diff --git a/scripts/testv/stv8n.wav b/scripts/testv/stv8n.wav index 2b35ec4dba..66e042366e 100644 --- a/scripts/testv/stv8n.wav +++ b/scripts/testv/stv8n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:223e9f5353c49163803abedf97d557436d025f445fe9de4508c9559ca15b330b -size 310446 +oid sha256:d872103d81dcdf846105cdacdb33fc02cbae02104e2c77ff5ff6d985f409b81f +size 310508 diff --git a/scripts/testv/stvFOA16c.wav b/scripts/testv/stvFOA16c.wav index cb67e8b371..996ada1bcd 100644 --- a/scripts/testv/stvFOA16c.wav +++ b/scripts/testv/stvFOA16c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6725a5d2647516071033f83f385dc7dfe4ff6719d493b1b682ec0274c1347e93 -size 2560116 +oid sha256:30a766e574f03b20403b873443b837497a685c0c5ac28c5ac51c95ef226385fa +size 2560202 diff --git a/scripts/testv/stvFOA32c.wav b/scripts/testv/stvFOA32c.wav index 661a97a3dc..3a681bfa80 100644 --- a/scripts/testv/stvFOA32c.wav +++ b/scripts/testv/stvFOA32c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:273308e57de4c5f3ef2eeed164b0a9f34ba86ab05ca533ee5ee8a76528c01abe -size 5120180 +oid sha256:47176066fc373347564bc28ff56d8d9d52745ab7dd631ce4e051f81dff6908e5 +size 5120266 diff --git a/scripts/testv/stvFOA48c.wav b/scripts/testv/stvFOA48c.wav index 7ece23b084..ade8e3343d 100644 --- a/scripts/testv/stvFOA48c.wav +++ b/scripts/testv/stvFOA48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:45a1dd6c4fe6802e98821657337b453d5dab2fe32089c675637b9d23cfe74c8d -size 7680244 +oid sha256:9c5da22f3ab1bd9681fff74a77f8ff543f1565f93a5c573125db8820c267376f +size 7680330 diff --git a/scripts/testv/stvST16c.wav b/scripts/testv/stvST16c.wav index 3fb9ec0b3b..e46f2e6f5d 100644 --- a/scripts/testv/stvST16c.wav +++ b/scripts/testv/stvST16c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:11a2f5887fe2407df03128634188d8aef6d3f76b52db14a1f834dbb98b7dd52e -size 1280048 +oid sha256:350c8b0d4c11d2e994158be287c07fda1eef6fd6f92aaf769a7f8529c88f16d0 +size 1280110 diff --git a/scripts/testv/stvST16n.wav b/scripts/testv/stvST16n.wav index 74c80dca93..63afe4f14b 100644 --- a/scripts/testv/stvST16n.wav +++ b/scripts/testv/stvST16n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:60a8cfa5abf4e052840fea0054fec5331465149747fd7bc7eadab18b62d864f1 -size 1241648 +oid sha256:40d28848ee6fc8442738662e5cda78473fb099314aab49440afcfd68286d280d +size 1241710 diff --git a/scripts/testv/stvST32c.wav b/scripts/testv/stvST32c.wav index 68a4a1fa33..876c0e558b 100644 --- a/scripts/testv/stvST32c.wav +++ b/scripts/testv/stvST32c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1182294e7c3ba44e854219698e6a3c209e24345ab2e5e4296fce38029324f374 -size 2560044 +oid sha256:12737393e0bbcdb7b6d9d6dbef79984feac3ff5313daa97a6a8793d3e26099ba +size 2560106 diff --git a/scripts/testv/stvST32n.wav b/scripts/testv/stvST32n.wav index 7da590907d..6d77c6892d 100644 --- a/scripts/testv/stvST32n.wav +++ b/scripts/testv/stvST32n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a6edbfd26681fa42f377891761ad79f97029a3380bc644e47bff1803c7904ff9 -size 2483244 +oid sha256:3642b2bce81ea794457655886f56bca58fb0b1431ed7ac52f1a27f8388c75eb4 +size 2483306 diff --git a/scripts/testv/stvST48c.wav b/scripts/testv/stvST48c.wav index df554e6521..250770d61f 100644 --- a/scripts/testv/stvST48c.wav +++ b/scripts/testv/stvST48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:40929eb3eb266ed78c16daa2a9c987745fe8e005a577f2dd81264ffda845c118 -size 3840044 +oid sha256:cc028e71c94b43068dcc2c7557277ad1989ee20e7a6d8dd6fd30d70d384d56b3 +size 3840106 diff --git a/scripts/testv/stvST48n.wav b/scripts/testv/stvST48n.wav index cb2d8c4fc3..8dd24e4ca0 100644 --- a/scripts/testv/stvST48n.wav +++ b/scripts/testv/stvST48n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6074a3a3b88c7868f62c9bcf7df56e4a8fd25ffed059886846220efc4fbc0992 -size 3724844 +oid sha256:ac4262d08b5e45e8ce8da4456740d1e7224aa25b0e3e3088381cb91436cec31f +size 3724906 diff --git a/scripts/trajectories/azi_plus_2-ele_plus_2-every-100-frames-Euler.csv b/scripts/trajectories/azi+2-ele+2-every-100-frames-Euler.csv similarity index 100% rename from scripts/trajectories/azi_plus_2-ele_plus_2-every-100-frames-Euler.csv rename to scripts/trajectories/azi+2-ele+2-every-100-frames-Euler.csv diff --git a/scripts/trajectories/azi_plus_2-ele_plus_2-every-100-frames.csv b/scripts/trajectories/azi+2-ele+2-every-100-frames.csv similarity index 100% rename from scripts/trajectories/azi_plus_2-ele_plus_2-every-100-frames.csv rename to scripts/trajectories/azi+2-ele+2-every-100-frames.csv diff --git a/scripts/trajectories/azi_plus_2-ele_plus_2-every-25-rows.csv b/scripts/trajectories/azi_plus_2-ele_plus_2-every-25-rows.csv deleted file mode 100644 index 4d8eb8d47b..0000000000 --- a/scripts/trajectories/azi_plus_2-ele_plus_2-every-25-rows.csv +++ /dev/null @@ -1,3000 +0,0 @@ - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.653281, -0.270598, 0.270598, 0.653281 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.634602, -0.292582, 0.282543, 0.657150 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.615562, -0.314856, 0.293608, 0.660109 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.596200, -0.337381, 0.303779, 0.662147 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.576556, -0.360116, 0.313044, 0.663252 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.556670, -0.383022, 0.321394, 0.663414 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.536584, -0.406058, 0.328819, 0.662626 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.516337, -0.429181, 0.335313, 0.660881 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.495972, -0.452352, 0.340872, 0.658176 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.475528, -0.475528, 0.345492, 0.654508 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.455049, -0.498668, 0.349171, 0.649877 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.434575, -0.521730, 0.351911, 0.644283 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.414147, -0.544673, 0.353715, 0.637730 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.393807, -0.567455, 0.354585, 0.630223 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.373595, -0.590035, 0.354529, 0.621767 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.353553, -0.612372, 0.353553, 0.612372 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.333721, -0.634427, 0.351668, 0.602048 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.314138, -0.656158, 0.348885, 0.590807 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.294843, -0.677527, 0.345217, 0.578662 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.275876, -0.698494, 0.340678, 0.565629 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.257274, -0.719022, 0.335286, 0.551725 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.239074, -0.739074, 0.329057, 0.536969 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.221313, -0.758612, 0.322012, 0.521380 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.204025, -0.777602, 0.314172, 0.504981 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.187247, -0.796008, 0.305559, 0.487794 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.171010, -0.813798, 0.296198, 0.469846 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.155348, -0.830938, 0.286115, 0.451162 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.140291, -0.847398, 0.275336, 0.431771 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.125869, -0.863147, 0.263890, 0.411700 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.112112, -0.878156, 0.251807, 0.390980 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.099046, -0.892399, 0.239118, 0.369644 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.086697, -0.905849, 0.225854, 0.347723 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.075090, -0.918482, 0.212048, 0.325251 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.064248, -0.930274, 0.197736, 0.302264 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.054193, -0.941204, 0.182951, 0.278797 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.044943, -0.951251, 0.167731, 0.254887 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.036519, -0.960398, 0.152112, 0.230571 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.028936, -0.968628, 0.136132, 0.205888 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.022209, -0.975926, 0.119829, 0.180877 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.016352, -0.982278, 0.103242, 0.155578 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.011376, -0.987672, 0.086410, 0.130030 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.007292, -0.992099, 0.069374, 0.104274 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.004106, -0.995551, 0.052175, 0.078352 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.001826, -0.998021, 0.034852, 0.052304 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000457, -0.999505, 0.017446, 0.026173 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000000, -1.000000, 0.000000, 0.000000 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.000457, -0.999505, -0.017446, -0.026173 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.001826, -0.998021, -0.034852, -0.052304 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.004106, -0.995551, -0.052175, -0.078352 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.007292, -0.992099, -0.069374, -0.104274 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.011376, -0.987672, -0.086410, -0.130030 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.016352, -0.982278, -0.103242, -0.155578 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.022209, -0.975926, -0.119829, -0.180877 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.028936, -0.968628, -0.136132, -0.205888 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.036519, -0.960398, -0.152112, -0.230571 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.044943, -0.951251, -0.167731, -0.254887 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.054193, -0.941204, -0.182951, -0.278797 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.064248, -0.930274, -0.197736, -0.302264 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.075090, -0.918482, -0.212048, -0.325251 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.086697, -0.905849, -0.225854, -0.347723 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.099046, -0.892399, -0.239118, -0.369644 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.112112, -0.878156, -0.251807, -0.390980 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.125869, -0.863147, -0.263890, -0.411700 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.140291, -0.847398, -0.275336, -0.431771 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.155348, -0.830938, -0.286115, -0.451162 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.171010, -0.813798, -0.296198, -0.469846 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.187247, -0.796008, -0.305559, -0.487794 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.204025, -0.777602, -0.314172, -0.504981 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.221313, -0.758612, -0.322012, -0.521380 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.239074, -0.739074, -0.329057, -0.536969 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.257274, -0.719022, -0.335286, -0.551725 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.275876, -0.698494, -0.340678, -0.565629 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.294843, -0.677527, -0.345217, -0.578662 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.314138, -0.656158, -0.348885, -0.590807 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.333721, -0.634427, -0.351668, -0.602048 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.353553, -0.612372, -0.353553, -0.612372 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.373595, -0.590035, -0.354529, -0.621767 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.393807, -0.567455, -0.354585, -0.630223 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.414147, -0.544673, -0.353715, -0.637730 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.434575, -0.521730, -0.351911, -0.644283 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.455049, -0.498668, -0.349171, -0.649877 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.475528, -0.475528, -0.345492, -0.654508 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.495972, -0.452352, -0.340872, -0.658176 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.516337, -0.429181, -0.335313, -0.660881 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.536584, -0.406058, -0.328819, -0.662626 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.556670, -0.383022, -0.321394, -0.663414 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.576556, -0.360116, -0.313044, -0.663252 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.596200, -0.337381, -0.303779, -0.662147 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.615562, -0.314856, -0.293608, -0.660109 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.634602, -0.292582, -0.282543, -0.657150 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.653281, -0.270598, -0.270598, -0.653281 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.671562, -0.248943, -0.257788, -0.648519 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.689404, -0.227656, -0.244131, -0.642880 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.706773, -0.206773, -0.229644, -0.636381 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.723630, -0.186331, -0.214349, -0.629042 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.739942, -0.166366, -0.198267, -0.620885 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.755673, -0.146912, -0.181421, -0.611932 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.770791, -0.128003, -0.163837, -0.602208 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.785262, -0.109672, -0.145540, -0.591738 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.799057, -0.091950, -0.126558, -0.580549 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.812144, -0.074867, -0.106921, -0.568669 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.824496, -0.058452, -0.086658, -0.556130 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.836085, -0.042732, -0.065801, -0.542960 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.846886, -0.027734, -0.044383, -0.529193 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.856874, -0.013482, -0.022438, -0.514862 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.866025, -0.000000, -0.000000, -0.500000 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.874320, 0.012691, 0.022895, -0.484643 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.881738, 0.024570, 0.046210, -0.468828 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.888260, 0.035620, 0.069908, -0.452591 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.893870, 0.045822, 0.093950, -0.435970 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.898554, 0.055163, 0.118297, -0.419003 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.902298, 0.063628, 0.142910, -0.401729 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.905091, 0.071205, 0.167749, -0.384188 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.906923, 0.077885, 0.192772, -0.366421 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907786, 0.083659, 0.217940, -0.348466 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.907673, 0.088521, 0.243210, -0.330366 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.906582, 0.092466, 0.268542, -0.312161 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.904508, 0.095492, 0.293893, -0.293893 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.901453, 0.097596, 0.319221, -0.275602 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 - 0.897415, 0.098780, 0.344485, -0.257330 diff --git a/scripts/trajectories/const000-Vector3.csv b/scripts/trajectories/const000-Vector3.csv deleted file mode 100644 index f47ae12e5d..0000000000 --- a/scripts/trajectories/const000-Vector3.csv +++ /dev/null @@ -1,4 +0,0 @@ -0.0, 0.0, 0.0, 1.0, 0.0, 0.0 -0.0, 0.0, 0.0, 1.0, 0.0, 0.0 -0.0, 0.0, 0.0, 1.0, 0.0, 0.0 -0.0, 0.0, 0.0, 1.0, 0.0, 0.0 diff --git a/scripts/trajectories/full-circle-4s-Vector3.csv b/scripts/trajectories/full-circle-4s-Vector3.csv deleted file mode 100644 index 38a3505239..0000000000 --- a/scripts/trajectories/full-circle-4s-Vector3.csv +++ /dev/null @@ -1,200 +0,0 @@ -0.0000,0.0000,0.0000,0.9995,-0.0314,0.0000 -0.0000,0.0000,0.0000,0.9980,-0.0628,0.0000 -0.0000,0.0000,0.0000,0.9956,-0.0941,0.0000 -0.0000,0.0000,0.0000,0.9921,-0.1253,0.0000 -0.0000,0.0000,0.0000,0.9877,-0.1564,0.0000 -0.0000,0.0000,0.0000,0.9823,-0.1874,0.0000 -0.0000,0.0000,0.0000,0.9759,-0.2181,0.0000 -0.0000,0.0000,0.0000,0.9686,-0.2487,0.0000 -0.0000,0.0000,0.0000,0.9603,-0.2790,0.0000 -0.0000,0.0000,0.0000,0.9511,-0.3090,0.0000 -0.0000,0.0000,0.0000,0.9409,-0.3387,0.0000 -0.0000,0.0000,0.0000,0.9298,-0.3681,0.0000 -0.0000,0.0000,0.0000,0.9178,-0.3971,0.0000 -0.0000,0.0000,0.0000,0.9048,-0.4258,0.0000 -0.0000,0.0000,0.0000,0.8910,-0.4540,0.0000 -0.0000,0.0000,0.0000,0.8763,-0.4818,0.0000 -0.0000,0.0000,0.0000,0.8607,-0.5090,0.0000 -0.0000,0.0000,0.0000,0.8443,-0.5358,0.0000 -0.0000,0.0000,0.0000,0.8271,-0.5621,0.0000 -0.0000,0.0000,0.0000,0.8090,-0.5878,0.0000 -0.0000,0.0000,0.0000,0.7902,-0.6129,0.0000 -0.0000,0.0000,0.0000,0.7705,-0.6374,0.0000 -0.0000,0.0000,0.0000,0.7501,-0.6613,0.0000 -0.0000,0.0000,0.0000,0.7290,-0.6845,0.0000 -0.0000,0.0000,0.0000,0.7071,-0.7071,0.0000 -0.0000,0.0000,0.0000,0.6845,-0.7290,0.0000 -0.0000,0.0000,0.0000,0.6613,-0.7501,0.0000 -0.0000,0.0000,0.0000,0.6374,-0.7705,0.0000 -0.0000,0.0000,0.0000,0.6129,-0.7902,0.0000 -0.0000,0.0000,0.0000,0.5878,-0.8090,0.0000 -0.0000,0.0000,0.0000,0.5621,-0.8271,0.0000 -0.0000,0.0000,0.0000,0.5358,-0.8443,0.0000 -0.0000,0.0000,0.0000,0.5090,-0.8607,0.0000 -0.0000,0.0000,0.0000,0.4818,-0.8763,0.0000 -0.0000,0.0000,0.0000,0.4540,-0.8910,0.0000 -0.0000,0.0000,0.0000,0.4258,-0.9048,0.0000 -0.0000,0.0000,0.0000,0.3971,-0.9178,0.0000 -0.0000,0.0000,0.0000,0.3681,-0.9298,0.0000 -0.0000,0.0000,0.0000,0.3387,-0.9409,0.0000 -0.0000,0.0000,0.0000,0.3090,-0.9511,0.0000 -0.0000,0.0000,0.0000,0.2790,-0.9603,0.0000 -0.0000,0.0000,0.0000,0.2487,-0.9686,0.0000 -0.0000,0.0000,0.0000,0.2181,-0.9759,0.0000 -0.0000,0.0000,0.0000,0.1874,-0.9823,0.0000 -0.0000,0.0000,0.0000,0.1564,-0.9877,0.0000 -0.0000,0.0000,0.0000,0.1253,-0.9921,0.0000 -0.0000,0.0000,0.0000,0.0941,-0.9956,0.0000 -0.0000,0.0000,0.0000,0.0628,-0.9980,0.0000 -0.0000,0.0000,0.0000,0.0314,-0.9995,0.0000 -0.0000,0.0000,0.0000,-0.0000,-1.0000,0.0000 -0.0000,0.0000,0.0000,-0.0314,-0.9995,0.0000 -0.0000,0.0000,0.0000,-0.0628,-0.9980,0.0000 -0.0000,0.0000,0.0000,-0.0941,-0.9956,0.0000 -0.0000,0.0000,0.0000,-0.1253,-0.9921,0.0000 -0.0000,0.0000,0.0000,-0.1564,-0.9877,0.0000 -0.0000,0.0000,0.0000,-0.1874,-0.9823,0.0000 -0.0000,0.0000,0.0000,-0.2181,-0.9759,0.0000 -0.0000,0.0000,0.0000,-0.2487,-0.9686,0.0000 -0.0000,0.0000,0.0000,-0.2790,-0.9603,0.0000 -0.0000,0.0000,0.0000,-0.3090,-0.9511,0.0000 -0.0000,0.0000,0.0000,-0.3387,-0.9409,0.0000 -0.0000,0.0000,0.0000,-0.3681,-0.9298,0.0000 -0.0000,0.0000,0.0000,-0.3971,-0.9178,0.0000 -0.0000,0.0000,0.0000,-0.4258,-0.9048,0.0000 -0.0000,0.0000,0.0000,-0.4540,-0.8910,0.0000 -0.0000,0.0000,0.0000,-0.4818,-0.8763,0.0000 -0.0000,0.0000,0.0000,-0.5090,-0.8607,0.0000 -0.0000,0.0000,0.0000,-0.5358,-0.8443,0.0000 -0.0000,0.0000,0.0000,-0.5621,-0.8271,0.0000 -0.0000,0.0000,0.0000,-0.5878,-0.8090,0.0000 -0.0000,0.0000,0.0000,-0.6129,-0.7902,0.0000 -0.0000,0.0000,0.0000,-0.6374,-0.7705,0.0000 -0.0000,0.0000,0.0000,-0.6613,-0.7501,0.0000 -0.0000,0.0000,0.0000,-0.6845,-0.7290,0.0000 -0.0000,0.0000,0.0000,-0.7071,-0.7071,0.0000 -0.0000,0.0000,0.0000,-0.7290,-0.6845,0.0000 -0.0000,0.0000,0.0000,-0.7501,-0.6613,0.0000 -0.0000,0.0000,0.0000,-0.7705,-0.6374,0.0000 -0.0000,0.0000,0.0000,-0.7902,-0.6129,0.0000 -0.0000,0.0000,0.0000,-0.8090,-0.5878,0.0000 -0.0000,0.0000,0.0000,-0.8271,-0.5621,0.0000 -0.0000,0.0000,0.0000,-0.8443,-0.5358,0.0000 -0.0000,0.0000,0.0000,-0.8607,-0.5090,0.0000 -0.0000,0.0000,0.0000,-0.8763,-0.4818,0.0000 -0.0000,0.0000,0.0000,-0.8910,-0.4540,0.0000 -0.0000,0.0000,0.0000,-0.9048,-0.4258,0.0000 -0.0000,0.0000,0.0000,-0.9178,-0.3971,0.0000 -0.0000,0.0000,0.0000,-0.9298,-0.3681,0.0000 -0.0000,0.0000,0.0000,-0.9409,-0.3387,0.0000 -0.0000,0.0000,0.0000,-0.9511,-0.3090,0.0000 -0.0000,0.0000,0.0000,-0.9603,-0.2790,0.0000 -0.0000,0.0000,0.0000,-0.9686,-0.2487,0.0000 -0.0000,0.0000,0.0000,-0.9759,-0.2181,0.0000 -0.0000,0.0000,0.0000,-0.9823,-0.1874,0.0000 -0.0000,0.0000,0.0000,-0.9877,-0.1564,0.0000 -0.0000,0.0000,0.0000,-0.9921,-0.1253,0.0000 -0.0000,0.0000,0.0000,-0.9956,-0.0941,0.0000 -0.0000,0.0000,0.0000,-0.9980,-0.0628,0.0000 -0.0000,0.0000,0.0000,-0.9995,-0.0314,0.0000 -0.0000,0.0000,0.0000,-1.0000,0.0000,0.0000 -0.0000,0.0000,0.0000,-0.9995,0.0314,0.0000 -0.0000,0.0000,0.0000,-0.9980,0.0628,0.0000 -0.0000,0.0000,0.0000,-0.9956,0.0941,0.0000 -0.0000,0.0000,0.0000,-0.9921,0.1253,0.0000 -0.0000,0.0000,0.0000,-0.9877,0.1564,0.0000 -0.0000,0.0000,0.0000,-0.9823,0.1874,0.0000 -0.0000,0.0000,0.0000,-0.9759,0.2181,0.0000 -0.0000,0.0000,0.0000,-0.9686,0.2487,0.0000 -0.0000,0.0000,0.0000,-0.9603,0.2790,0.0000 -0.0000,0.0000,0.0000,-0.9511,0.3090,0.0000 -0.0000,0.0000,0.0000,-0.9409,0.3387,0.0000 -0.0000,0.0000,0.0000,-0.9298,0.3681,0.0000 -0.0000,0.0000,0.0000,-0.9178,0.3971,0.0000 -0.0000,0.0000,0.0000,-0.9048,0.4258,0.0000 -0.0000,0.0000,0.0000,-0.8910,0.4540,0.0000 -0.0000,0.0000,0.0000,-0.8763,0.4818,0.0000 -0.0000,0.0000,0.0000,-0.8607,0.5090,0.0000 -0.0000,0.0000,0.0000,-0.8443,0.5358,0.0000 -0.0000,0.0000,0.0000,-0.8271,0.5621,0.0000 -0.0000,0.0000,0.0000,-0.8090,0.5878,0.0000 -0.0000,0.0000,0.0000,-0.7902,0.6129,0.0000 -0.0000,0.0000,0.0000,-0.7705,0.6374,0.0000 -0.0000,0.0000,0.0000,-0.7501,0.6613,0.0000 -0.0000,0.0000,0.0000,-0.7290,0.6845,0.0000 -0.0000,0.0000,0.0000,-0.7071,0.7071,0.0000 -0.0000,0.0000,0.0000,-0.6845,0.7290,0.0000 -0.0000,0.0000,0.0000,-0.6613,0.7501,0.0000 -0.0000,0.0000,0.0000,-0.6374,0.7705,0.0000 -0.0000,0.0000,0.0000,-0.6129,0.7902,0.0000 -0.0000,0.0000,0.0000,-0.5878,0.8090,0.0000 -0.0000,0.0000,0.0000,-0.5621,0.8271,0.0000 -0.0000,0.0000,0.0000,-0.5358,0.8443,0.0000 -0.0000,0.0000,0.0000,-0.5090,0.8607,0.0000 -0.0000,0.0000,0.0000,-0.4818,0.8763,0.0000 -0.0000,0.0000,0.0000,-0.4540,0.8910,0.0000 -0.0000,0.0000,0.0000,-0.4258,0.9048,0.0000 -0.0000,0.0000,0.0000,-0.3971,0.9178,0.0000 -0.0000,0.0000,0.0000,-0.3681,0.9298,0.0000 -0.0000,0.0000,0.0000,-0.3387,0.9409,0.0000 -0.0000,0.0000,0.0000,-0.3090,0.9511,0.0000 -0.0000,0.0000,0.0000,-0.2790,0.9603,0.0000 -0.0000,0.0000,0.0000,-0.2487,0.9686,0.0000 -0.0000,0.0000,0.0000,-0.2181,0.9759,0.0000 -0.0000,0.0000,0.0000,-0.1874,0.9823,0.0000 -0.0000,0.0000,0.0000,-0.1564,0.9877,0.0000 -0.0000,0.0000,0.0000,-0.1253,0.9921,0.0000 -0.0000,0.0000,0.0000,-0.0941,0.9956,0.0000 -0.0000,0.0000,0.0000,-0.0628,0.9980,0.0000 -0.0000,0.0000,0.0000,-0.0314,0.9995,0.0000 -0.0000,0.0000,0.0000,0.0000,1.0000,0.0000 -0.0000,0.0000,0.0000,0.0314,0.9995,0.0000 -0.0000,0.0000,0.0000,0.0628,0.9980,0.0000 -0.0000,0.0000,0.0000,0.0941,0.9956,0.0000 -0.0000,0.0000,0.0000,0.1253,0.9921,0.0000 -0.0000,0.0000,0.0000,0.1564,0.9877,0.0000 -0.0000,0.0000,0.0000,0.1874,0.9823,0.0000 -0.0000,0.0000,0.0000,0.2181,0.9759,0.0000 -0.0000,0.0000,0.0000,0.2487,0.9686,0.0000 -0.0000,0.0000,0.0000,0.2790,0.9603,0.0000 -0.0000,0.0000,0.0000,0.3090,0.9511,0.0000 -0.0000,0.0000,0.0000,0.3387,0.9409,0.0000 -0.0000,0.0000,0.0000,0.3681,0.9298,0.0000 -0.0000,0.0000,0.0000,0.3971,0.9178,0.0000 -0.0000,0.0000,0.0000,0.4258,0.9048,0.0000 -0.0000,0.0000,0.0000,0.4540,0.8910,0.0000 -0.0000,0.0000,0.0000,0.4818,0.8763,0.0000 -0.0000,0.0000,0.0000,0.5090,0.8607,0.0000 -0.0000,0.0000,0.0000,0.5358,0.8443,0.0000 -0.0000,0.0000,0.0000,0.5621,0.8271,0.0000 -0.0000,0.0000,0.0000,0.5878,0.8090,0.0000 -0.0000,0.0000,0.0000,0.6129,0.7902,0.0000 -0.0000,0.0000,0.0000,0.6374,0.7705,0.0000 -0.0000,0.0000,0.0000,0.6613,0.7501,0.0000 -0.0000,0.0000,0.0000,0.6845,0.7290,0.0000 -0.0000,0.0000,0.0000,0.7071,0.7071,0.0000 -0.0000,0.0000,0.0000,0.7290,0.6845,0.0000 -0.0000,0.0000,0.0000,0.7501,0.6613,0.0000 -0.0000,0.0000,0.0000,0.7705,0.6374,0.0000 -0.0000,0.0000,0.0000,0.7902,0.6129,0.0000 -0.0000,0.0000,0.0000,0.8090,0.5878,0.0000 -0.0000,0.0000,0.0000,0.8271,0.5621,0.0000 -0.0000,0.0000,0.0000,0.8443,0.5358,0.0000 -0.0000,0.0000,0.0000,0.8607,0.5090,0.0000 -0.0000,0.0000,0.0000,0.8763,0.4818,0.0000 -0.0000,0.0000,0.0000,0.8910,0.4540,0.0000 -0.0000,0.0000,0.0000,0.9048,0.4258,0.0000 -0.0000,0.0000,0.0000,0.9178,0.3971,0.0000 -0.0000,0.0000,0.0000,0.9298,0.3681,0.0000 -0.0000,0.0000,0.0000,0.9409,0.3387,0.0000 -0.0000,0.0000,0.0000,0.9511,0.3090,0.0000 -0.0000,0.0000,0.0000,0.9603,0.2790,0.0000 -0.0000,0.0000,0.0000,0.9686,0.2487,0.0000 -0.0000,0.0000,0.0000,0.9759,0.2181,0.0000 -0.0000,0.0000,0.0000,0.9823,0.1874,0.0000 -0.0000,0.0000,0.0000,0.9877,0.1564,0.0000 -0.0000,0.0000,0.0000,0.9921,0.1253,0.0000 -0.0000,0.0000,0.0000,0.9956,0.0941,0.0000 -0.0000,0.0000,0.0000,0.9980,0.0628,0.0000 -0.0000,0.0000,0.0000,0.9995,0.0314,0.0000 -0.0000,0.0000,0.0000,1.0000,-0.0000,0.0000 diff --git a/scripts/trajectories/full-circle-4s-ccw-Vector3.csv b/scripts/trajectories/full-circle-4s-ccw-Vector3.csv deleted file mode 100644 index 37b2904ea4..0000000000 --- a/scripts/trajectories/full-circle-4s-ccw-Vector3.csv +++ /dev/null @@ -1,200 +0,0 @@ -0.0000,0.0000,0.0000,0.9995,0.0314,0.0000 -0.0000,0.0000,0.0000,0.9980,0.0628,0.0000 -0.0000,0.0000,0.0000,0.9956,0.0941,0.0000 -0.0000,0.0000,0.0000,0.9921,0.1253,0.0000 -0.0000,0.0000,0.0000,0.9877,0.1564,0.0000 -0.0000,0.0000,0.0000,0.9823,0.1874,0.0000 -0.0000,0.0000,0.0000,0.9759,0.2181,0.0000 -0.0000,0.0000,0.0000,0.9686,0.2487,0.0000 -0.0000,0.0000,0.0000,0.9603,0.2790,0.0000 -0.0000,0.0000,0.0000,0.9511,0.3090,0.0000 -0.0000,0.0000,0.0000,0.9409,0.3387,0.0000 -0.0000,0.0000,0.0000,0.9298,0.3681,0.0000 -0.0000,0.0000,0.0000,0.9178,0.3971,0.0000 -0.0000,0.0000,0.0000,0.9048,0.4258,0.0000 -0.0000,0.0000,0.0000,0.8910,0.4540,0.0000 -0.0000,0.0000,0.0000,0.8763,0.4818,0.0000 -0.0000,0.0000,0.0000,0.8607,0.5090,0.0000 -0.0000,0.0000,0.0000,0.8443,0.5358,0.0000 -0.0000,0.0000,0.0000,0.8271,0.5621,0.0000 -0.0000,0.0000,0.0000,0.8090,0.5878,0.0000 -0.0000,0.0000,0.0000,0.7902,0.6129,0.0000 -0.0000,0.0000,0.0000,0.7705,0.6374,0.0000 -0.0000,0.0000,0.0000,0.7501,0.6613,0.0000 -0.0000,0.0000,0.0000,0.7290,0.6845,0.0000 -0.0000,0.0000,0.0000,0.7071,0.7071,0.0000 -0.0000,0.0000,0.0000,0.6845,0.7290,0.0000 -0.0000,0.0000,0.0000,0.6613,0.7501,0.0000 -0.0000,0.0000,0.0000,0.6374,0.7705,0.0000 -0.0000,0.0000,0.0000,0.6129,0.7902,0.0000 -0.0000,0.0000,0.0000,0.5878,0.8090,0.0000 -0.0000,0.0000,0.0000,0.5621,0.8271,0.0000 -0.0000,0.0000,0.0000,0.5358,0.8443,0.0000 -0.0000,0.0000,0.0000,0.5090,0.8607,0.0000 -0.0000,0.0000,0.0000,0.4818,0.8763,0.0000 -0.0000,0.0000,0.0000,0.4540,0.8910,0.0000 -0.0000,0.0000,0.0000,0.4258,0.9048,0.0000 -0.0000,0.0000,0.0000,0.3971,0.9178,0.0000 -0.0000,0.0000,0.0000,0.3681,0.9298,0.0000 -0.0000,0.0000,0.0000,0.3387,0.9409,0.0000 -0.0000,0.0000,0.0000,0.3090,0.9511,0.0000 -0.0000,0.0000,0.0000,0.2790,0.9603,0.0000 -0.0000,0.0000,0.0000,0.2487,0.9686,0.0000 -0.0000,0.0000,0.0000,0.2181,0.9759,0.0000 -0.0000,0.0000,0.0000,0.1874,0.9823,0.0000 -0.0000,0.0000,0.0000,0.1564,0.9877,0.0000 -0.0000,0.0000,0.0000,0.1253,0.9921,0.0000 -0.0000,0.0000,0.0000,0.0941,0.9956,0.0000 -0.0000,0.0000,0.0000,0.0628,0.9980,0.0000 -0.0000,0.0000,0.0000,0.0314,0.9995,0.0000 -0.0000,0.0000,0.0000,-0.0000,1.0000,0.0000 -0.0000,0.0000,0.0000,-0.0314,0.9995,0.0000 -0.0000,0.0000,0.0000,-0.0628,0.9980,0.0000 -0.0000,0.0000,0.0000,-0.0941,0.9956,0.0000 -0.0000,0.0000,0.0000,-0.1253,0.9921,0.0000 -0.0000,0.0000,0.0000,-0.1564,0.9877,0.0000 -0.0000,0.0000,0.0000,-0.1874,0.9823,0.0000 -0.0000,0.0000,0.0000,-0.2181,0.9759,0.0000 -0.0000,0.0000,0.0000,-0.2487,0.9686,0.0000 -0.0000,0.0000,0.0000,-0.2790,0.9603,0.0000 -0.0000,0.0000,0.0000,-0.3090,0.9511,0.0000 -0.0000,0.0000,0.0000,-0.3387,0.9409,0.0000 -0.0000,0.0000,0.0000,-0.3681,0.9298,0.0000 -0.0000,0.0000,0.0000,-0.3971,0.9178,0.0000 -0.0000,0.0000,0.0000,-0.4258,0.9048,0.0000 -0.0000,0.0000,0.0000,-0.4540,0.8910,0.0000 -0.0000,0.0000,0.0000,-0.4818,0.8763,0.0000 -0.0000,0.0000,0.0000,-0.5090,0.8607,0.0000 -0.0000,0.0000,0.0000,-0.5358,0.8443,0.0000 -0.0000,0.0000,0.0000,-0.5621,0.8271,0.0000 -0.0000,0.0000,0.0000,-0.5878,0.8090,0.0000 -0.0000,0.0000,0.0000,-0.6129,0.7902,0.0000 -0.0000,0.0000,0.0000,-0.6374,0.7705,0.0000 -0.0000,0.0000,0.0000,-0.6613,0.7501,0.0000 -0.0000,0.0000,0.0000,-0.6845,0.7290,0.0000 -0.0000,0.0000,0.0000,-0.7071,0.7071,0.0000 -0.0000,0.0000,0.0000,-0.7290,0.6845,0.0000 -0.0000,0.0000,0.0000,-0.7501,0.6613,0.0000 -0.0000,0.0000,0.0000,-0.7705,0.6374,0.0000 -0.0000,0.0000,0.0000,-0.7902,0.6129,0.0000 -0.0000,0.0000,0.0000,-0.8090,0.5878,0.0000 -0.0000,0.0000,0.0000,-0.8271,0.5621,0.0000 -0.0000,0.0000,0.0000,-0.8443,0.5358,0.0000 -0.0000,0.0000,0.0000,-0.8607,0.5090,0.0000 -0.0000,0.0000,0.0000,-0.8763,0.4818,0.0000 -0.0000,0.0000,0.0000,-0.8910,0.4540,0.0000 -0.0000,0.0000,0.0000,-0.9048,0.4258,0.0000 -0.0000,0.0000,0.0000,-0.9178,0.3971,0.0000 -0.0000,0.0000,0.0000,-0.9298,0.3681,0.0000 -0.0000,0.0000,0.0000,-0.9409,0.3387,0.0000 -0.0000,0.0000,0.0000,-0.9511,0.3090,0.0000 -0.0000,0.0000,0.0000,-0.9603,0.2790,0.0000 -0.0000,0.0000,0.0000,-0.9686,0.2487,0.0000 -0.0000,0.0000,0.0000,-0.9759,0.2181,0.0000 -0.0000,0.0000,0.0000,-0.9823,0.1874,0.0000 -0.0000,0.0000,0.0000,-0.9877,0.1564,0.0000 -0.0000,0.0000,0.0000,-0.9921,0.1253,0.0000 -0.0000,0.0000,0.0000,-0.9956,0.0941,0.0000 -0.0000,0.0000,0.0000,-0.9980,0.0628,0.0000 -0.0000,0.0000,0.0000,-0.9995,0.0314,0.0000 -0.0000,0.0000,0.0000,-1.0000,-0.0000,0.0000 -0.0000,0.0000,0.0000,-0.9995,-0.0314,0.0000 -0.0000,0.0000,0.0000,-0.9980,-0.0628,0.0000 -0.0000,0.0000,0.0000,-0.9956,-0.0941,0.0000 -0.0000,0.0000,0.0000,-0.9921,-0.1253,0.0000 -0.0000,0.0000,0.0000,-0.9877,-0.1564,0.0000 -0.0000,0.0000,0.0000,-0.9823,-0.1874,0.0000 -0.0000,0.0000,0.0000,-0.9759,-0.2181,0.0000 -0.0000,0.0000,0.0000,-0.9686,-0.2487,0.0000 -0.0000,0.0000,0.0000,-0.9603,-0.2790,0.0000 -0.0000,0.0000,0.0000,-0.9511,-0.3090,0.0000 -0.0000,0.0000,0.0000,-0.9409,-0.3387,0.0000 -0.0000,0.0000,0.0000,-0.9298,-0.3681,0.0000 -0.0000,0.0000,0.0000,-0.9178,-0.3971,0.0000 -0.0000,0.0000,0.0000,-0.9048,-0.4258,0.0000 -0.0000,0.0000,0.0000,-0.8910,-0.4540,0.0000 -0.0000,0.0000,0.0000,-0.8763,-0.4818,0.0000 -0.0000,0.0000,0.0000,-0.8607,-0.5090,0.0000 -0.0000,0.0000,0.0000,-0.8443,-0.5358,0.0000 -0.0000,0.0000,0.0000,-0.8271,-0.5621,0.0000 -0.0000,0.0000,0.0000,-0.8090,-0.5878,0.0000 -0.0000,0.0000,0.0000,-0.7902,-0.6129,0.0000 -0.0000,0.0000,0.0000,-0.7705,-0.6374,0.0000 -0.0000,0.0000,0.0000,-0.7501,-0.6613,0.0000 -0.0000,0.0000,0.0000,-0.7290,-0.6845,0.0000 -0.0000,0.0000,0.0000,-0.7071,-0.7071,0.0000 -0.0000,0.0000,0.0000,-0.6845,-0.7290,0.0000 -0.0000,0.0000,0.0000,-0.6613,-0.7501,0.0000 -0.0000,0.0000,0.0000,-0.6374,-0.7705,0.0000 -0.0000,0.0000,0.0000,-0.6129,-0.7902,0.0000 -0.0000,0.0000,0.0000,-0.5878,-0.8090,0.0000 -0.0000,0.0000,0.0000,-0.5621,-0.8271,0.0000 -0.0000,0.0000,0.0000,-0.5358,-0.8443,0.0000 -0.0000,0.0000,0.0000,-0.5090,-0.8607,0.0000 -0.0000,0.0000,0.0000,-0.4818,-0.8763,0.0000 -0.0000,0.0000,0.0000,-0.4540,-0.8910,0.0000 -0.0000,0.0000,0.0000,-0.4258,-0.9048,0.0000 -0.0000,0.0000,0.0000,-0.3971,-0.9178,0.0000 -0.0000,0.0000,0.0000,-0.3681,-0.9298,0.0000 -0.0000,0.0000,0.0000,-0.3387,-0.9409,0.0000 -0.0000,0.0000,0.0000,-0.3090,-0.9511,0.0000 -0.0000,0.0000,0.0000,-0.2790,-0.9603,0.0000 -0.0000,0.0000,0.0000,-0.2487,-0.9686,0.0000 -0.0000,0.0000,0.0000,-0.2181,-0.9759,0.0000 -0.0000,0.0000,0.0000,-0.1874,-0.9823,0.0000 -0.0000,0.0000,0.0000,-0.1564,-0.9877,0.0000 -0.0000,0.0000,0.0000,-0.1253,-0.9921,0.0000 -0.0000,0.0000,0.0000,-0.0941,-0.9956,0.0000 -0.0000,0.0000,0.0000,-0.0628,-0.9980,0.0000 -0.0000,0.0000,0.0000,-0.0314,-0.9995,0.0000 -0.0000,0.0000,0.0000,0.0000,-1.0000,0.0000 -0.0000,0.0000,0.0000,0.0314,-0.9995,0.0000 -0.0000,0.0000,0.0000,0.0628,-0.9980,0.0000 -0.0000,0.0000,0.0000,0.0941,-0.9956,0.0000 -0.0000,0.0000,0.0000,0.1253,-0.9921,0.0000 -0.0000,0.0000,0.0000,0.1564,-0.9877,0.0000 -0.0000,0.0000,0.0000,0.1874,-0.9823,0.0000 -0.0000,0.0000,0.0000,0.2181,-0.9759,0.0000 -0.0000,0.0000,0.0000,0.2487,-0.9686,0.0000 -0.0000,0.0000,0.0000,0.2790,-0.9603,0.0000 -0.0000,0.0000,0.0000,0.3090,-0.9511,0.0000 -0.0000,0.0000,0.0000,0.3387,-0.9409,0.0000 -0.0000,0.0000,0.0000,0.3681,-0.9298,0.0000 -0.0000,0.0000,0.0000,0.3971,-0.9178,0.0000 -0.0000,0.0000,0.0000,0.4258,-0.9048,0.0000 -0.0000,0.0000,0.0000,0.4540,-0.8910,0.0000 -0.0000,0.0000,0.0000,0.4818,-0.8763,0.0000 -0.0000,0.0000,0.0000,0.5090,-0.8607,0.0000 -0.0000,0.0000,0.0000,0.5358,-0.8443,0.0000 -0.0000,0.0000,0.0000,0.5621,-0.8271,0.0000 -0.0000,0.0000,0.0000,0.5878,-0.8090,0.0000 -0.0000,0.0000,0.0000,0.6129,-0.7902,0.0000 -0.0000,0.0000,0.0000,0.6374,-0.7705,0.0000 -0.0000,0.0000,0.0000,0.6613,-0.7501,0.0000 -0.0000,0.0000,0.0000,0.6845,-0.7290,0.0000 -0.0000,0.0000,0.0000,0.7071,-0.7071,0.0000 -0.0000,0.0000,0.0000,0.7290,-0.6845,0.0000 -0.0000,0.0000,0.0000,0.7501,-0.6613,0.0000 -0.0000,0.0000,0.0000,0.7705,-0.6374,0.0000 -0.0000,0.0000,0.0000,0.7902,-0.6129,0.0000 -0.0000,0.0000,0.0000,0.8090,-0.5878,0.0000 -0.0000,0.0000,0.0000,0.8271,-0.5621,0.0000 -0.0000,0.0000,0.0000,0.8443,-0.5358,0.0000 -0.0000,0.0000,0.0000,0.8607,-0.5090,0.0000 -0.0000,0.0000,0.0000,0.8763,-0.4818,0.0000 -0.0000,0.0000,0.0000,0.8910,-0.4540,0.0000 -0.0000,0.0000,0.0000,0.9048,-0.4258,0.0000 -0.0000,0.0000,0.0000,0.9178,-0.3971,0.0000 -0.0000,0.0000,0.0000,0.9298,-0.3681,0.0000 -0.0000,0.0000,0.0000,0.9409,-0.3387,0.0000 -0.0000,0.0000,0.0000,0.9511,-0.3090,0.0000 -0.0000,0.0000,0.0000,0.9603,-0.2790,0.0000 -0.0000,0.0000,0.0000,0.9686,-0.2487,0.0000 -0.0000,0.0000,0.0000,0.9759,-0.2181,0.0000 -0.0000,0.0000,0.0000,0.9823,-0.1874,0.0000 -0.0000,0.0000,0.0000,0.9877,-0.1564,0.0000 -0.0000,0.0000,0.0000,0.9921,-0.1253,0.0000 -0.0000,0.0000,0.0000,0.9956,-0.0941,0.0000 -0.0000,0.0000,0.0000,0.9980,-0.0628,0.0000 -0.0000,0.0000,0.0000,0.9995,-0.0314,0.0000 -0.0000,0.0000,0.0000,1.0000,0.0000,0.0000 diff --git a/scripts/trajectories/full-circle-4s-ccw.csv b/scripts/trajectories/full-circle-4s-ccw.csv deleted file mode 100644 index 13eeae28e1..0000000000 --- a/scripts/trajectories/full-circle-4s-ccw.csv +++ /dev/null @@ -1,800 +0,0 @@ -0.9999,0.0000,0.0000,0.0157 -0.9999,0.0000,0.0000,0.0157 -0.9999,0.0000,0.0000,0.0157 -0.9999,0.0000,0.0000,0.0157 -0.9995,0.0000,0.0000,0.0314 -0.9995,0.0000,0.0000,0.0314 -0.9995,0.0000,0.0000,0.0314 -0.9995,0.0000,0.0000,0.0314 -0.9989,0.0000,0.0000,0.0471 -0.9989,0.0000,0.0000,0.0471 -0.9989,0.0000,0.0000,0.0471 -0.9989,0.0000,0.0000,0.0471 -0.9980,0.0000,0.0000,0.0628 -0.9980,0.0000,0.0000,0.0628 -0.9980,0.0000,0.0000,0.0628 -0.9980,0.0000,0.0000,0.0628 -0.9969,0.0000,0.0000,0.0785 -0.9969,0.0000,0.0000,0.0785 -0.9969,0.0000,0.0000,0.0785 -0.9969,0.0000,0.0000,0.0785 -0.9956,0.0000,0.0000,0.0941 -0.9956,0.0000,0.0000,0.0941 -0.9956,0.0000,0.0000,0.0941 -0.9956,0.0000,0.0000,0.0941 -0.9940,0.0000,0.0000,0.1097 -0.9940,0.0000,0.0000,0.1097 -0.9940,0.0000,0.0000,0.1097 -0.9940,0.0000,0.0000,0.1097 -0.9921,0.0000,0.0000,0.1253 -0.9921,0.0000,0.0000,0.1253 -0.9921,0.0000,0.0000,0.1253 -0.9921,0.0000,0.0000,0.1253 -0.9900,0.0000,0.0000,0.1409 -0.9900,0.0000,0.0000,0.1409 -0.9900,0.0000,0.0000,0.1409 -0.9900,0.0000,0.0000,0.1409 -0.9877,0.0000,0.0000,0.1564 -0.9877,0.0000,0.0000,0.1564 -0.9877,0.0000,0.0000,0.1564 -0.9877,0.0000,0.0000,0.1564 -0.9851,0.0000,0.0000,0.1719 -0.9851,0.0000,0.0000,0.1719 -0.9851,0.0000,0.0000,0.1719 -0.9851,0.0000,0.0000,0.1719 -0.9823,0.0000,0.0000,0.1874 -0.9823,0.0000,0.0000,0.1874 -0.9823,0.0000,0.0000,0.1874 -0.9823,0.0000,0.0000,0.1874 -0.9792,0.0000,0.0000,0.2028 -0.9792,0.0000,0.0000,0.2028 -0.9792,0.0000,0.0000,0.2028 -0.9792,0.0000,0.0000,0.2028 -0.9759,0.0000,0.0000,0.2181 -0.9759,0.0000,0.0000,0.2181 -0.9759,0.0000,0.0000,0.2181 -0.9759,0.0000,0.0000,0.2181 -0.9724,0.0000,0.0000,0.2334 -0.9724,0.0000,0.0000,0.2334 -0.9724,0.0000,0.0000,0.2334 -0.9724,0.0000,0.0000,0.2334 -0.9686,0.0000,0.0000,0.2487 -0.9686,0.0000,0.0000,0.2487 -0.9686,0.0000,0.0000,0.2487 -0.9686,0.0000,0.0000,0.2487 -0.9646,0.0000,0.0000,0.2639 -0.9646,0.0000,0.0000,0.2639 -0.9646,0.0000,0.0000,0.2639 -0.9646,0.0000,0.0000,0.2639 -0.9603,0.0000,0.0000,0.2790 -0.9603,0.0000,0.0000,0.2790 -0.9603,0.0000,0.0000,0.2790 -0.9603,0.0000,0.0000,0.2790 -0.9558,0.0000,0.0000,0.2940 -0.9558,0.0000,0.0000,0.2940 -0.9558,0.0000,0.0000,0.2940 -0.9558,0.0000,0.0000,0.2940 -0.9511,0.0000,0.0000,0.3090 -0.9511,0.0000,0.0000,0.3090 -0.9511,0.0000,0.0000,0.3090 -0.9511,0.0000,0.0000,0.3090 -0.9461,0.0000,0.0000,0.3239 -0.9461,0.0000,0.0000,0.3239 -0.9461,0.0000,0.0000,0.3239 -0.9461,0.0000,0.0000,0.3239 -0.9409,0.0000,0.0000,0.3387 -0.9409,0.0000,0.0000,0.3387 -0.9409,0.0000,0.0000,0.3387 -0.9409,0.0000,0.0000,0.3387 -0.9354,0.0000,0.0000,0.3535 -0.9354,0.0000,0.0000,0.3535 -0.9354,0.0000,0.0000,0.3535 -0.9354,0.0000,0.0000,0.3535 -0.9298,0.0000,0.0000,0.3681 -0.9298,0.0000,0.0000,0.3681 -0.9298,0.0000,0.0000,0.3681 -0.9298,0.0000,0.0000,0.3681 -0.9239,0.0000,0.0000,0.3827 -0.9239,0.0000,0.0000,0.3827 -0.9239,0.0000,0.0000,0.3827 -0.9239,0.0000,0.0000,0.3827 -0.9178,0.0000,0.0000,0.3971 -0.9178,0.0000,0.0000,0.3971 -0.9178,0.0000,0.0000,0.3971 -0.9178,0.0000,0.0000,0.3971 -0.9114,0.0000,0.0000,0.4115 -0.9114,0.0000,0.0000,0.4115 -0.9114,0.0000,0.0000,0.4115 -0.9114,0.0000,0.0000,0.4115 -0.9048,0.0000,0.0000,0.4258 -0.9048,0.0000,0.0000,0.4258 -0.9048,0.0000,0.0000,0.4258 -0.9048,0.0000,0.0000,0.4258 -0.8980,0.0000,0.0000,0.4399 -0.8980,0.0000,0.0000,0.4399 -0.8980,0.0000,0.0000,0.4399 -0.8980,0.0000,0.0000,0.4399 -0.8910,0.0000,0.0000,0.4540 -0.8910,0.0000,0.0000,0.4540 -0.8910,0.0000,0.0000,0.4540 -0.8910,0.0000,0.0000,0.4540 -0.8838,0.0000,0.0000,0.4679 -0.8838,0.0000,0.0000,0.4679 -0.8838,0.0000,0.0000,0.4679 -0.8838,0.0000,0.0000,0.4679 -0.8763,0.0000,0.0000,0.4818 -0.8763,0.0000,0.0000,0.4818 -0.8763,0.0000,0.0000,0.4818 -0.8763,0.0000,0.0000,0.4818 -0.8686,0.0000,0.0000,0.4955 -0.8686,0.0000,0.0000,0.4955 -0.8686,0.0000,0.0000,0.4955 -0.8686,0.0000,0.0000,0.4955 -0.8607,0.0000,0.0000,0.5090 -0.8607,0.0000,0.0000,0.5090 -0.8607,0.0000,0.0000,0.5090 -0.8607,0.0000,0.0000,0.5090 -0.8526,0.0000,0.0000,0.5225 -0.8526,0.0000,0.0000,0.5225 -0.8526,0.0000,0.0000,0.5225 -0.8526,0.0000,0.0000,0.5225 -0.8443,0.0000,0.0000,0.5358 -0.8443,0.0000,0.0000,0.5358 -0.8443,0.0000,0.0000,0.5358 -0.8443,0.0000,0.0000,0.5358 -0.8358,0.0000,0.0000,0.5490 -0.8358,0.0000,0.0000,0.5490 -0.8358,0.0000,0.0000,0.5490 -0.8358,0.0000,0.0000,0.5490 -0.8271,0.0000,0.0000,0.5621 -0.8271,0.0000,0.0000,0.5621 -0.8271,0.0000,0.0000,0.5621 -0.8271,0.0000,0.0000,0.5621 -0.8181,0.0000,0.0000,0.5750 -0.8181,0.0000,0.0000,0.5750 -0.8181,0.0000,0.0000,0.5750 -0.8181,0.0000,0.0000,0.5750 -0.8090,0.0000,0.0000,0.5878 -0.8090,0.0000,0.0000,0.5878 -0.8090,0.0000,0.0000,0.5878 -0.8090,0.0000,0.0000,0.5878 -0.7997,0.0000,0.0000,0.6004 -0.7997,0.0000,0.0000,0.6004 -0.7997,0.0000,0.0000,0.6004 -0.7997,0.0000,0.0000,0.6004 -0.7902,0.0000,0.0000,0.6129 -0.7902,0.0000,0.0000,0.6129 -0.7902,0.0000,0.0000,0.6129 -0.7902,0.0000,0.0000,0.6129 -0.7804,0.0000,0.0000,0.6252 -0.7804,0.0000,0.0000,0.6252 -0.7804,0.0000,0.0000,0.6252 -0.7804,0.0000,0.0000,0.6252 -0.7705,0.0000,0.0000,0.6374 -0.7705,0.0000,0.0000,0.6374 -0.7705,0.0000,0.0000,0.6374 -0.7705,0.0000,0.0000,0.6374 -0.7604,0.0000,0.0000,0.6494 -0.7604,0.0000,0.0000,0.6494 -0.7604,0.0000,0.0000,0.6494 -0.7604,0.0000,0.0000,0.6494 -0.7501,0.0000,0.0000,0.6613 -0.7501,0.0000,0.0000,0.6613 -0.7501,0.0000,0.0000,0.6613 -0.7501,0.0000,0.0000,0.6613 -0.7396,0.0000,0.0000,0.6730 -0.7396,0.0000,0.0000,0.6730 -0.7396,0.0000,0.0000,0.6730 -0.7396,0.0000,0.0000,0.6730 -0.7290,0.0000,0.0000,0.6845 -0.7290,0.0000,0.0000,0.6845 -0.7290,0.0000,0.0000,0.6845 -0.7290,0.0000,0.0000,0.6845 -0.7181,0.0000,0.0000,0.6959 -0.7181,0.0000,0.0000,0.6959 -0.7181,0.0000,0.0000,0.6959 -0.7181,0.0000,0.0000,0.6959 -0.7071,0.0000,0.0000,0.7071 -0.7071,0.0000,0.0000,0.7071 -0.7071,0.0000,0.0000,0.7071 -0.7071,0.0000,0.0000,0.7071 -0.6959,0.0000,0.0000,0.7181 -0.6959,0.0000,0.0000,0.7181 -0.6959,0.0000,0.0000,0.7181 -0.6959,0.0000,0.0000,0.7181 -0.6845,0.0000,0.0000,0.7290 -0.6845,0.0000,0.0000,0.7290 -0.6845,0.0000,0.0000,0.7290 -0.6845,0.0000,0.0000,0.7290 -0.6730,0.0000,0.0000,0.7396 -0.6730,0.0000,0.0000,0.7396 -0.6730,0.0000,0.0000,0.7396 -0.6730,0.0000,0.0000,0.7396 -0.6613,0.0000,0.0000,0.7501 -0.6613,0.0000,0.0000,0.7501 -0.6613,0.0000,0.0000,0.7501 -0.6613,0.0000,0.0000,0.7501 -0.6494,0.0000,0.0000,0.7604 -0.6494,0.0000,0.0000,0.7604 -0.6494,0.0000,0.0000,0.7604 -0.6494,0.0000,0.0000,0.7604 -0.6374,0.0000,0.0000,0.7705 -0.6374,0.0000,0.0000,0.7705 -0.6374,0.0000,0.0000,0.7705 -0.6374,0.0000,0.0000,0.7705 -0.6252,0.0000,0.0000,0.7804 -0.6252,0.0000,0.0000,0.7804 -0.6252,0.0000,0.0000,0.7804 -0.6252,0.0000,0.0000,0.7804 -0.6129,0.0000,0.0000,0.7902 -0.6129,0.0000,0.0000,0.7902 -0.6129,0.0000,0.0000,0.7902 -0.6129,0.0000,0.0000,0.7902 -0.6004,0.0000,0.0000,0.7997 -0.6004,0.0000,0.0000,0.7997 -0.6004,0.0000,0.0000,0.7997 -0.6004,0.0000,0.0000,0.7997 -0.5878,0.0000,0.0000,0.8090 -0.5878,0.0000,0.0000,0.8090 -0.5878,0.0000,0.0000,0.8090 -0.5878,0.0000,0.0000,0.8090 -0.5750,0.0000,0.0000,0.8181 -0.5750,0.0000,0.0000,0.8181 -0.5750,0.0000,0.0000,0.8181 -0.5750,0.0000,0.0000,0.8181 -0.5621,0.0000,0.0000,0.8271 -0.5621,0.0000,0.0000,0.8271 -0.5621,0.0000,0.0000,0.8271 -0.5621,0.0000,0.0000,0.8271 -0.5490,0.0000,0.0000,0.8358 -0.5490,0.0000,0.0000,0.8358 -0.5490,0.0000,0.0000,0.8358 -0.5490,0.0000,0.0000,0.8358 -0.5358,0.0000,0.0000,0.8443 -0.5358,0.0000,0.0000,0.8443 -0.5358,0.0000,0.0000,0.8443 -0.5358,0.0000,0.0000,0.8443 -0.5225,0.0000,0.0000,0.8526 -0.5225,0.0000,0.0000,0.8526 -0.5225,0.0000,0.0000,0.8526 -0.5225,0.0000,0.0000,0.8526 -0.5090,0.0000,0.0000,0.8607 -0.5090,0.0000,0.0000,0.8607 -0.5090,0.0000,0.0000,0.8607 -0.5090,0.0000,0.0000,0.8607 -0.4955,0.0000,0.0000,0.8686 -0.4955,0.0000,0.0000,0.8686 -0.4955,0.0000,0.0000,0.8686 -0.4955,0.0000,0.0000,0.8686 -0.4818,0.0000,0.0000,0.8763 -0.4818,0.0000,0.0000,0.8763 -0.4818,0.0000,0.0000,0.8763 -0.4818,0.0000,0.0000,0.8763 -0.4679,0.0000,0.0000,0.8838 -0.4679,0.0000,0.0000,0.8838 -0.4679,0.0000,0.0000,0.8838 -0.4679,0.0000,0.0000,0.8838 -0.4540,0.0000,0.0000,0.8910 -0.4540,0.0000,0.0000,0.8910 -0.4540,0.0000,0.0000,0.8910 -0.4540,0.0000,0.0000,0.8910 -0.4399,0.0000,0.0000,0.8980 -0.4399,0.0000,0.0000,0.8980 -0.4399,0.0000,0.0000,0.8980 -0.4399,0.0000,0.0000,0.8980 -0.4258,0.0000,0.0000,0.9048 -0.4258,0.0000,0.0000,0.9048 -0.4258,0.0000,0.0000,0.9048 -0.4258,0.0000,0.0000,0.9048 -0.4115,0.0000,0.0000,0.9114 -0.4115,0.0000,0.0000,0.9114 -0.4115,0.0000,0.0000,0.9114 -0.4115,0.0000,0.0000,0.9114 -0.3971,0.0000,0.0000,0.9178 -0.3971,0.0000,0.0000,0.9178 -0.3971,0.0000,0.0000,0.9178 -0.3971,0.0000,0.0000,0.9178 -0.3827,0.0000,0.0000,0.9239 -0.3827,0.0000,0.0000,0.9239 -0.3827,0.0000,0.0000,0.9239 -0.3827,0.0000,0.0000,0.9239 -0.3681,0.0000,0.0000,0.9298 -0.3681,0.0000,0.0000,0.9298 -0.3681,0.0000,0.0000,0.9298 -0.3681,0.0000,0.0000,0.9298 -0.3535,0.0000,0.0000,0.9354 -0.3535,0.0000,0.0000,0.9354 -0.3535,0.0000,0.0000,0.9354 -0.3535,0.0000,0.0000,0.9354 -0.3387,0.0000,0.0000,0.9409 -0.3387,0.0000,0.0000,0.9409 -0.3387,0.0000,0.0000,0.9409 -0.3387,0.0000,0.0000,0.9409 -0.3239,0.0000,0.0000,0.9461 -0.3239,0.0000,0.0000,0.9461 -0.3239,0.0000,0.0000,0.9461 -0.3239,0.0000,0.0000,0.9461 -0.3090,0.0000,0.0000,0.9511 -0.3090,0.0000,0.0000,0.9511 -0.3090,0.0000,0.0000,0.9511 -0.3090,0.0000,0.0000,0.9511 -0.2940,0.0000,0.0000,0.9558 -0.2940,0.0000,0.0000,0.9558 -0.2940,0.0000,0.0000,0.9558 -0.2940,0.0000,0.0000,0.9558 -0.2790,0.0000,0.0000,0.9603 -0.2790,0.0000,0.0000,0.9603 -0.2790,0.0000,0.0000,0.9603 -0.2790,0.0000,0.0000,0.9603 -0.2639,0.0000,0.0000,0.9646 -0.2639,0.0000,0.0000,0.9646 -0.2639,0.0000,0.0000,0.9646 -0.2639,0.0000,0.0000,0.9646 -0.2487,0.0000,0.0000,0.9686 -0.2487,0.0000,0.0000,0.9686 -0.2487,0.0000,0.0000,0.9686 -0.2487,0.0000,0.0000,0.9686 -0.2334,0.0000,0.0000,0.9724 -0.2334,0.0000,0.0000,0.9724 -0.2334,0.0000,0.0000,0.9724 -0.2334,0.0000,0.0000,0.9724 -0.2181,0.0000,0.0000,0.9759 -0.2181,0.0000,0.0000,0.9759 -0.2181,0.0000,0.0000,0.9759 -0.2181,0.0000,0.0000,0.9759 -0.2028,0.0000,0.0000,0.9792 -0.2028,0.0000,0.0000,0.9792 -0.2028,0.0000,0.0000,0.9792 -0.2028,0.0000,0.0000,0.9792 -0.1874,0.0000,0.0000,0.9823 -0.1874,0.0000,0.0000,0.9823 -0.1874,0.0000,0.0000,0.9823 -0.1874,0.0000,0.0000,0.9823 -0.1719,0.0000,0.0000,0.9851 -0.1719,0.0000,0.0000,0.9851 -0.1719,0.0000,0.0000,0.9851 -0.1719,0.0000,0.0000,0.9851 -0.1564,0.0000,0.0000,0.9877 -0.1564,0.0000,0.0000,0.9877 -0.1564,0.0000,0.0000,0.9877 -0.1564,0.0000,0.0000,0.9877 -0.1409,0.0000,0.0000,0.9900 -0.1409,0.0000,0.0000,0.9900 -0.1409,0.0000,0.0000,0.9900 -0.1409,0.0000,0.0000,0.9900 -0.1253,0.0000,0.0000,0.9921 -0.1253,0.0000,0.0000,0.9921 -0.1253,0.0000,0.0000,0.9921 -0.1253,0.0000,0.0000,0.9921 -0.1097,0.0000,0.0000,0.9940 -0.1097,0.0000,0.0000,0.9940 -0.1097,0.0000,0.0000,0.9940 -0.1097,0.0000,0.0000,0.9940 -0.0941,0.0000,0.0000,0.9956 -0.0941,0.0000,0.0000,0.9956 -0.0941,0.0000,0.0000,0.9956 -0.0941,0.0000,0.0000,0.9956 -0.0785,0.0000,0.0000,0.9969 -0.0785,0.0000,0.0000,0.9969 -0.0785,0.0000,0.0000,0.9969 -0.0785,0.0000,0.0000,0.9969 -0.0628,0.0000,0.0000,0.9980 -0.0628,0.0000,0.0000,0.9980 -0.0628,0.0000,0.0000,0.9980 -0.0628,0.0000,0.0000,0.9980 -0.0471,0.0000,0.0000,0.9989 -0.0471,0.0000,0.0000,0.9989 -0.0471,0.0000,0.0000,0.9989 -0.0471,0.0000,0.0000,0.9989 -0.0314,0.0000,0.0000,0.9995 -0.0314,0.0000,0.0000,0.9995 -0.0314,0.0000,0.0000,0.9995 -0.0314,0.0000,0.0000,0.9995 -0.0157,0.0000,0.0000,0.9999 -0.0157,0.0000,0.0000,0.9999 -0.0157,0.0000,0.0000,0.9999 -0.0157,0.0000,0.0000,0.9999 --0.0000,0.0000,0.0000,1.0000 --0.0000,0.0000,0.0000,1.0000 --0.0000,0.0000,0.0000,1.0000 --0.0000,0.0000,0.0000,1.0000 --0.0157,0.0000,0.0000,0.9999 --0.0157,0.0000,0.0000,0.9999 --0.0157,0.0000,0.0000,0.9999 --0.0157,0.0000,0.0000,0.9999 --0.0314,0.0000,0.0000,0.9995 --0.0314,0.0000,0.0000,0.9995 --0.0314,0.0000,0.0000,0.9995 --0.0314,0.0000,0.0000,0.9995 --0.0471,0.0000,0.0000,0.9989 --0.0471,0.0000,0.0000,0.9989 --0.0471,0.0000,0.0000,0.9989 --0.0471,0.0000,0.0000,0.9989 --0.0628,0.0000,0.0000,0.9980 --0.0628,0.0000,0.0000,0.9980 --0.0628,0.0000,0.0000,0.9980 --0.0628,0.0000,0.0000,0.9980 --0.0785,0.0000,0.0000,0.9969 --0.0785,0.0000,0.0000,0.9969 --0.0785,0.0000,0.0000,0.9969 --0.0785,0.0000,0.0000,0.9969 --0.0941,0.0000,0.0000,0.9956 --0.0941,0.0000,0.0000,0.9956 --0.0941,0.0000,0.0000,0.9956 --0.0941,0.0000,0.0000,0.9956 --0.1097,0.0000,0.0000,0.9940 --0.1097,0.0000,0.0000,0.9940 --0.1097,0.0000,0.0000,0.9940 --0.1097,0.0000,0.0000,0.9940 --0.1253,0.0000,0.0000,0.9921 --0.1253,0.0000,0.0000,0.9921 --0.1253,0.0000,0.0000,0.9921 --0.1253,0.0000,0.0000,0.9921 --0.1409,0.0000,0.0000,0.9900 --0.1409,0.0000,0.0000,0.9900 --0.1409,0.0000,0.0000,0.9900 --0.1409,0.0000,0.0000,0.9900 --0.1564,0.0000,0.0000,0.9877 --0.1564,0.0000,0.0000,0.9877 --0.1564,0.0000,0.0000,0.9877 --0.1564,0.0000,0.0000,0.9877 --0.1719,0.0000,0.0000,0.9851 --0.1719,0.0000,0.0000,0.9851 --0.1719,0.0000,0.0000,0.9851 --0.1719,0.0000,0.0000,0.9851 --0.1874,0.0000,0.0000,0.9823 --0.1874,0.0000,0.0000,0.9823 --0.1874,0.0000,0.0000,0.9823 --0.1874,0.0000,0.0000,0.9823 --0.2028,0.0000,0.0000,0.9792 --0.2028,0.0000,0.0000,0.9792 --0.2028,0.0000,0.0000,0.9792 --0.2028,0.0000,0.0000,0.9792 --0.2181,0.0000,0.0000,0.9759 --0.2181,0.0000,0.0000,0.9759 --0.2181,0.0000,0.0000,0.9759 --0.2181,0.0000,0.0000,0.9759 --0.2334,0.0000,0.0000,0.9724 --0.2334,0.0000,0.0000,0.9724 --0.2334,0.0000,0.0000,0.9724 --0.2334,0.0000,0.0000,0.9724 --0.2487,0.0000,0.0000,0.9686 --0.2487,0.0000,0.0000,0.9686 --0.2487,0.0000,0.0000,0.9686 --0.2487,0.0000,0.0000,0.9686 --0.2639,0.0000,0.0000,0.9646 --0.2639,0.0000,0.0000,0.9646 --0.2639,0.0000,0.0000,0.9646 --0.2639,0.0000,0.0000,0.9646 --0.2790,0.0000,0.0000,0.9603 --0.2790,0.0000,0.0000,0.9603 --0.2790,0.0000,0.0000,0.9603 --0.2790,0.0000,0.0000,0.9603 --0.2940,0.0000,0.0000,0.9558 --0.2940,0.0000,0.0000,0.9558 --0.2940,0.0000,0.0000,0.9558 --0.2940,0.0000,0.0000,0.9558 --0.3090,0.0000,0.0000,0.9511 --0.3090,0.0000,0.0000,0.9511 --0.3090,0.0000,0.0000,0.9511 --0.3090,0.0000,0.0000,0.9511 --0.3239,0.0000,0.0000,0.9461 --0.3239,0.0000,0.0000,0.9461 --0.3239,0.0000,0.0000,0.9461 --0.3239,0.0000,0.0000,0.9461 --0.3387,0.0000,0.0000,0.9409 --0.3387,0.0000,0.0000,0.9409 --0.3387,0.0000,0.0000,0.9409 --0.3387,0.0000,0.0000,0.9409 --0.3535,0.0000,0.0000,0.9354 --0.3535,0.0000,0.0000,0.9354 --0.3535,0.0000,0.0000,0.9354 --0.3535,0.0000,0.0000,0.9354 --0.3681,0.0000,0.0000,0.9298 --0.3681,0.0000,0.0000,0.9298 --0.3681,0.0000,0.0000,0.9298 --0.3681,0.0000,0.0000,0.9298 --0.3827,0.0000,0.0000,0.9239 --0.3827,0.0000,0.0000,0.9239 --0.3827,0.0000,0.0000,0.9239 --0.3827,0.0000,0.0000,0.9239 --0.3971,0.0000,0.0000,0.9178 --0.3971,0.0000,0.0000,0.9178 --0.3971,0.0000,0.0000,0.9178 --0.3971,0.0000,0.0000,0.9178 --0.4115,0.0000,0.0000,0.9114 --0.4115,0.0000,0.0000,0.9114 --0.4115,0.0000,0.0000,0.9114 --0.4115,0.0000,0.0000,0.9114 --0.4258,0.0000,0.0000,0.9048 --0.4258,0.0000,0.0000,0.9048 --0.4258,0.0000,0.0000,0.9048 --0.4258,0.0000,0.0000,0.9048 --0.4399,0.0000,0.0000,0.8980 --0.4399,0.0000,0.0000,0.8980 --0.4399,0.0000,0.0000,0.8980 --0.4399,0.0000,0.0000,0.8980 --0.4540,0.0000,0.0000,0.8910 --0.4540,0.0000,0.0000,0.8910 --0.4540,0.0000,0.0000,0.8910 --0.4540,0.0000,0.0000,0.8910 --0.4679,0.0000,0.0000,0.8838 --0.4679,0.0000,0.0000,0.8838 --0.4679,0.0000,0.0000,0.8838 --0.4679,0.0000,0.0000,0.8838 --0.4818,0.0000,0.0000,0.8763 --0.4818,0.0000,0.0000,0.8763 --0.4818,0.0000,0.0000,0.8763 --0.4818,0.0000,0.0000,0.8763 --0.4955,0.0000,0.0000,0.8686 --0.4955,0.0000,0.0000,0.8686 --0.4955,0.0000,0.0000,0.8686 --0.4955,0.0000,0.0000,0.8686 --0.5090,0.0000,0.0000,0.8607 --0.5090,0.0000,0.0000,0.8607 --0.5090,0.0000,0.0000,0.8607 --0.5090,0.0000,0.0000,0.8607 --0.5225,0.0000,0.0000,0.8526 --0.5225,0.0000,0.0000,0.8526 --0.5225,0.0000,0.0000,0.8526 --0.5225,0.0000,0.0000,0.8526 --0.5358,0.0000,0.0000,0.8443 --0.5358,0.0000,0.0000,0.8443 --0.5358,0.0000,0.0000,0.8443 --0.5358,0.0000,0.0000,0.8443 --0.5490,0.0000,0.0000,0.8358 --0.5490,0.0000,0.0000,0.8358 --0.5490,0.0000,0.0000,0.8358 --0.5490,0.0000,0.0000,0.8358 --0.5621,0.0000,0.0000,0.8271 --0.5621,0.0000,0.0000,0.8271 --0.5621,0.0000,0.0000,0.8271 --0.5621,0.0000,0.0000,0.8271 --0.5750,0.0000,0.0000,0.8181 --0.5750,0.0000,0.0000,0.8181 --0.5750,0.0000,0.0000,0.8181 --0.5750,0.0000,0.0000,0.8181 --0.5878,0.0000,0.0000,0.8090 --0.5878,0.0000,0.0000,0.8090 --0.5878,0.0000,0.0000,0.8090 --0.5878,0.0000,0.0000,0.8090 --0.6004,0.0000,0.0000,0.7997 --0.6004,0.0000,0.0000,0.7997 --0.6004,0.0000,0.0000,0.7997 --0.6004,0.0000,0.0000,0.7997 --0.6129,0.0000,0.0000,0.7902 --0.6129,0.0000,0.0000,0.7902 --0.6129,0.0000,0.0000,0.7902 --0.6129,0.0000,0.0000,0.7902 --0.6252,0.0000,0.0000,0.7804 --0.6252,0.0000,0.0000,0.7804 --0.6252,0.0000,0.0000,0.7804 --0.6252,0.0000,0.0000,0.7804 --0.6374,0.0000,0.0000,0.7705 --0.6374,0.0000,0.0000,0.7705 --0.6374,0.0000,0.0000,0.7705 --0.6374,0.0000,0.0000,0.7705 --0.6494,0.0000,0.0000,0.7604 --0.6494,0.0000,0.0000,0.7604 --0.6494,0.0000,0.0000,0.7604 --0.6494,0.0000,0.0000,0.7604 --0.6613,0.0000,0.0000,0.7501 --0.6613,0.0000,0.0000,0.7501 --0.6613,0.0000,0.0000,0.7501 --0.6613,0.0000,0.0000,0.7501 --0.6730,0.0000,0.0000,0.7396 --0.6730,0.0000,0.0000,0.7396 --0.6730,0.0000,0.0000,0.7396 --0.6730,0.0000,0.0000,0.7396 --0.6845,0.0000,0.0000,0.7290 --0.6845,0.0000,0.0000,0.7290 --0.6845,0.0000,0.0000,0.7290 --0.6845,0.0000,0.0000,0.7290 --0.6959,0.0000,0.0000,0.7181 --0.6959,0.0000,0.0000,0.7181 --0.6959,0.0000,0.0000,0.7181 --0.6959,0.0000,0.0000,0.7181 --0.7071,0.0000,0.0000,0.7071 --0.7071,0.0000,0.0000,0.7071 --0.7071,0.0000,0.0000,0.7071 --0.7071,0.0000,0.0000,0.7071 --0.7181,0.0000,0.0000,0.6959 --0.7181,0.0000,0.0000,0.6959 --0.7181,0.0000,0.0000,0.6959 --0.7181,0.0000,0.0000,0.6959 --0.7290,0.0000,0.0000,0.6845 --0.7290,0.0000,0.0000,0.6845 --0.7290,0.0000,0.0000,0.6845 --0.7290,0.0000,0.0000,0.6845 --0.7396,0.0000,0.0000,0.6730 --0.7396,0.0000,0.0000,0.6730 --0.7396,0.0000,0.0000,0.6730 --0.7396,0.0000,0.0000,0.6730 --0.7501,0.0000,0.0000,0.6613 --0.7501,0.0000,0.0000,0.6613 --0.7501,0.0000,0.0000,0.6613 --0.7501,0.0000,0.0000,0.6613 --0.7604,0.0000,0.0000,0.6494 --0.7604,0.0000,0.0000,0.6494 --0.7604,0.0000,0.0000,0.6494 --0.7604,0.0000,0.0000,0.6494 --0.7705,0.0000,0.0000,0.6374 --0.7705,0.0000,0.0000,0.6374 --0.7705,0.0000,0.0000,0.6374 --0.7705,0.0000,0.0000,0.6374 --0.7804,0.0000,0.0000,0.6252 --0.7804,0.0000,0.0000,0.6252 --0.7804,0.0000,0.0000,0.6252 --0.7804,0.0000,0.0000,0.6252 --0.7902,0.0000,0.0000,0.6129 --0.7902,0.0000,0.0000,0.6129 --0.7902,0.0000,0.0000,0.6129 --0.7902,0.0000,0.0000,0.6129 --0.7997,0.0000,0.0000,0.6004 --0.7997,0.0000,0.0000,0.6004 --0.7997,0.0000,0.0000,0.6004 --0.7997,0.0000,0.0000,0.6004 --0.8090,0.0000,0.0000,0.5878 --0.8090,0.0000,0.0000,0.5878 --0.8090,0.0000,0.0000,0.5878 --0.8090,0.0000,0.0000,0.5878 --0.8182,0.0000,0.0000,0.5750 --0.8182,0.0000,0.0000,0.5750 --0.8182,0.0000,0.0000,0.5750 --0.8182,0.0000,0.0000,0.5750 --0.8271,0.0000,0.0000,0.5621 --0.8271,0.0000,0.0000,0.5621 --0.8271,0.0000,0.0000,0.5621 --0.8271,0.0000,0.0000,0.5621 --0.8358,0.0000,0.0000,0.5490 --0.8358,0.0000,0.0000,0.5490 --0.8358,0.0000,0.0000,0.5490 --0.8358,0.0000,0.0000,0.5490 --0.8443,0.0000,0.0000,0.5358 --0.8443,0.0000,0.0000,0.5358 --0.8443,0.0000,0.0000,0.5358 --0.8443,0.0000,0.0000,0.5358 --0.8526,0.0000,0.0000,0.5225 --0.8526,0.0000,0.0000,0.5225 --0.8526,0.0000,0.0000,0.5225 --0.8526,0.0000,0.0000,0.5225 --0.8607,0.0000,0.0000,0.5090 --0.8607,0.0000,0.0000,0.5090 --0.8607,0.0000,0.0000,0.5090 --0.8607,0.0000,0.0000,0.5090 --0.8686,0.0000,0.0000,0.4955 --0.8686,0.0000,0.0000,0.4955 --0.8686,0.0000,0.0000,0.4955 --0.8686,0.0000,0.0000,0.4955 --0.8763,0.0000,0.0000,0.4818 --0.8763,0.0000,0.0000,0.4818 --0.8763,0.0000,0.0000,0.4818 --0.8763,0.0000,0.0000,0.4818 --0.8838,0.0000,0.0000,0.4679 --0.8838,0.0000,0.0000,0.4679 --0.8838,0.0000,0.0000,0.4679 --0.8838,0.0000,0.0000,0.4679 --0.8910,0.0000,0.0000,0.4540 --0.8910,0.0000,0.0000,0.4540 --0.8910,0.0000,0.0000,0.4540 --0.8910,0.0000,0.0000,0.4540 --0.8980,0.0000,0.0000,0.4399 --0.8980,0.0000,0.0000,0.4399 --0.8980,0.0000,0.0000,0.4399 --0.8980,0.0000,0.0000,0.4399 --0.9048,0.0000,0.0000,0.4258 --0.9048,0.0000,0.0000,0.4258 --0.9048,0.0000,0.0000,0.4258 --0.9048,0.0000,0.0000,0.4258 --0.9114,0.0000,0.0000,0.4115 --0.9114,0.0000,0.0000,0.4115 --0.9114,0.0000,0.0000,0.4115 --0.9114,0.0000,0.0000,0.4115 --0.9178,0.0000,0.0000,0.3971 --0.9178,0.0000,0.0000,0.3971 --0.9178,0.0000,0.0000,0.3971 --0.9178,0.0000,0.0000,0.3971 --0.9239,0.0000,0.0000,0.3827 --0.9239,0.0000,0.0000,0.3827 --0.9239,0.0000,0.0000,0.3827 --0.9239,0.0000,0.0000,0.3827 --0.9298,0.0000,0.0000,0.3681 --0.9298,0.0000,0.0000,0.3681 --0.9298,0.0000,0.0000,0.3681 --0.9298,0.0000,0.0000,0.3681 --0.9354,0.0000,0.0000,0.3535 --0.9354,0.0000,0.0000,0.3535 --0.9354,0.0000,0.0000,0.3535 --0.9354,0.0000,0.0000,0.3535 --0.9409,0.0000,0.0000,0.3387 --0.9409,0.0000,0.0000,0.3387 --0.9409,0.0000,0.0000,0.3387 --0.9409,0.0000,0.0000,0.3387 --0.9461,0.0000,0.0000,0.3239 --0.9461,0.0000,0.0000,0.3239 --0.9461,0.0000,0.0000,0.3239 --0.9461,0.0000,0.0000,0.3239 --0.9511,0.0000,0.0000,0.3090 --0.9511,0.0000,0.0000,0.3090 --0.9511,0.0000,0.0000,0.3090 --0.9511,0.0000,0.0000,0.3090 --0.9558,0.0000,0.0000,0.2940 --0.9558,0.0000,0.0000,0.2940 --0.9558,0.0000,0.0000,0.2940 --0.9558,0.0000,0.0000,0.2940 --0.9603,0.0000,0.0000,0.2790 --0.9603,0.0000,0.0000,0.2790 --0.9603,0.0000,0.0000,0.2790 --0.9603,0.0000,0.0000,0.2790 --0.9646,0.0000,0.0000,0.2639 --0.9646,0.0000,0.0000,0.2639 --0.9646,0.0000,0.0000,0.2639 --0.9646,0.0000,0.0000,0.2639 --0.9686,0.0000,0.0000,0.2487 --0.9686,0.0000,0.0000,0.2487 --0.9686,0.0000,0.0000,0.2487 --0.9686,0.0000,0.0000,0.2487 --0.9724,0.0000,0.0000,0.2334 --0.9724,0.0000,0.0000,0.2334 --0.9724,0.0000,0.0000,0.2334 --0.9724,0.0000,0.0000,0.2334 --0.9759,0.0000,0.0000,0.2181 --0.9759,0.0000,0.0000,0.2181 --0.9759,0.0000,0.0000,0.2181 --0.9759,0.0000,0.0000,0.2181 --0.9792,0.0000,0.0000,0.2028 --0.9792,0.0000,0.0000,0.2028 --0.9792,0.0000,0.0000,0.2028 --0.9792,0.0000,0.0000,0.2028 --0.9823,0.0000,0.0000,0.1874 --0.9823,0.0000,0.0000,0.1874 --0.9823,0.0000,0.0000,0.1874 --0.9823,0.0000,0.0000,0.1874 --0.9851,0.0000,0.0000,0.1719 --0.9851,0.0000,0.0000,0.1719 --0.9851,0.0000,0.0000,0.1719 --0.9851,0.0000,0.0000,0.1719 --0.9877,0.0000,0.0000,0.1564 --0.9877,0.0000,0.0000,0.1564 --0.9877,0.0000,0.0000,0.1564 --0.9877,0.0000,0.0000,0.1564 --0.9900,0.0000,0.0000,0.1409 --0.9900,0.0000,0.0000,0.1409 --0.9900,0.0000,0.0000,0.1409 --0.9900,0.0000,0.0000,0.1409 --0.9921,0.0000,0.0000,0.1253 --0.9921,0.0000,0.0000,0.1253 --0.9921,0.0000,0.0000,0.1253 --0.9921,0.0000,0.0000,0.1253 --0.9940,0.0000,0.0000,0.1097 --0.9940,0.0000,0.0000,0.1097 --0.9940,0.0000,0.0000,0.1097 --0.9940,0.0000,0.0000,0.1097 --0.9956,0.0000,0.0000,0.0941 --0.9956,0.0000,0.0000,0.0941 --0.9956,0.0000,0.0000,0.0941 --0.9956,0.0000,0.0000,0.0941 --0.9969,0.0000,0.0000,0.0785 --0.9969,0.0000,0.0000,0.0785 --0.9969,0.0000,0.0000,0.0785 --0.9969,0.0000,0.0000,0.0785 --0.9980,0.0000,0.0000,0.0628 --0.9980,0.0000,0.0000,0.0628 --0.9980,0.0000,0.0000,0.0628 --0.9980,0.0000,0.0000,0.0628 --0.9989,0.0000,0.0000,0.0471 --0.9989,0.0000,0.0000,0.0471 --0.9989,0.0000,0.0000,0.0471 --0.9989,0.0000,0.0000,0.0471 --0.9995,0.0000,0.0000,0.0314 --0.9995,0.0000,0.0000,0.0314 --0.9995,0.0000,0.0000,0.0314 --0.9995,0.0000,0.0000,0.0314 --0.9999,0.0000,0.0000,0.0157 --0.9999,0.0000,0.0000,0.0157 --0.9999,0.0000,0.0000,0.0157 --0.9999,0.0000,0.0000,0.0157 -1.0000,0.0000,0.0000,0.0000 -1.0000,0.0000,0.0000,0.0000 -1.0000,0.0000,0.0000,0.0000 -1.0000,0.0000,0.0000,0.0000 diff --git a/scripts/trajectories/full-circle-4s.csv b/scripts/trajectories/full-circle-4s.csv deleted file mode 100644 index 4174a531b7..0000000000 --- a/scripts/trajectories/full-circle-4s.csv +++ /dev/null @@ -1,800 +0,0 @@ -0.9999,0.0000,0.0000,-0.0157 -0.9999,0.0000,0.0000,-0.0157 -0.9999,0.0000,0.0000,-0.0157 -0.9999,0.0000,0.0000,-0.0157 -0.9995,0.0000,0.0000,-0.0314 -0.9995,0.0000,0.0000,-0.0314 -0.9995,0.0000,0.0000,-0.0314 -0.9995,0.0000,0.0000,-0.0314 -0.9989,0.0000,0.0000,-0.0471 -0.9989,0.0000,0.0000,-0.0471 -0.9989,0.0000,0.0000,-0.0471 -0.9989,0.0000,0.0000,-0.0471 -0.9980,0.0000,0.0000,-0.0628 -0.9980,0.0000,0.0000,-0.0628 -0.9980,0.0000,0.0000,-0.0628 -0.9980,0.0000,0.0000,-0.0628 -0.9969,0.0000,0.0000,-0.0785 -0.9969,0.0000,0.0000,-0.0785 -0.9969,0.0000,0.0000,-0.0785 -0.9969,0.0000,0.0000,-0.0785 -0.9956,0.0000,0.0000,-0.0941 -0.9956,0.0000,0.0000,-0.0941 -0.9956,0.0000,0.0000,-0.0941 -0.9956,0.0000,0.0000,-0.0941 -0.9940,0.0000,0.0000,-0.1097 -0.9940,0.0000,0.0000,-0.1097 -0.9940,0.0000,0.0000,-0.1097 -0.9940,0.0000,0.0000,-0.1097 -0.9921,0.0000,0.0000,-0.1253 -0.9921,0.0000,0.0000,-0.1253 -0.9921,0.0000,0.0000,-0.1253 -0.9921,0.0000,0.0000,-0.1253 -0.9900,0.0000,0.0000,-0.1409 -0.9900,0.0000,0.0000,-0.1409 -0.9900,0.0000,0.0000,-0.1409 -0.9900,0.0000,0.0000,-0.1409 -0.9877,0.0000,0.0000,-0.1564 -0.9877,0.0000,0.0000,-0.1564 -0.9877,0.0000,0.0000,-0.1564 -0.9877,0.0000,0.0000,-0.1564 -0.9851,0.0000,0.0000,-0.1719 -0.9851,0.0000,0.0000,-0.1719 -0.9851,0.0000,0.0000,-0.1719 -0.9851,0.0000,0.0000,-0.1719 -0.9823,0.0000,0.0000,-0.1874 -0.9823,0.0000,0.0000,-0.1874 -0.9823,0.0000,0.0000,-0.1874 -0.9823,0.0000,0.0000,-0.1874 -0.9792,0.0000,0.0000,-0.2028 -0.9792,0.0000,0.0000,-0.2028 -0.9792,0.0000,0.0000,-0.2028 -0.9792,0.0000,0.0000,-0.2028 -0.9759,0.0000,0.0000,-0.2181 -0.9759,0.0000,0.0000,-0.2181 -0.9759,0.0000,0.0000,-0.2181 -0.9759,0.0000,0.0000,-0.2181 -0.9724,0.0000,0.0000,-0.2334 -0.9724,0.0000,0.0000,-0.2334 -0.9724,0.0000,0.0000,-0.2334 -0.9724,0.0000,0.0000,-0.2334 -0.9686,0.0000,0.0000,-0.2487 -0.9686,0.0000,0.0000,-0.2487 -0.9686,0.0000,0.0000,-0.2487 -0.9686,0.0000,0.0000,-0.2487 -0.9646,0.0000,0.0000,-0.2639 -0.9646,0.0000,0.0000,-0.2639 -0.9646,0.0000,0.0000,-0.2639 -0.9646,0.0000,0.0000,-0.2639 -0.9603,0.0000,0.0000,-0.2790 -0.9603,0.0000,0.0000,-0.2790 -0.9603,0.0000,0.0000,-0.2790 -0.9603,0.0000,0.0000,-0.2790 -0.9558,0.0000,0.0000,-0.2940 -0.9558,0.0000,0.0000,-0.2940 -0.9558,0.0000,0.0000,-0.2940 -0.9558,0.0000,0.0000,-0.2940 -0.9511,0.0000,0.0000,-0.3090 -0.9511,0.0000,0.0000,-0.3090 -0.9511,0.0000,0.0000,-0.3090 -0.9511,0.0000,0.0000,-0.3090 -0.9461,0.0000,0.0000,-0.3239 -0.9461,0.0000,0.0000,-0.3239 -0.9461,0.0000,0.0000,-0.3239 -0.9461,0.0000,0.0000,-0.3239 -0.9409,0.0000,0.0000,-0.3387 -0.9409,0.0000,0.0000,-0.3387 -0.9409,0.0000,0.0000,-0.3387 -0.9409,0.0000,0.0000,-0.3387 -0.9354,0.0000,0.0000,-0.3535 -0.9354,0.0000,0.0000,-0.3535 -0.9354,0.0000,0.0000,-0.3535 -0.9354,0.0000,0.0000,-0.3535 -0.9298,0.0000,0.0000,-0.3681 -0.9298,0.0000,0.0000,-0.3681 -0.9298,0.0000,0.0000,-0.3681 -0.9298,0.0000,0.0000,-0.3681 -0.9239,0.0000,0.0000,-0.3827 -0.9239,0.0000,0.0000,-0.3827 -0.9239,0.0000,0.0000,-0.3827 -0.9239,0.0000,0.0000,-0.3827 -0.9178,0.0000,0.0000,-0.3971 -0.9178,0.0000,0.0000,-0.3971 -0.9178,0.0000,0.0000,-0.3971 -0.9178,0.0000,0.0000,-0.3971 -0.9114,0.0000,0.0000,-0.4115 -0.9114,0.0000,0.0000,-0.4115 -0.9114,0.0000,0.0000,-0.4115 -0.9114,0.0000,0.0000,-0.4115 -0.9048,0.0000,0.0000,-0.4258 -0.9048,0.0000,0.0000,-0.4258 -0.9048,0.0000,0.0000,-0.4258 -0.9048,0.0000,0.0000,-0.4258 -0.8980,0.0000,0.0000,-0.4399 -0.8980,0.0000,0.0000,-0.4399 -0.8980,0.0000,0.0000,-0.4399 -0.8980,0.0000,0.0000,-0.4399 -0.8910,0.0000,0.0000,-0.4540 -0.8910,0.0000,0.0000,-0.4540 -0.8910,0.0000,0.0000,-0.4540 -0.8910,0.0000,0.0000,-0.4540 -0.8838,0.0000,0.0000,-0.4679 -0.8838,0.0000,0.0000,-0.4679 -0.8838,0.0000,0.0000,-0.4679 -0.8838,0.0000,0.0000,-0.4679 -0.8763,0.0000,0.0000,-0.4818 -0.8763,0.0000,0.0000,-0.4818 -0.8763,0.0000,0.0000,-0.4818 -0.8763,0.0000,0.0000,-0.4818 -0.8686,0.0000,0.0000,-0.4955 -0.8686,0.0000,0.0000,-0.4955 -0.8686,0.0000,0.0000,-0.4955 -0.8686,0.0000,0.0000,-0.4955 -0.8607,0.0000,0.0000,-0.5090 -0.8607,0.0000,0.0000,-0.5090 -0.8607,0.0000,0.0000,-0.5090 -0.8607,0.0000,0.0000,-0.5090 -0.8526,0.0000,0.0000,-0.5225 -0.8526,0.0000,0.0000,-0.5225 -0.8526,0.0000,0.0000,-0.5225 -0.8526,0.0000,0.0000,-0.5225 -0.8443,0.0000,0.0000,-0.5358 -0.8443,0.0000,0.0000,-0.5358 -0.8443,0.0000,0.0000,-0.5358 -0.8443,0.0000,0.0000,-0.5358 -0.8358,0.0000,0.0000,-0.5490 -0.8358,0.0000,0.0000,-0.5490 -0.8358,0.0000,0.0000,-0.5490 -0.8358,0.0000,0.0000,-0.5490 -0.8271,0.0000,0.0000,-0.5621 -0.8271,0.0000,0.0000,-0.5621 -0.8271,0.0000,0.0000,-0.5621 -0.8271,0.0000,0.0000,-0.5621 -0.8181,0.0000,0.0000,-0.5750 -0.8181,0.0000,0.0000,-0.5750 -0.8181,0.0000,0.0000,-0.5750 -0.8181,0.0000,0.0000,-0.5750 -0.8090,0.0000,0.0000,-0.5878 -0.8090,0.0000,0.0000,-0.5878 -0.8090,0.0000,0.0000,-0.5878 -0.8090,0.0000,0.0000,-0.5878 -0.7997,0.0000,0.0000,-0.6004 -0.7997,0.0000,0.0000,-0.6004 -0.7997,0.0000,0.0000,-0.6004 -0.7997,0.0000,0.0000,-0.6004 -0.7902,0.0000,0.0000,-0.6129 -0.7902,0.0000,0.0000,-0.6129 -0.7902,0.0000,0.0000,-0.6129 -0.7902,0.0000,0.0000,-0.6129 -0.7804,0.0000,0.0000,-0.6252 -0.7804,0.0000,0.0000,-0.6252 -0.7804,0.0000,0.0000,-0.6252 -0.7804,0.0000,0.0000,-0.6252 -0.7705,0.0000,0.0000,-0.6374 -0.7705,0.0000,0.0000,-0.6374 -0.7705,0.0000,0.0000,-0.6374 -0.7705,0.0000,0.0000,-0.6374 -0.7604,0.0000,0.0000,-0.6494 -0.7604,0.0000,0.0000,-0.6494 -0.7604,0.0000,0.0000,-0.6494 -0.7604,0.0000,0.0000,-0.6494 -0.7501,0.0000,0.0000,-0.6613 -0.7501,0.0000,0.0000,-0.6613 -0.7501,0.0000,0.0000,-0.6613 -0.7501,0.0000,0.0000,-0.6613 -0.7396,0.0000,0.0000,-0.6730 -0.7396,0.0000,0.0000,-0.6730 -0.7396,0.0000,0.0000,-0.6730 -0.7396,0.0000,0.0000,-0.6730 -0.7290,0.0000,0.0000,-0.6845 -0.7290,0.0000,0.0000,-0.6845 -0.7290,0.0000,0.0000,-0.6845 -0.7290,0.0000,0.0000,-0.6845 -0.7181,0.0000,0.0000,-0.6959 -0.7181,0.0000,0.0000,-0.6959 -0.7181,0.0000,0.0000,-0.6959 -0.7181,0.0000,0.0000,-0.6959 -0.7071,0.0000,0.0000,-0.7071 -0.7071,0.0000,0.0000,-0.7071 -0.7071,0.0000,0.0000,-0.7071 -0.7071,0.0000,0.0000,-0.7071 -0.6959,0.0000,0.0000,-0.7181 -0.6959,0.0000,0.0000,-0.7181 -0.6959,0.0000,0.0000,-0.7181 -0.6959,0.0000,0.0000,-0.7181 -0.6845,0.0000,0.0000,-0.7290 -0.6845,0.0000,0.0000,-0.7290 -0.6845,0.0000,0.0000,-0.7290 -0.6845,0.0000,0.0000,-0.7290 -0.6730,0.0000,0.0000,-0.7396 -0.6730,0.0000,0.0000,-0.7396 -0.6730,0.0000,0.0000,-0.7396 -0.6730,0.0000,0.0000,-0.7396 -0.6613,0.0000,0.0000,-0.7501 -0.6613,0.0000,0.0000,-0.7501 -0.6613,0.0000,0.0000,-0.7501 -0.6613,0.0000,0.0000,-0.7501 -0.6494,0.0000,0.0000,-0.7604 -0.6494,0.0000,0.0000,-0.7604 -0.6494,0.0000,0.0000,-0.7604 -0.6494,0.0000,0.0000,-0.7604 -0.6374,0.0000,0.0000,-0.7705 -0.6374,0.0000,0.0000,-0.7705 -0.6374,0.0000,0.0000,-0.7705 -0.6374,0.0000,0.0000,-0.7705 -0.6252,0.0000,0.0000,-0.7804 -0.6252,0.0000,0.0000,-0.7804 -0.6252,0.0000,0.0000,-0.7804 -0.6252,0.0000,0.0000,-0.7804 -0.6129,0.0000,0.0000,-0.7902 -0.6129,0.0000,0.0000,-0.7902 -0.6129,0.0000,0.0000,-0.7902 -0.6129,0.0000,0.0000,-0.7902 -0.6004,0.0000,0.0000,-0.7997 -0.6004,0.0000,0.0000,-0.7997 -0.6004,0.0000,0.0000,-0.7997 -0.6004,0.0000,0.0000,-0.7997 -0.5878,0.0000,0.0000,-0.8090 -0.5878,0.0000,0.0000,-0.8090 -0.5878,0.0000,0.0000,-0.8090 -0.5878,0.0000,0.0000,-0.8090 -0.5750,0.0000,0.0000,-0.8181 -0.5750,0.0000,0.0000,-0.8181 -0.5750,0.0000,0.0000,-0.8181 -0.5750,0.0000,0.0000,-0.8181 -0.5621,0.0000,0.0000,-0.8271 -0.5621,0.0000,0.0000,-0.8271 -0.5621,0.0000,0.0000,-0.8271 -0.5621,0.0000,0.0000,-0.8271 -0.5490,0.0000,0.0000,-0.8358 -0.5490,0.0000,0.0000,-0.8358 -0.5490,0.0000,0.0000,-0.8358 -0.5490,0.0000,0.0000,-0.8358 -0.5358,0.0000,0.0000,-0.8443 -0.5358,0.0000,0.0000,-0.8443 -0.5358,0.0000,0.0000,-0.8443 -0.5358,0.0000,0.0000,-0.8443 -0.5225,0.0000,0.0000,-0.8526 -0.5225,0.0000,0.0000,-0.8526 -0.5225,0.0000,0.0000,-0.8526 -0.5225,0.0000,0.0000,-0.8526 -0.5090,0.0000,0.0000,-0.8607 -0.5090,0.0000,0.0000,-0.8607 -0.5090,0.0000,0.0000,-0.8607 -0.5090,0.0000,0.0000,-0.8607 -0.4955,0.0000,0.0000,-0.8686 -0.4955,0.0000,0.0000,-0.8686 -0.4955,0.0000,0.0000,-0.8686 -0.4955,0.0000,0.0000,-0.8686 -0.4818,0.0000,0.0000,-0.8763 -0.4818,0.0000,0.0000,-0.8763 -0.4818,0.0000,0.0000,-0.8763 -0.4818,0.0000,0.0000,-0.8763 -0.4679,0.0000,0.0000,-0.8838 -0.4679,0.0000,0.0000,-0.8838 -0.4679,0.0000,0.0000,-0.8838 -0.4679,0.0000,0.0000,-0.8838 -0.4540,0.0000,0.0000,-0.8910 -0.4540,0.0000,0.0000,-0.8910 -0.4540,0.0000,0.0000,-0.8910 -0.4540,0.0000,0.0000,-0.8910 -0.4399,0.0000,0.0000,-0.8980 -0.4399,0.0000,0.0000,-0.8980 -0.4399,0.0000,0.0000,-0.8980 -0.4399,0.0000,0.0000,-0.8980 -0.4258,0.0000,0.0000,-0.9048 -0.4258,0.0000,0.0000,-0.9048 -0.4258,0.0000,0.0000,-0.9048 -0.4258,0.0000,0.0000,-0.9048 -0.4115,0.0000,0.0000,-0.9114 -0.4115,0.0000,0.0000,-0.9114 -0.4115,0.0000,0.0000,-0.9114 -0.4115,0.0000,0.0000,-0.9114 -0.3971,0.0000,0.0000,-0.9178 -0.3971,0.0000,0.0000,-0.9178 -0.3971,0.0000,0.0000,-0.9178 -0.3971,0.0000,0.0000,-0.9178 -0.3827,0.0000,0.0000,-0.9239 -0.3827,0.0000,0.0000,-0.9239 -0.3827,0.0000,0.0000,-0.9239 -0.3827,0.0000,0.0000,-0.9239 -0.3681,0.0000,0.0000,-0.9298 -0.3681,0.0000,0.0000,-0.9298 -0.3681,0.0000,0.0000,-0.9298 -0.3681,0.0000,0.0000,-0.9298 -0.3535,0.0000,0.0000,-0.9354 -0.3535,0.0000,0.0000,-0.9354 -0.3535,0.0000,0.0000,-0.9354 -0.3535,0.0000,0.0000,-0.9354 -0.3387,0.0000,0.0000,-0.9409 -0.3387,0.0000,0.0000,-0.9409 -0.3387,0.0000,0.0000,-0.9409 -0.3387,0.0000,0.0000,-0.9409 -0.3239,0.0000,0.0000,-0.9461 -0.3239,0.0000,0.0000,-0.9461 -0.3239,0.0000,0.0000,-0.9461 -0.3239,0.0000,0.0000,-0.9461 -0.3090,0.0000,0.0000,-0.9511 -0.3090,0.0000,0.0000,-0.9511 -0.3090,0.0000,0.0000,-0.9511 -0.3090,0.0000,0.0000,-0.9511 -0.2940,0.0000,0.0000,-0.9558 -0.2940,0.0000,0.0000,-0.9558 -0.2940,0.0000,0.0000,-0.9558 -0.2940,0.0000,0.0000,-0.9558 -0.2790,0.0000,0.0000,-0.9603 -0.2790,0.0000,0.0000,-0.9603 -0.2790,0.0000,0.0000,-0.9603 -0.2790,0.0000,0.0000,-0.9603 -0.2639,0.0000,0.0000,-0.9646 -0.2639,0.0000,0.0000,-0.9646 -0.2639,0.0000,0.0000,-0.9646 -0.2639,0.0000,0.0000,-0.9646 -0.2487,0.0000,0.0000,-0.9686 -0.2487,0.0000,0.0000,-0.9686 -0.2487,0.0000,0.0000,-0.9686 -0.2487,0.0000,0.0000,-0.9686 -0.2334,0.0000,0.0000,-0.9724 -0.2334,0.0000,0.0000,-0.9724 -0.2334,0.0000,0.0000,-0.9724 -0.2334,0.0000,0.0000,-0.9724 -0.2181,0.0000,0.0000,-0.9759 -0.2181,0.0000,0.0000,-0.9759 -0.2181,0.0000,0.0000,-0.9759 -0.2181,0.0000,0.0000,-0.9759 -0.2028,0.0000,0.0000,-0.9792 -0.2028,0.0000,0.0000,-0.9792 -0.2028,0.0000,0.0000,-0.9792 -0.2028,0.0000,0.0000,-0.9792 -0.1874,0.0000,0.0000,-0.9823 -0.1874,0.0000,0.0000,-0.9823 -0.1874,0.0000,0.0000,-0.9823 -0.1874,0.0000,0.0000,-0.9823 -0.1719,0.0000,0.0000,-0.9851 -0.1719,0.0000,0.0000,-0.9851 -0.1719,0.0000,0.0000,-0.9851 -0.1719,0.0000,0.0000,-0.9851 -0.1564,0.0000,0.0000,-0.9877 -0.1564,0.0000,0.0000,-0.9877 -0.1564,0.0000,0.0000,-0.9877 -0.1564,0.0000,0.0000,-0.9877 -0.1409,0.0000,0.0000,-0.9900 -0.1409,0.0000,0.0000,-0.9900 -0.1409,0.0000,0.0000,-0.9900 -0.1409,0.0000,0.0000,-0.9900 -0.1253,0.0000,0.0000,-0.9921 -0.1253,0.0000,0.0000,-0.9921 -0.1253,0.0000,0.0000,-0.9921 -0.1253,0.0000,0.0000,-0.9921 -0.1097,0.0000,0.0000,-0.9940 -0.1097,0.0000,0.0000,-0.9940 -0.1097,0.0000,0.0000,-0.9940 -0.1097,0.0000,0.0000,-0.9940 -0.0941,0.0000,0.0000,-0.9956 -0.0941,0.0000,0.0000,-0.9956 -0.0941,0.0000,0.0000,-0.9956 -0.0941,0.0000,0.0000,-0.9956 -0.0785,0.0000,0.0000,-0.9969 -0.0785,0.0000,0.0000,-0.9969 -0.0785,0.0000,0.0000,-0.9969 -0.0785,0.0000,0.0000,-0.9969 -0.0628,0.0000,0.0000,-0.9980 -0.0628,0.0000,0.0000,-0.9980 -0.0628,0.0000,0.0000,-0.9980 -0.0628,0.0000,0.0000,-0.9980 -0.0471,0.0000,0.0000,-0.9989 -0.0471,0.0000,0.0000,-0.9989 -0.0471,0.0000,0.0000,-0.9989 -0.0471,0.0000,0.0000,-0.9989 -0.0314,0.0000,0.0000,-0.9995 -0.0314,0.0000,0.0000,-0.9995 -0.0314,0.0000,0.0000,-0.9995 -0.0314,0.0000,0.0000,-0.9995 -0.0157,0.0000,0.0000,-0.9999 -0.0157,0.0000,0.0000,-0.9999 -0.0157,0.0000,0.0000,-0.9999 -0.0157,0.0000,0.0000,-0.9999 --0.0000,0.0000,0.0000,-1.0000 --0.0000,0.0000,0.0000,-1.0000 --0.0000,0.0000,0.0000,-1.0000 --0.0000,0.0000,0.0000,-1.0000 --0.0157,0.0000,0.0000,-0.9999 --0.0157,0.0000,0.0000,-0.9999 --0.0157,0.0000,0.0000,-0.9999 --0.0157,0.0000,0.0000,-0.9999 --0.0314,0.0000,0.0000,-0.9995 --0.0314,0.0000,0.0000,-0.9995 --0.0314,0.0000,0.0000,-0.9995 --0.0314,0.0000,0.0000,-0.9995 --0.0471,0.0000,0.0000,-0.9989 --0.0471,0.0000,0.0000,-0.9989 --0.0471,0.0000,0.0000,-0.9989 --0.0471,0.0000,0.0000,-0.9989 --0.0628,0.0000,0.0000,-0.9980 --0.0628,0.0000,0.0000,-0.9980 --0.0628,0.0000,0.0000,-0.9980 --0.0628,0.0000,0.0000,-0.9980 --0.0785,0.0000,0.0000,-0.9969 --0.0785,0.0000,0.0000,-0.9969 --0.0785,0.0000,0.0000,-0.9969 --0.0785,0.0000,0.0000,-0.9969 --0.0941,0.0000,0.0000,-0.9956 --0.0941,0.0000,0.0000,-0.9956 --0.0941,0.0000,0.0000,-0.9956 --0.0941,0.0000,0.0000,-0.9956 --0.1097,0.0000,0.0000,-0.9940 --0.1097,0.0000,0.0000,-0.9940 --0.1097,0.0000,0.0000,-0.9940 --0.1097,0.0000,0.0000,-0.9940 --0.1253,0.0000,0.0000,-0.9921 --0.1253,0.0000,0.0000,-0.9921 --0.1253,0.0000,0.0000,-0.9921 --0.1253,0.0000,0.0000,-0.9921 --0.1409,0.0000,0.0000,-0.9900 --0.1409,0.0000,0.0000,-0.9900 --0.1409,0.0000,0.0000,-0.9900 --0.1409,0.0000,0.0000,-0.9900 --0.1564,0.0000,0.0000,-0.9877 --0.1564,0.0000,0.0000,-0.9877 --0.1564,0.0000,0.0000,-0.9877 --0.1564,0.0000,0.0000,-0.9877 --0.1719,0.0000,0.0000,-0.9851 --0.1719,0.0000,0.0000,-0.9851 --0.1719,0.0000,0.0000,-0.9851 --0.1719,0.0000,0.0000,-0.9851 --0.1874,0.0000,0.0000,-0.9823 --0.1874,0.0000,0.0000,-0.9823 --0.1874,0.0000,0.0000,-0.9823 --0.1874,0.0000,0.0000,-0.9823 --0.2028,0.0000,0.0000,-0.9792 --0.2028,0.0000,0.0000,-0.9792 --0.2028,0.0000,0.0000,-0.9792 --0.2028,0.0000,0.0000,-0.9792 --0.2181,0.0000,0.0000,-0.9759 --0.2181,0.0000,0.0000,-0.9759 --0.2181,0.0000,0.0000,-0.9759 --0.2181,0.0000,0.0000,-0.9759 --0.2334,0.0000,0.0000,-0.9724 --0.2334,0.0000,0.0000,-0.9724 --0.2334,0.0000,0.0000,-0.9724 --0.2334,0.0000,0.0000,-0.9724 --0.2487,0.0000,0.0000,-0.9686 --0.2487,0.0000,0.0000,-0.9686 --0.2487,0.0000,0.0000,-0.9686 --0.2487,0.0000,0.0000,-0.9686 --0.2639,0.0000,0.0000,-0.9646 --0.2639,0.0000,0.0000,-0.9646 --0.2639,0.0000,0.0000,-0.9646 --0.2639,0.0000,0.0000,-0.9646 --0.2790,0.0000,0.0000,-0.9603 --0.2790,0.0000,0.0000,-0.9603 --0.2790,0.0000,0.0000,-0.9603 --0.2790,0.0000,0.0000,-0.9603 --0.2940,0.0000,0.0000,-0.9558 --0.2940,0.0000,0.0000,-0.9558 --0.2940,0.0000,0.0000,-0.9558 --0.2940,0.0000,0.0000,-0.9558 --0.3090,0.0000,0.0000,-0.9511 --0.3090,0.0000,0.0000,-0.9511 --0.3090,0.0000,0.0000,-0.9511 --0.3090,0.0000,0.0000,-0.9511 --0.3239,0.0000,0.0000,-0.9461 --0.3239,0.0000,0.0000,-0.9461 --0.3239,0.0000,0.0000,-0.9461 --0.3239,0.0000,0.0000,-0.9461 --0.3387,0.0000,0.0000,-0.9409 --0.3387,0.0000,0.0000,-0.9409 --0.3387,0.0000,0.0000,-0.9409 --0.3387,0.0000,0.0000,-0.9409 --0.3535,0.0000,0.0000,-0.9354 --0.3535,0.0000,0.0000,-0.9354 --0.3535,0.0000,0.0000,-0.9354 --0.3535,0.0000,0.0000,-0.9354 --0.3681,0.0000,0.0000,-0.9298 --0.3681,0.0000,0.0000,-0.9298 --0.3681,0.0000,0.0000,-0.9298 --0.3681,0.0000,0.0000,-0.9298 --0.3827,0.0000,0.0000,-0.9239 --0.3827,0.0000,0.0000,-0.9239 --0.3827,0.0000,0.0000,-0.9239 --0.3827,0.0000,0.0000,-0.9239 --0.3971,0.0000,0.0000,-0.9178 --0.3971,0.0000,0.0000,-0.9178 --0.3971,0.0000,0.0000,-0.9178 --0.3971,0.0000,0.0000,-0.9178 --0.4115,0.0000,0.0000,-0.9114 --0.4115,0.0000,0.0000,-0.9114 --0.4115,0.0000,0.0000,-0.9114 --0.4115,0.0000,0.0000,-0.9114 --0.4258,0.0000,0.0000,-0.9048 --0.4258,0.0000,0.0000,-0.9048 --0.4258,0.0000,0.0000,-0.9048 --0.4258,0.0000,0.0000,-0.9048 --0.4399,0.0000,0.0000,-0.8980 --0.4399,0.0000,0.0000,-0.8980 --0.4399,0.0000,0.0000,-0.8980 --0.4399,0.0000,0.0000,-0.8980 --0.4540,0.0000,0.0000,-0.8910 --0.4540,0.0000,0.0000,-0.8910 --0.4540,0.0000,0.0000,-0.8910 --0.4540,0.0000,0.0000,-0.8910 --0.4679,0.0000,0.0000,-0.8838 --0.4679,0.0000,0.0000,-0.8838 --0.4679,0.0000,0.0000,-0.8838 --0.4679,0.0000,0.0000,-0.8838 --0.4818,0.0000,0.0000,-0.8763 --0.4818,0.0000,0.0000,-0.8763 --0.4818,0.0000,0.0000,-0.8763 --0.4818,0.0000,0.0000,-0.8763 --0.4955,0.0000,0.0000,-0.8686 --0.4955,0.0000,0.0000,-0.8686 --0.4955,0.0000,0.0000,-0.8686 --0.4955,0.0000,0.0000,-0.8686 --0.5090,0.0000,0.0000,-0.8607 --0.5090,0.0000,0.0000,-0.8607 --0.5090,0.0000,0.0000,-0.8607 --0.5090,0.0000,0.0000,-0.8607 --0.5225,0.0000,0.0000,-0.8526 --0.5225,0.0000,0.0000,-0.8526 --0.5225,0.0000,0.0000,-0.8526 --0.5225,0.0000,0.0000,-0.8526 --0.5358,0.0000,0.0000,-0.8443 --0.5358,0.0000,0.0000,-0.8443 --0.5358,0.0000,0.0000,-0.8443 --0.5358,0.0000,0.0000,-0.8443 --0.5490,0.0000,0.0000,-0.8358 --0.5490,0.0000,0.0000,-0.8358 --0.5490,0.0000,0.0000,-0.8358 --0.5490,0.0000,0.0000,-0.8358 --0.5621,0.0000,0.0000,-0.8271 --0.5621,0.0000,0.0000,-0.8271 --0.5621,0.0000,0.0000,-0.8271 --0.5621,0.0000,0.0000,-0.8271 --0.5750,0.0000,0.0000,-0.8181 --0.5750,0.0000,0.0000,-0.8181 --0.5750,0.0000,0.0000,-0.8181 --0.5750,0.0000,0.0000,-0.8181 --0.5878,0.0000,0.0000,-0.8090 --0.5878,0.0000,0.0000,-0.8090 --0.5878,0.0000,0.0000,-0.8090 --0.5878,0.0000,0.0000,-0.8090 --0.6004,0.0000,0.0000,-0.7997 --0.6004,0.0000,0.0000,-0.7997 --0.6004,0.0000,0.0000,-0.7997 --0.6004,0.0000,0.0000,-0.7997 --0.6129,0.0000,0.0000,-0.7902 --0.6129,0.0000,0.0000,-0.7902 --0.6129,0.0000,0.0000,-0.7902 --0.6129,0.0000,0.0000,-0.7902 --0.6252,0.0000,0.0000,-0.7804 --0.6252,0.0000,0.0000,-0.7804 --0.6252,0.0000,0.0000,-0.7804 --0.6252,0.0000,0.0000,-0.7804 --0.6374,0.0000,0.0000,-0.7705 --0.6374,0.0000,0.0000,-0.7705 --0.6374,0.0000,0.0000,-0.7705 --0.6374,0.0000,0.0000,-0.7705 --0.6494,0.0000,0.0000,-0.7604 --0.6494,0.0000,0.0000,-0.7604 --0.6494,0.0000,0.0000,-0.7604 --0.6494,0.0000,0.0000,-0.7604 --0.6613,0.0000,0.0000,-0.7501 --0.6613,0.0000,0.0000,-0.7501 --0.6613,0.0000,0.0000,-0.7501 --0.6613,0.0000,0.0000,-0.7501 --0.6730,0.0000,0.0000,-0.7396 --0.6730,0.0000,0.0000,-0.7396 --0.6730,0.0000,0.0000,-0.7396 --0.6730,0.0000,0.0000,-0.7396 --0.6845,0.0000,0.0000,-0.7290 --0.6845,0.0000,0.0000,-0.7290 --0.6845,0.0000,0.0000,-0.7290 --0.6845,0.0000,0.0000,-0.7290 --0.6959,0.0000,0.0000,-0.7181 --0.6959,0.0000,0.0000,-0.7181 --0.6959,0.0000,0.0000,-0.7181 --0.6959,0.0000,0.0000,-0.7181 --0.7071,0.0000,0.0000,-0.7071 --0.7071,0.0000,0.0000,-0.7071 --0.7071,0.0000,0.0000,-0.7071 --0.7071,0.0000,0.0000,-0.7071 --0.7181,0.0000,0.0000,-0.6959 --0.7181,0.0000,0.0000,-0.6959 --0.7181,0.0000,0.0000,-0.6959 --0.7181,0.0000,0.0000,-0.6959 --0.7290,0.0000,0.0000,-0.6845 --0.7290,0.0000,0.0000,-0.6845 --0.7290,0.0000,0.0000,-0.6845 --0.7290,0.0000,0.0000,-0.6845 --0.7396,0.0000,0.0000,-0.6730 --0.7396,0.0000,0.0000,-0.6730 --0.7396,0.0000,0.0000,-0.6730 --0.7396,0.0000,0.0000,-0.6730 --0.7501,0.0000,0.0000,-0.6613 --0.7501,0.0000,0.0000,-0.6613 --0.7501,0.0000,0.0000,-0.6613 --0.7501,0.0000,0.0000,-0.6613 --0.7604,0.0000,0.0000,-0.6494 --0.7604,0.0000,0.0000,-0.6494 --0.7604,0.0000,0.0000,-0.6494 --0.7604,0.0000,0.0000,-0.6494 --0.7705,0.0000,0.0000,-0.6374 --0.7705,0.0000,0.0000,-0.6374 --0.7705,0.0000,0.0000,-0.6374 --0.7705,0.0000,0.0000,-0.6374 --0.7804,0.0000,0.0000,-0.6252 --0.7804,0.0000,0.0000,-0.6252 --0.7804,0.0000,0.0000,-0.6252 --0.7804,0.0000,0.0000,-0.6252 --0.7902,0.0000,0.0000,-0.6129 --0.7902,0.0000,0.0000,-0.6129 --0.7902,0.0000,0.0000,-0.6129 --0.7902,0.0000,0.0000,-0.6129 --0.7997,0.0000,0.0000,-0.6004 --0.7997,0.0000,0.0000,-0.6004 --0.7997,0.0000,0.0000,-0.6004 --0.7997,0.0000,0.0000,-0.6004 --0.8090,0.0000,0.0000,-0.5878 --0.8090,0.0000,0.0000,-0.5878 --0.8090,0.0000,0.0000,-0.5878 --0.8090,0.0000,0.0000,-0.5878 --0.8182,0.0000,0.0000,-0.5750 --0.8182,0.0000,0.0000,-0.5750 --0.8182,0.0000,0.0000,-0.5750 --0.8182,0.0000,0.0000,-0.5750 --0.8271,0.0000,0.0000,-0.5621 --0.8271,0.0000,0.0000,-0.5621 --0.8271,0.0000,0.0000,-0.5621 --0.8271,0.0000,0.0000,-0.5621 --0.8358,0.0000,0.0000,-0.5490 --0.8358,0.0000,0.0000,-0.5490 --0.8358,0.0000,0.0000,-0.5490 --0.8358,0.0000,0.0000,-0.5490 --0.8443,0.0000,0.0000,-0.5358 --0.8443,0.0000,0.0000,-0.5358 --0.8443,0.0000,0.0000,-0.5358 --0.8443,0.0000,0.0000,-0.5358 --0.8526,0.0000,0.0000,-0.5225 --0.8526,0.0000,0.0000,-0.5225 --0.8526,0.0000,0.0000,-0.5225 --0.8526,0.0000,0.0000,-0.5225 --0.8607,0.0000,0.0000,-0.5090 --0.8607,0.0000,0.0000,-0.5090 --0.8607,0.0000,0.0000,-0.5090 --0.8607,0.0000,0.0000,-0.5090 --0.8686,0.0000,0.0000,-0.4955 --0.8686,0.0000,0.0000,-0.4955 --0.8686,0.0000,0.0000,-0.4955 --0.8686,0.0000,0.0000,-0.4955 --0.8763,0.0000,0.0000,-0.4818 --0.8763,0.0000,0.0000,-0.4818 --0.8763,0.0000,0.0000,-0.4818 --0.8763,0.0000,0.0000,-0.4818 --0.8838,0.0000,0.0000,-0.4679 --0.8838,0.0000,0.0000,-0.4679 --0.8838,0.0000,0.0000,-0.4679 --0.8838,0.0000,0.0000,-0.4679 --0.8910,0.0000,0.0000,-0.4540 --0.8910,0.0000,0.0000,-0.4540 --0.8910,0.0000,0.0000,-0.4540 --0.8910,0.0000,0.0000,-0.4540 --0.8980,0.0000,0.0000,-0.4399 --0.8980,0.0000,0.0000,-0.4399 --0.8980,0.0000,0.0000,-0.4399 --0.8980,0.0000,0.0000,-0.4399 --0.9048,0.0000,0.0000,-0.4258 --0.9048,0.0000,0.0000,-0.4258 --0.9048,0.0000,0.0000,-0.4258 --0.9048,0.0000,0.0000,-0.4258 --0.9114,0.0000,0.0000,-0.4115 --0.9114,0.0000,0.0000,-0.4115 --0.9114,0.0000,0.0000,-0.4115 --0.9114,0.0000,0.0000,-0.4115 --0.9178,0.0000,0.0000,-0.3971 --0.9178,0.0000,0.0000,-0.3971 --0.9178,0.0000,0.0000,-0.3971 --0.9178,0.0000,0.0000,-0.3971 --0.9239,0.0000,0.0000,-0.3827 --0.9239,0.0000,0.0000,-0.3827 --0.9239,0.0000,0.0000,-0.3827 --0.9239,0.0000,0.0000,-0.3827 --0.9298,0.0000,0.0000,-0.3681 --0.9298,0.0000,0.0000,-0.3681 --0.9298,0.0000,0.0000,-0.3681 --0.9298,0.0000,0.0000,-0.3681 --0.9354,0.0000,0.0000,-0.3535 --0.9354,0.0000,0.0000,-0.3535 --0.9354,0.0000,0.0000,-0.3535 --0.9354,0.0000,0.0000,-0.3535 --0.9409,0.0000,0.0000,-0.3387 --0.9409,0.0000,0.0000,-0.3387 --0.9409,0.0000,0.0000,-0.3387 --0.9409,0.0000,0.0000,-0.3387 --0.9461,0.0000,0.0000,-0.3239 --0.9461,0.0000,0.0000,-0.3239 --0.9461,0.0000,0.0000,-0.3239 --0.9461,0.0000,0.0000,-0.3239 --0.9511,0.0000,0.0000,-0.3090 --0.9511,0.0000,0.0000,-0.3090 --0.9511,0.0000,0.0000,-0.3090 --0.9511,0.0000,0.0000,-0.3090 --0.9558,0.0000,0.0000,-0.2940 --0.9558,0.0000,0.0000,-0.2940 --0.9558,0.0000,0.0000,-0.2940 --0.9558,0.0000,0.0000,-0.2940 --0.9603,0.0000,0.0000,-0.2790 --0.9603,0.0000,0.0000,-0.2790 --0.9603,0.0000,0.0000,-0.2790 --0.9603,0.0000,0.0000,-0.2790 --0.9646,0.0000,0.0000,-0.2639 --0.9646,0.0000,0.0000,-0.2639 --0.9646,0.0000,0.0000,-0.2639 --0.9646,0.0000,0.0000,-0.2639 --0.9686,0.0000,0.0000,-0.2487 --0.9686,0.0000,0.0000,-0.2487 --0.9686,0.0000,0.0000,-0.2487 --0.9686,0.0000,0.0000,-0.2487 --0.9724,0.0000,0.0000,-0.2334 --0.9724,0.0000,0.0000,-0.2334 --0.9724,0.0000,0.0000,-0.2334 --0.9724,0.0000,0.0000,-0.2334 --0.9759,0.0000,0.0000,-0.2181 --0.9759,0.0000,0.0000,-0.2181 --0.9759,0.0000,0.0000,-0.2181 --0.9759,0.0000,0.0000,-0.2181 --0.9792,0.0000,0.0000,-0.2028 --0.9792,0.0000,0.0000,-0.2028 --0.9792,0.0000,0.0000,-0.2028 --0.9792,0.0000,0.0000,-0.2028 --0.9823,0.0000,0.0000,-0.1874 --0.9823,0.0000,0.0000,-0.1874 --0.9823,0.0000,0.0000,-0.1874 --0.9823,0.0000,0.0000,-0.1874 --0.9851,0.0000,0.0000,-0.1719 --0.9851,0.0000,0.0000,-0.1719 --0.9851,0.0000,0.0000,-0.1719 --0.9851,0.0000,0.0000,-0.1719 --0.9877,0.0000,0.0000,-0.1564 --0.9877,0.0000,0.0000,-0.1564 --0.9877,0.0000,0.0000,-0.1564 --0.9877,0.0000,0.0000,-0.1564 --0.9900,0.0000,0.0000,-0.1409 --0.9900,0.0000,0.0000,-0.1409 --0.9900,0.0000,0.0000,-0.1409 --0.9900,0.0000,0.0000,-0.1409 --0.9921,0.0000,0.0000,-0.1253 --0.9921,0.0000,0.0000,-0.1253 --0.9921,0.0000,0.0000,-0.1253 --0.9921,0.0000,0.0000,-0.1253 --0.9940,0.0000,0.0000,-0.1097 --0.9940,0.0000,0.0000,-0.1097 --0.9940,0.0000,0.0000,-0.1097 --0.9940,0.0000,0.0000,-0.1097 --0.9956,0.0000,0.0000,-0.0941 --0.9956,0.0000,0.0000,-0.0941 --0.9956,0.0000,0.0000,-0.0941 --0.9956,0.0000,0.0000,-0.0941 --0.9969,0.0000,0.0000,-0.0785 --0.9969,0.0000,0.0000,-0.0785 --0.9969,0.0000,0.0000,-0.0785 --0.9969,0.0000,0.0000,-0.0785 --0.9980,0.0000,0.0000,-0.0628 --0.9980,0.0000,0.0000,-0.0628 --0.9980,0.0000,0.0000,-0.0628 --0.9980,0.0000,0.0000,-0.0628 --0.9989,0.0000,0.0000,-0.0471 --0.9989,0.0000,0.0000,-0.0471 --0.9989,0.0000,0.0000,-0.0471 --0.9989,0.0000,0.0000,-0.0471 --0.9995,0.0000,0.0000,-0.0314 --0.9995,0.0000,0.0000,-0.0314 --0.9995,0.0000,0.0000,-0.0314 --0.9995,0.0000,0.0000,-0.0314 --0.9999,0.0000,0.0000,-0.0157 --0.9999,0.0000,0.0000,-0.0157 --0.9999,0.0000,0.0000,-0.0157 --0.9999,0.0000,0.0000,-0.0157 -1.0000,0.0000,0.0000,-0.0000 -1.0000,0.0000,0.0000,-0.0000 -1.0000,0.0000,0.0000,-0.0000 -1.0000,0.0000,0.0000,-0.0000 diff --git a/scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv b/scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv deleted file mode 100644 index 8fe2d2fe05..0000000000 --- a/scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv +++ /dev/null @@ -1,200 +0,0 @@ -0.0000,0.0000,0.0000,0.7012,-0.0220,-0.7126 -0.0000,0.0000,0.0000,0.7057,-0.0444,-0.7071 -0.0000,0.0000,0.0000,0.7095,-0.0671,-0.7015 -0.0000,0.0000,0.0000,0.7125,-0.0900,-0.6959 -0.0000,0.0000,0.0000,0.7147,-0.1132,-0.6903 -0.0000,0.0000,0.0000,0.7161,-0.1366,-0.6845 -0.0000,0.0000,0.0000,0.7166,-0.1602,-0.6788 -0.0000,0.0000,0.0000,0.7164,-0.1839,-0.6730 -0.0000,0.0000,0.0000,0.7153,-0.2078,-0.6672 -0.0000,0.0000,0.0000,0.7134,-0.2318,-0.6613 -0.0000,0.0000,0.0000,0.7106,-0.2558,-0.6554 -0.0000,0.0000,0.0000,0.7070,-0.2799,-0.6494 -0.0000,0.0000,0.0000,0.7025,-0.3040,-0.6435 -0.0000,0.0000,0.0000,0.6972,-0.3281,-0.6374 -0.0000,0.0000,0.0000,0.6910,-0.3521,-0.6314 -0.0000,0.0000,0.0000,0.6839,-0.3760,-0.6252 -0.0000,0.0000,0.0000,0.6760,-0.3998,-0.6191 -0.0000,0.0000,0.0000,0.6671,-0.4234,-0.6129 -0.0000,0.0000,0.0000,0.6575,-0.4468,-0.6067 -0.0000,0.0000,0.0000,0.6470,-0.4700,-0.6004 -0.0000,0.0000,0.0000,0.6356,-0.4930,-0.5941 -0.0000,0.0000,0.0000,0.6234,-0.5157,-0.5878 -0.0000,0.0000,0.0000,0.6103,-0.5380,-0.5814 -0.0000,0.0000,0.0000,0.5964,-0.5601,-0.5750 -0.0000,0.0000,0.0000,0.5817,-0.5817,-0.5686 -0.0000,0.0000,0.0000,0.5662,-0.6029,-0.5621 -0.0000,0.0000,0.0000,0.5499,-0.6237,-0.5556 -0.0000,0.0000,0.0000,0.5328,-0.6440,-0.5490 -0.0000,0.0000,0.0000,0.5149,-0.6638,-0.5424 -0.0000,0.0000,0.0000,0.4963,-0.6831,-0.5358 -0.0000,0.0000,0.0000,0.4769,-0.7018,-0.5292 -0.0000,0.0000,0.0000,0.4569,-0.7199,-0.5225 -0.0000,0.0000,0.0000,0.4361,-0.7374,-0.5158 -0.0000,0.0000,0.0000,0.4147,-0.7543,-0.5090 -0.0000,0.0000,0.0000,0.3926,-0.7705,-0.5023 -0.0000,0.0000,0.0000,0.3698,-0.7860,-0.4955 -0.0000,0.0000,0.0000,0.3465,-0.8007,-0.4886 -0.0000,0.0000,0.0000,0.3226,-0.8148,-0.4818 -0.0000,0.0000,0.0000,0.2981,-0.8280,-0.4749 -0.0000,0.0000,0.0000,0.2731,-0.8405,-0.4679 -0.0000,0.0000,0.0000,0.2476,-0.8522,-0.4610 -0.0000,0.0000,0.0000,0.2216,-0.8630,-0.4540 -0.0000,0.0000,0.0000,0.1951,-0.8730,-0.4470 -0.0000,0.0000,0.0000,0.1683,-0.8821,-0.4399 -0.0000,0.0000,0.0000,0.1410,-0.8904,-0.4329 -0.0000,0.0000,0.0000,0.1134,-0.8977,-0.4258 -0.0000,0.0000,0.0000,0.0855,-0.9041,-0.4187 -0.0000,0.0000,0.0000,0.0572,-0.9096,-0.4115 -0.0000,0.0000,0.0000,0.0287,-0.9142,-0.4043 -0.0000,0.0000,0.0000,-0.0000,-0.9178,-0.3971 -0.0000,0.0000,0.0000,-0.0289,-0.9204,-0.3899 -0.0000,0.0000,0.0000,-0.0580,-0.9221,-0.3827 -0.0000,0.0000,0.0000,-0.0872,-0.9227,-0.3754 -0.0000,0.0000,0.0000,-0.1165,-0.9224,-0.3681 -0.0000,0.0000,0.0000,-0.1459,-0.9212,-0.3608 -0.0000,0.0000,0.0000,-0.1753,-0.9189,-0.3535 -0.0000,0.0000,0.0000,-0.2047,-0.9156,-0.3461 -0.0000,0.0000,0.0000,-0.2340,-0.9113,-0.3387 -0.0000,0.0000,0.0000,-0.2632,-0.9060,-0.3313 -0.0000,0.0000,0.0000,-0.2924,-0.8998,-0.3239 -0.0000,0.0000,0.0000,-0.3213,-0.8925,-0.3165 -0.0000,0.0000,0.0000,-0.3501,-0.8843,-0.3090 -0.0000,0.0000,0.0000,-0.3787,-0.8750,-0.3015 -0.0000,0.0000,0.0000,-0.4070,-0.8648,-0.2940 -0.0000,0.0000,0.0000,-0.4350,-0.8536,-0.2865 -0.0000,0.0000,0.0000,-0.4626,-0.8415,-0.2790 -0.0000,0.0000,0.0000,-0.4899,-0.8284,-0.2714 -0.0000,0.0000,0.0000,-0.5168,-0.8144,-0.2639 -0.0000,0.0000,0.0000,-0.5433,-0.7995,-0.2563 -0.0000,0.0000,0.0000,-0.5693,-0.7836,-0.2487 -0.0000,0.0000,0.0000,-0.5948,-0.7669,-0.2411 -0.0000,0.0000,0.0000,-0.6198,-0.7492,-0.2334 -0.0000,0.0000,0.0000,-0.6442,-0.7307,-0.2258 -0.0000,0.0000,0.0000,-0.6681,-0.7114,-0.2181 -0.0000,0.0000,0.0000,-0.6913,-0.6913,-0.2105 -0.0000,0.0000,0.0000,-0.7138,-0.6703,-0.2028 -0.0000,0.0000,0.0000,-0.7357,-0.6486,-0.1951 -0.0000,0.0000,0.0000,-0.7569,-0.6261,-0.1874 -0.0000,0.0000,0.0000,-0.7773,-0.6029,-0.1797 -0.0000,0.0000,0.0000,-0.7970,-0.5790,-0.1719 -0.0000,0.0000,0.0000,-0.8159,-0.5545,-0.1642 -0.0000,0.0000,0.0000,-0.8339,-0.5292,-0.1564 -0.0000,0.0000,0.0000,-0.8512,-0.5034,-0.1487 -0.0000,0.0000,0.0000,-0.8676,-0.4769,-0.1409 -0.0000,0.0000,0.0000,-0.8831,-0.4499,-0.1331 -0.0000,0.0000,0.0000,-0.8977,-0.4224,-0.1253 -0.0000,0.0000,0.0000,-0.9114,-0.3944,-0.1175 -0.0000,0.0000,0.0000,-0.9242,-0.3659,-0.1097 -0.0000,0.0000,0.0000,-0.9360,-0.3370,-0.1019 -0.0000,0.0000,0.0000,-0.9468,-0.3076,-0.0941 -0.0000,0.0000,0.0000,-0.9567,-0.2779,-0.0863 -0.0000,0.0000,0.0000,-0.9656,-0.2479,-0.0785 -0.0000,0.0000,0.0000,-0.9735,-0.2176,-0.0706 -0.0000,0.0000,0.0000,-0.9803,-0.1870,-0.0628 -0.0000,0.0000,0.0000,-0.9862,-0.1562,-0.0549 -0.0000,0.0000,0.0000,-0.9910,-0.1252,-0.0471 -0.0000,0.0000,0.0000,-0.9948,-0.0940,-0.0393 -0.0000,0.0000,0.0000,-0.9975,-0.0628,-0.0314 -0.0000,0.0000,0.0000,-0.9992,-0.0314,-0.0236 -0.0000,0.0000,0.0000,-0.9999,0.0000,-0.0157 -0.0000,0.0000,0.0000,-0.9995,0.0314,-0.0079 -0.0000,0.0000,0.0000,-0.9980,0.0628,0.0000 -0.0000,0.0000,0.0000,-0.9955,0.0941,0.0079 -0.0000,0.0000,0.0000,-0.9920,0.1253,0.0157 -0.0000,0.0000,0.0000,-0.9874,0.1564,0.0236 -0.0000,0.0000,0.0000,-0.9818,0.1873,0.0314 -0.0000,0.0000,0.0000,-0.9752,0.2180,0.0393 -0.0000,0.0000,0.0000,-0.9675,0.2484,0.0471 -0.0000,0.0000,0.0000,-0.9588,0.2786,0.0550 -0.0000,0.0000,0.0000,-0.9492,0.3084,0.0628 -0.0000,0.0000,0.0000,-0.9385,0.3379,0.0706 -0.0000,0.0000,0.0000,-0.9269,0.3670,0.0785 -0.0000,0.0000,0.0000,-0.9143,0.3957,0.0863 -0.0000,0.0000,0.0000,-0.9008,0.4239,0.0941 -0.0000,0.0000,0.0000,-0.8864,0.4516,0.1019 -0.0000,0.0000,0.0000,-0.8710,0.4788,0.1097 -0.0000,0.0000,0.0000,-0.8548,0.5055,0.1175 -0.0000,0.0000,0.0000,-0.8377,0.5316,0.1253 -0.0000,0.0000,0.0000,-0.8197,0.5571,0.1331 -0.0000,0.0000,0.0000,-0.8009,0.5819,0.1409 -0.0000,0.0000,0.0000,-0.7814,0.6061,0.1487 -0.0000,0.0000,0.0000,-0.7610,0.6296,0.1564 -0.0000,0.0000,0.0000,-0.7399,0.6523,0.1642 -0.0000,0.0000,0.0000,-0.7181,0.6744,0.1719 -0.0000,0.0000,0.0000,-0.6956,0.6956,0.1797 -0.0000,0.0000,0.0000,-0.6724,0.7161,0.1874 -0.0000,0.0000,0.0000,-0.6486,0.7357,0.1951 -0.0000,0.0000,0.0000,-0.6242,0.7545,0.2028 -0.0000,0.0000,0.0000,-0.5992,0.7725,0.2105 -0.0000,0.0000,0.0000,-0.5736,0.7895,0.2181 -0.0000,0.0000,0.0000,-0.5476,0.8057,0.2258 -0.0000,0.0000,0.0000,-0.5210,0.8210,0.2334 -0.0000,0.0000,0.0000,-0.4940,0.8354,0.2411 -0.0000,0.0000,0.0000,-0.4666,0.8488,0.2487 -0.0000,0.0000,0.0000,-0.4388,0.8612,0.2563 -0.0000,0.0000,0.0000,-0.4107,0.8728,0.2639 -0.0000,0.0000,0.0000,-0.3822,0.8833,0.2714 -0.0000,0.0000,0.0000,-0.3535,0.8929,0.2790 -0.0000,0.0000,0.0000,-0.3245,0.9014,0.2865 -0.0000,0.0000,0.0000,-0.2954,0.9090,0.2940 -0.0000,0.0000,0.0000,-0.2660,0.9156,0.3015 -0.0000,0.0000,0.0000,-0.2365,0.9212,0.3090 -0.0000,0.0000,0.0000,-0.2069,0.9258,0.3165 -0.0000,0.0000,0.0000,-0.1773,0.9293,0.3239 -0.0000,0.0000,0.0000,-0.1476,0.9319,0.3313 -0.0000,0.0000,0.0000,-0.1179,0.9335,0.3387 -0.0000,0.0000,0.0000,-0.0883,0.9340,0.3461 -0.0000,0.0000,0.0000,-0.0587,0.9336,0.3535 -0.0000,0.0000,0.0000,-0.0293,0.9322,0.3608 -0.0000,0.0000,0.0000,0.0000,0.9298,0.3681 -0.0000,0.0000,0.0000,0.0291,0.9264,0.3754 -0.0000,0.0000,0.0000,0.0580,0.9221,0.3827 -0.0000,0.0000,0.0000,0.0867,0.9168,0.3899 -0.0000,0.0000,0.0000,0.1150,0.9105,0.3971 -0.0000,0.0000,0.0000,0.1431,0.9033,0.4043 -0.0000,0.0000,0.0000,0.1708,0.8953,0.4115 -0.0000,0.0000,0.0000,0.1981,0.8863,0.4187 -0.0000,0.0000,0.0000,0.2250,0.8764,0.4258 -0.0000,0.0000,0.0000,0.2515,0.8657,0.4329 -0.0000,0.0000,0.0000,0.2775,0.8541,0.4399 -0.0000,0.0000,0.0000,0.3030,0.8417,0.4470 -0.0000,0.0000,0.0000,0.3280,0.8284,0.4540 -0.0000,0.0000,0.0000,0.3524,0.8144,0.4610 -0.0000,0.0000,0.0000,0.3763,0.7997,0.4679 -0.0000,0.0000,0.0000,0.3995,0.7841,0.4749 -0.0000,0.0000,0.0000,0.4222,0.7679,0.4818 -0.0000,0.0000,0.0000,0.4441,0.7510,0.4886 -0.0000,0.0000,0.0000,0.4654,0.7334,0.4955 -0.0000,0.0000,0.0000,0.4860,0.7152,0.5023 -0.0000,0.0000,0.0000,0.5059,0.6964,0.5090 -0.0000,0.0000,0.0000,0.5251,0.6769,0.5158 -0.0000,0.0000,0.0000,0.5435,0.6570,0.5225 -0.0000,0.0000,0.0000,0.5611,0.6365,0.5292 -0.0000,0.0000,0.0000,0.5780,0.6155,0.5358 -0.0000,0.0000,0.0000,0.5940,0.5940,0.5424 -0.0000,0.0000,0.0000,0.6093,0.5721,0.5490 -0.0000,0.0000,0.0000,0.6237,0.5499,0.5556 -0.0000,0.0000,0.0000,0.6373,0.5272,0.5621 -0.0000,0.0000,0.0000,0.6500,0.5042,0.5686 -0.0000,0.0000,0.0000,0.6619,0.4809,0.5750 -0.0000,0.0000,0.0000,0.6729,0.4573,0.5814 -0.0000,0.0000,0.0000,0.6831,0.4335,0.5878 -0.0000,0.0000,0.0000,0.6924,0.4095,0.5941 -0.0000,0.0000,0.0000,0.7008,0.3852,0.6004 -0.0000,0.0000,0.0000,0.7083,0.3609,0.6067 -0.0000,0.0000,0.0000,0.7150,0.3364,0.6129 -0.0000,0.0000,0.0000,0.7207,0.3119,0.6191 -0.0000,0.0000,0.0000,0.7256,0.2873,0.6252 -0.0000,0.0000,0.0000,0.7296,0.2627,0.6314 -0.0000,0.0000,0.0000,0.7328,0.2381,0.6374 -0.0000,0.0000,0.0000,0.7351,0.2136,0.6435 -0.0000,0.0000,0.0000,0.7365,0.1891,0.6494 -0.0000,0.0000,0.0000,0.7371,0.1648,0.6554 -0.0000,0.0000,0.0000,0.7368,0.1406,0.6613 -0.0000,0.0000,0.0000,0.7357,0.1165,0.6672 -0.0000,0.0000,0.0000,0.7338,0.0927,0.6730 -0.0000,0.0000,0.0000,0.7311,0.0691,0.6788 -0.0000,0.0000,0.0000,0.7275,0.0458,0.6845 -0.0000,0.0000,0.0000,0.7232,0.0227,0.6903 -0.0000,0.0000,0.0000,0.7181,-0.0000,0.6959 diff --git a/scripts/trajectories/full-circle-with-up-and-down-4s-ccw-Vector3.csv b/scripts/trajectories/full-circle-with-up-and-down-4s-ccw-Vector3.csv deleted file mode 100644 index 6310889020..0000000000 --- a/scripts/trajectories/full-circle-with-up-and-down-4s-ccw-Vector3.csv +++ /dev/null @@ -1,200 +0,0 @@ -0.0000,0.0000,0.0000,0.7012,0.0220,0.7126 -0.0000,0.0000,0.0000,0.7057,0.0444,0.7071 -0.0000,0.0000,0.0000,0.7095,0.0671,0.7015 -0.0000,0.0000,0.0000,0.7125,0.0900,0.6959 -0.0000,0.0000,0.0000,0.7147,0.1132,0.6903 -0.0000,0.0000,0.0000,0.7161,0.1366,0.6845 -0.0000,0.0000,0.0000,0.7166,0.1602,0.6788 -0.0000,0.0000,0.0000,0.7164,0.1839,0.6730 -0.0000,0.0000,0.0000,0.7153,0.2078,0.6672 -0.0000,0.0000,0.0000,0.7134,0.2318,0.6613 -0.0000,0.0000,0.0000,0.7106,0.2558,0.6554 -0.0000,0.0000,0.0000,0.7070,0.2799,0.6494 -0.0000,0.0000,0.0000,0.7025,0.3040,0.6435 -0.0000,0.0000,0.0000,0.6972,0.3281,0.6374 -0.0000,0.0000,0.0000,0.6910,0.3521,0.6314 -0.0000,0.0000,0.0000,0.6839,0.3760,0.6252 -0.0000,0.0000,0.0000,0.6760,0.3998,0.6191 -0.0000,0.0000,0.0000,0.6671,0.4234,0.6129 -0.0000,0.0000,0.0000,0.6575,0.4468,0.6067 -0.0000,0.0000,0.0000,0.6470,0.4700,0.6004 -0.0000,0.0000,0.0000,0.6356,0.4930,0.5941 -0.0000,0.0000,0.0000,0.6234,0.5157,0.5878 -0.0000,0.0000,0.0000,0.6103,0.5380,0.5814 -0.0000,0.0000,0.0000,0.5964,0.5601,0.5750 -0.0000,0.0000,0.0000,0.5817,0.5817,0.5686 -0.0000,0.0000,0.0000,0.5662,0.6029,0.5621 -0.0000,0.0000,0.0000,0.5499,0.6237,0.5556 -0.0000,0.0000,0.0000,0.5328,0.6440,0.5490 -0.0000,0.0000,0.0000,0.5149,0.6638,0.5424 -0.0000,0.0000,0.0000,0.4963,0.6831,0.5358 -0.0000,0.0000,0.0000,0.4769,0.7018,0.5292 -0.0000,0.0000,0.0000,0.4569,0.7199,0.5225 -0.0000,0.0000,0.0000,0.4361,0.7374,0.5158 -0.0000,0.0000,0.0000,0.4147,0.7543,0.5090 -0.0000,0.0000,0.0000,0.3926,0.7705,0.5023 -0.0000,0.0000,0.0000,0.3698,0.7860,0.4955 -0.0000,0.0000,0.0000,0.3465,0.8007,0.4886 -0.0000,0.0000,0.0000,0.3226,0.8148,0.4818 -0.0000,0.0000,0.0000,0.2981,0.8280,0.4749 -0.0000,0.0000,0.0000,0.2731,0.8405,0.4679 -0.0000,0.0000,0.0000,0.2476,0.8522,0.4610 -0.0000,0.0000,0.0000,0.2216,0.8630,0.4540 -0.0000,0.0000,0.0000,0.1951,0.8730,0.4470 -0.0000,0.0000,0.0000,0.1683,0.8821,0.4399 -0.0000,0.0000,0.0000,0.1410,0.8904,0.4329 -0.0000,0.0000,0.0000,0.1134,0.8977,0.4258 -0.0000,0.0000,0.0000,0.0855,0.9041,0.4187 -0.0000,0.0000,0.0000,0.0572,0.9096,0.4115 -0.0000,0.0000,0.0000,0.0287,0.9142,0.4043 -0.0000,0.0000,0.0000,-0.0000,0.9178,0.3971 -0.0000,0.0000,0.0000,-0.0289,0.9204,0.3899 -0.0000,0.0000,0.0000,-0.0580,0.9221,0.3827 -0.0000,0.0000,0.0000,-0.0872,0.9227,0.3754 -0.0000,0.0000,0.0000,-0.1165,0.9224,0.3681 -0.0000,0.0000,0.0000,-0.1459,0.9212,0.3608 -0.0000,0.0000,0.0000,-0.1753,0.9189,0.3535 -0.0000,0.0000,0.0000,-0.2047,0.9156,0.3461 -0.0000,0.0000,0.0000,-0.2340,0.9113,0.3387 -0.0000,0.0000,0.0000,-0.2632,0.9060,0.3313 -0.0000,0.0000,0.0000,-0.2924,0.8998,0.3239 -0.0000,0.0000,0.0000,-0.3213,0.8925,0.3165 -0.0000,0.0000,0.0000,-0.3501,0.8843,0.3090 -0.0000,0.0000,0.0000,-0.3787,0.8750,0.3015 -0.0000,0.0000,0.0000,-0.4070,0.8648,0.2940 -0.0000,0.0000,0.0000,-0.4350,0.8536,0.2865 -0.0000,0.0000,0.0000,-0.4626,0.8415,0.2790 -0.0000,0.0000,0.0000,-0.4899,0.8284,0.2714 -0.0000,0.0000,0.0000,-0.5168,0.8144,0.2639 -0.0000,0.0000,0.0000,-0.5433,0.7995,0.2563 -0.0000,0.0000,0.0000,-0.5693,0.7836,0.2487 -0.0000,0.0000,0.0000,-0.5948,0.7669,0.2411 -0.0000,0.0000,0.0000,-0.6198,0.7492,0.2334 -0.0000,0.0000,0.0000,-0.6442,0.7307,0.2258 -0.0000,0.0000,0.0000,-0.6681,0.7114,0.2181 -0.0000,0.0000,0.0000,-0.6913,0.6913,0.2105 -0.0000,0.0000,0.0000,-0.7138,0.6703,0.2028 -0.0000,0.0000,0.0000,-0.7357,0.6486,0.1951 -0.0000,0.0000,0.0000,-0.7569,0.6261,0.1874 -0.0000,0.0000,0.0000,-0.7773,0.6029,0.1797 -0.0000,0.0000,0.0000,-0.7970,0.5790,0.1719 -0.0000,0.0000,0.0000,-0.8159,0.5545,0.1642 -0.0000,0.0000,0.0000,-0.8339,0.5292,0.1564 -0.0000,0.0000,0.0000,-0.8512,0.5034,0.1487 -0.0000,0.0000,0.0000,-0.8676,0.4769,0.1409 -0.0000,0.0000,0.0000,-0.8831,0.4499,0.1331 -0.0000,0.0000,0.0000,-0.8977,0.4224,0.1253 -0.0000,0.0000,0.0000,-0.9114,0.3944,0.1175 -0.0000,0.0000,0.0000,-0.9242,0.3659,0.1097 -0.0000,0.0000,0.0000,-0.9360,0.3370,0.1019 -0.0000,0.0000,0.0000,-0.9468,0.3076,0.0941 -0.0000,0.0000,0.0000,-0.9567,0.2779,0.0863 -0.0000,0.0000,0.0000,-0.9656,0.2479,0.0785 -0.0000,0.0000,0.0000,-0.9735,0.2176,0.0706 -0.0000,0.0000,0.0000,-0.9803,0.1870,0.0628 -0.0000,0.0000,0.0000,-0.9862,0.1562,0.0549 -0.0000,0.0000,0.0000,-0.9910,0.1252,0.0471 -0.0000,0.0000,0.0000,-0.9948,0.0940,0.0393 -0.0000,0.0000,0.0000,-0.9975,0.0628,0.0314 -0.0000,0.0000,0.0000,-0.9992,0.0314,0.0236 -0.0000,0.0000,0.0000,-0.9999,-0.0000,0.0157 -0.0000,0.0000,0.0000,-0.9995,-0.0314,0.0079 -0.0000,0.0000,0.0000,-0.9980,-0.0628,-0.0000 -0.0000,0.0000,0.0000,-0.9955,-0.0941,-0.0079 -0.0000,0.0000,0.0000,-0.9920,-0.1253,-0.0157 -0.0000,0.0000,0.0000,-0.9874,-0.1564,-0.0236 -0.0000,0.0000,0.0000,-0.9818,-0.1873,-0.0314 -0.0000,0.0000,0.0000,-0.9752,-0.2180,-0.0393 -0.0000,0.0000,0.0000,-0.9675,-0.2484,-0.0471 -0.0000,0.0000,0.0000,-0.9588,-0.2786,-0.0550 -0.0000,0.0000,0.0000,-0.9492,-0.3084,-0.0628 -0.0000,0.0000,0.0000,-0.9385,-0.3379,-0.0706 -0.0000,0.0000,0.0000,-0.9269,-0.3670,-0.0785 -0.0000,0.0000,0.0000,-0.9143,-0.3957,-0.0863 -0.0000,0.0000,0.0000,-0.9008,-0.4239,-0.0941 -0.0000,0.0000,0.0000,-0.8864,-0.4516,-0.1019 -0.0000,0.0000,0.0000,-0.8710,-0.4788,-0.1097 -0.0000,0.0000,0.0000,-0.8548,-0.5055,-0.1175 -0.0000,0.0000,0.0000,-0.8377,-0.5316,-0.1253 -0.0000,0.0000,0.0000,-0.8197,-0.5571,-0.1331 -0.0000,0.0000,0.0000,-0.8009,-0.5819,-0.1409 -0.0000,0.0000,0.0000,-0.7814,-0.6061,-0.1487 -0.0000,0.0000,0.0000,-0.7610,-0.6296,-0.1564 -0.0000,0.0000,0.0000,-0.7399,-0.6523,-0.1642 -0.0000,0.0000,0.0000,-0.7181,-0.6744,-0.1719 -0.0000,0.0000,0.0000,-0.6956,-0.6956,-0.1797 -0.0000,0.0000,0.0000,-0.6724,-0.7161,-0.1874 -0.0000,0.0000,0.0000,-0.6486,-0.7357,-0.1951 -0.0000,0.0000,0.0000,-0.6242,-0.7545,-0.2028 -0.0000,0.0000,0.0000,-0.5992,-0.7725,-0.2105 -0.0000,0.0000,0.0000,-0.5736,-0.7895,-0.2181 -0.0000,0.0000,0.0000,-0.5476,-0.8057,-0.2258 -0.0000,0.0000,0.0000,-0.5210,-0.8210,-0.2334 -0.0000,0.0000,0.0000,-0.4940,-0.8354,-0.2411 -0.0000,0.0000,0.0000,-0.4666,-0.8488,-0.2487 -0.0000,0.0000,0.0000,-0.4388,-0.8612,-0.2563 -0.0000,0.0000,0.0000,-0.4107,-0.8728,-0.2639 -0.0000,0.0000,0.0000,-0.3822,-0.8833,-0.2714 -0.0000,0.0000,0.0000,-0.3535,-0.8929,-0.2790 -0.0000,0.0000,0.0000,-0.3245,-0.9014,-0.2865 -0.0000,0.0000,0.0000,-0.2954,-0.9090,-0.2940 -0.0000,0.0000,0.0000,-0.2660,-0.9156,-0.3015 -0.0000,0.0000,0.0000,-0.2365,-0.9212,-0.3090 -0.0000,0.0000,0.0000,-0.2069,-0.9258,-0.3165 -0.0000,0.0000,0.0000,-0.1773,-0.9293,-0.3239 -0.0000,0.0000,0.0000,-0.1476,-0.9319,-0.3313 -0.0000,0.0000,0.0000,-0.1179,-0.9335,-0.3387 -0.0000,0.0000,0.0000,-0.0883,-0.9340,-0.3461 -0.0000,0.0000,0.0000,-0.0587,-0.9336,-0.3535 -0.0000,0.0000,0.0000,-0.0293,-0.9322,-0.3608 -0.0000,0.0000,0.0000,0.0000,-0.9298,-0.3681 -0.0000,0.0000,0.0000,0.0291,-0.9264,-0.3754 -0.0000,0.0000,0.0000,0.0580,-0.9221,-0.3827 -0.0000,0.0000,0.0000,0.0867,-0.9168,-0.3899 -0.0000,0.0000,0.0000,0.1150,-0.9105,-0.3971 -0.0000,0.0000,0.0000,0.1431,-0.9033,-0.4043 -0.0000,0.0000,0.0000,0.1708,-0.8953,-0.4115 -0.0000,0.0000,0.0000,0.1981,-0.8863,-0.4187 -0.0000,0.0000,0.0000,0.2250,-0.8764,-0.4258 -0.0000,0.0000,0.0000,0.2515,-0.8657,-0.4329 -0.0000,0.0000,0.0000,0.2775,-0.8541,-0.4399 -0.0000,0.0000,0.0000,0.3030,-0.8417,-0.4470 -0.0000,0.0000,0.0000,0.3280,-0.8284,-0.4540 -0.0000,0.0000,0.0000,0.3524,-0.8144,-0.4610 -0.0000,0.0000,0.0000,0.3763,-0.7997,-0.4679 -0.0000,0.0000,0.0000,0.3995,-0.7841,-0.4749 -0.0000,0.0000,0.0000,0.4222,-0.7679,-0.4818 -0.0000,0.0000,0.0000,0.4441,-0.7510,-0.4886 -0.0000,0.0000,0.0000,0.4654,-0.7334,-0.4955 -0.0000,0.0000,0.0000,0.4860,-0.7152,-0.5023 -0.0000,0.0000,0.0000,0.5059,-0.6964,-0.5090 -0.0000,0.0000,0.0000,0.5251,-0.6769,-0.5158 -0.0000,0.0000,0.0000,0.5435,-0.6570,-0.5225 -0.0000,0.0000,0.0000,0.5611,-0.6365,-0.5292 -0.0000,0.0000,0.0000,0.5780,-0.6155,-0.5358 -0.0000,0.0000,0.0000,0.5940,-0.5940,-0.5424 -0.0000,0.0000,0.0000,0.6093,-0.5721,-0.5490 -0.0000,0.0000,0.0000,0.6237,-0.5499,-0.5556 -0.0000,0.0000,0.0000,0.6373,-0.5272,-0.5621 -0.0000,0.0000,0.0000,0.6500,-0.5042,-0.5686 -0.0000,0.0000,0.0000,0.6619,-0.4809,-0.5750 -0.0000,0.0000,0.0000,0.6729,-0.4573,-0.5814 -0.0000,0.0000,0.0000,0.6831,-0.4335,-0.5878 -0.0000,0.0000,0.0000,0.6924,-0.4095,-0.5941 -0.0000,0.0000,0.0000,0.7008,-0.3852,-0.6004 -0.0000,0.0000,0.0000,0.7083,-0.3609,-0.6067 -0.0000,0.0000,0.0000,0.7150,-0.3364,-0.6129 -0.0000,0.0000,0.0000,0.7207,-0.3119,-0.6191 -0.0000,0.0000,0.0000,0.7256,-0.2873,-0.6252 -0.0000,0.0000,0.0000,0.7296,-0.2627,-0.6314 -0.0000,0.0000,0.0000,0.7328,-0.2381,-0.6374 -0.0000,0.0000,0.0000,0.7351,-0.2136,-0.6435 -0.0000,0.0000,0.0000,0.7365,-0.1891,-0.6494 -0.0000,0.0000,0.0000,0.7371,-0.1648,-0.6554 -0.0000,0.0000,0.0000,0.7368,-0.1406,-0.6613 -0.0000,0.0000,0.0000,0.7357,-0.1165,-0.6672 -0.0000,0.0000,0.0000,0.7338,-0.0927,-0.6730 -0.0000,0.0000,0.0000,0.7311,-0.0691,-0.6788 -0.0000,0.0000,0.0000,0.7275,-0.0458,-0.6845 -0.0000,0.0000,0.0000,0.7232,-0.0227,-0.6903 -0.0000,0.0000,0.0000,0.7181,0.0000,-0.6959 diff --git a/scripts/trajectories/full-circle-with-up-and-down-4s-ccw.csv b/scripts/trajectories/full-circle-with-up-and-down-4s-ccw.csv deleted file mode 100644 index 1e4a316720..0000000000 --- a/scripts/trajectories/full-circle-with-up-and-down-4s-ccw.csv +++ /dev/null @@ -1,800 +0,0 @@ -0.9223,-0.0000,-0.3863,0.0119 -0.9223,-0.0000,-0.3863,0.0119 -0.9223,-0.0000,-0.3863,0.0119 -0.9223,-0.0000,-0.3863,0.0119 -0.9235,-0.0000,-0.3828,0.0240 -0.9235,-0.0000,-0.3828,0.0240 -0.9235,-0.0000,-0.3828,0.0240 -0.9235,-0.0000,-0.3828,0.0240 -0.9245,-0.0000,-0.3794,0.0363 -0.9245,-0.0000,-0.3794,0.0363 -0.9245,-0.0000,-0.3794,0.0363 -0.9245,-0.0000,-0.3794,0.0363 -0.9253,-0.0000,-0.3760,0.0486 -0.9253,-0.0000,-0.3760,0.0486 -0.9253,-0.0000,-0.3760,0.0486 -0.9253,-0.0000,-0.3760,0.0486 -0.9259,-0.0000,-0.3727,0.0611 -0.9259,-0.0000,-0.3727,0.0611 -0.9259,-0.0000,-0.3727,0.0611 -0.9259,-0.0000,-0.3727,0.0611 -0.9263,-0.0000,-0.3695,0.0737 -0.9263,-0.0000,-0.3695,0.0737 -0.9263,-0.0000,-0.3695,0.0737 -0.9263,-0.0000,-0.3695,0.0737 -0.9265,-0.0000,-0.3663,0.0865 -0.9265,-0.0000,-0.3663,0.0865 -0.9265,-0.0000,-0.3663,0.0865 -0.9265,-0.0000,-0.3663,0.0865 -0.9264,-0.0000,-0.3632,0.0993 -0.9264,-0.0000,-0.3632,0.0993 -0.9264,-0.0000,-0.3632,0.0993 -0.9264,-0.0000,-0.3632,0.0993 -0.9261,-0.0000,-0.3602,0.1122 -0.9261,-0.0000,-0.3602,0.1122 -0.9261,-0.0000,-0.3602,0.1122 -0.9261,-0.0000,-0.3602,0.1122 -0.9256,-0.0000,-0.3572,0.1252 -0.9256,-0.0000,-0.3572,0.1252 -0.9256,-0.0000,-0.3572,0.1252 -0.9256,-0.0000,-0.3572,0.1252 -0.9248,-0.0000,-0.3543,0.1383 -0.9248,-0.0000,-0.3543,0.1383 -0.9248,-0.0000,-0.3543,0.1383 -0.9248,-0.0000,-0.3543,0.1383 -0.9239,-0.0000,-0.3515,0.1515 -0.9239,-0.0000,-0.3515,0.1515 -0.9239,-0.0000,-0.3515,0.1515 -0.9239,-0.0000,-0.3515,0.1515 -0.9226,-0.0000,-0.3487,0.1648 -0.9226,-0.0000,-0.3487,0.1648 -0.9226,-0.0000,-0.3487,0.1648 -0.9226,-0.0000,-0.3487,0.1648 -0.9212,-0.0000,-0.3460,0.1781 -0.9212,-0.0000,-0.3460,0.1781 -0.9212,-0.0000,-0.3460,0.1781 -0.9212,-0.0000,-0.3460,0.1781 -0.9195,-0.0000,-0.3433,0.1914 -0.9195,-0.0000,-0.3433,0.1914 -0.9195,-0.0000,-0.3433,0.1914 -0.9195,-0.0000,-0.3433,0.1914 -0.9176,-0.0000,-0.3407,0.2049 -0.9176,-0.0000,-0.3407,0.2049 -0.9176,-0.0000,-0.3407,0.2049 -0.9176,-0.0000,-0.3407,0.2049 -0.9154,-0.0000,-0.3382,0.2183 -0.9154,-0.0000,-0.3382,0.2183 -0.9154,-0.0000,-0.3382,0.2183 -0.9154,-0.0000,-0.3382,0.2183 -0.9130,-0.0000,-0.3357,0.2319 -0.9130,-0.0000,-0.3357,0.2319 -0.9130,-0.0000,-0.3357,0.2319 -0.9130,-0.0000,-0.3357,0.2319 -0.9104,-0.0000,-0.3332,0.2454 -0.9104,-0.0000,-0.3332,0.2454 -0.9104,-0.0000,-0.3332,0.2454 -0.9104,-0.0000,-0.3332,0.2454 -0.9075,-0.0000,-0.3308,0.2590 -0.9075,-0.0000,-0.3308,0.2590 -0.9075,-0.0000,-0.3308,0.2590 -0.9075,-0.0000,-0.3308,0.2590 -0.9043,-0.0000,-0.3285,0.2726 -0.9043,-0.0000,-0.3285,0.2726 -0.9043,-0.0000,-0.3285,0.2726 -0.9043,-0.0000,-0.3285,0.2726 -0.9009,-0.0000,-0.3262,0.2862 -0.9009,-0.0000,-0.3262,0.2862 -0.9009,-0.0000,-0.3262,0.2862 -0.9009,-0.0000,-0.3262,0.2862 -0.8973,-0.0000,-0.3240,0.2998 -0.8973,-0.0000,-0.3240,0.2998 -0.8973,-0.0000,-0.3240,0.2998 -0.8973,-0.0000,-0.3240,0.2998 -0.8934,-0.0000,-0.3218,0.3134 -0.8934,-0.0000,-0.3218,0.3134 -0.8934,-0.0000,-0.3218,0.3134 -0.8934,-0.0000,-0.3218,0.3134 -0.8893,-0.0000,-0.3197,0.3271 -0.8893,-0.0000,-0.3197,0.3271 -0.8893,-0.0000,-0.3197,0.3271 -0.8893,-0.0000,-0.3197,0.3271 -0.8849,-0.0000,-0.3176,0.3407 -0.8849,-0.0000,-0.3176,0.3407 -0.8849,-0.0000,-0.3176,0.3407 -0.8849,-0.0000,-0.3176,0.3407 -0.8803,-0.0000,-0.3156,0.3543 -0.8803,-0.0000,-0.3156,0.3543 -0.8803,-0.0000,-0.3156,0.3543 -0.8803,-0.0000,-0.3156,0.3543 -0.8754,-0.0000,-0.3136,0.3678 -0.8754,-0.0000,-0.3136,0.3678 -0.8754,-0.0000,-0.3136,0.3678 -0.8754,-0.0000,-0.3136,0.3678 -0.8703,-0.0000,-0.3116,0.3814 -0.8703,-0.0000,-0.3116,0.3814 -0.8703,-0.0000,-0.3116,0.3814 -0.8703,-0.0000,-0.3116,0.3814 -0.8650,-0.0000,-0.3097,0.3949 -0.8650,-0.0000,-0.3097,0.3949 -0.8650,-0.0000,-0.3097,0.3949 -0.8650,-0.0000,-0.3097,0.3949 -0.8593,-0.0000,-0.3079,0.4083 -0.8593,-0.0000,-0.3079,0.4083 -0.8593,-0.0000,-0.3079,0.4083 -0.8593,-0.0000,-0.3079,0.4083 -0.8535,-0.0000,-0.3061,0.4217 -0.8535,-0.0000,-0.3061,0.4217 -0.8535,-0.0000,-0.3061,0.4217 -0.8535,-0.0000,-0.3061,0.4217 -0.8474,-0.0000,-0.3043,0.4351 -0.8474,-0.0000,-0.3043,0.4351 -0.8474,-0.0000,-0.3043,0.4351 -0.8474,-0.0000,-0.3043,0.4351 -0.8410,-0.0000,-0.3026,0.4484 -0.8410,-0.0000,-0.3026,0.4484 -0.8410,-0.0000,-0.3026,0.4484 -0.8410,-0.0000,-0.3026,0.4484 -0.8344,-0.0000,-0.3010,0.4617 -0.8344,-0.0000,-0.3010,0.4617 -0.8344,-0.0000,-0.3010,0.4617 -0.8344,-0.0000,-0.3010,0.4617 -0.8276,-0.0000,-0.2993,0.4748 -0.8276,-0.0000,-0.2993,0.4748 -0.8276,-0.0000,-0.2993,0.4748 -0.8276,-0.0000,-0.2993,0.4748 -0.8205,-0.0000,-0.2978,0.4879 -0.8205,-0.0000,-0.2978,0.4879 -0.8205,-0.0000,-0.2978,0.4879 -0.8205,-0.0000,-0.2978,0.4879 -0.8132,-0.0000,-0.2962,0.5010 -0.8132,-0.0000,-0.2962,0.5010 -0.8132,-0.0000,-0.2962,0.5010 -0.8132,-0.0000,-0.2962,0.5010 -0.8056,-0.0000,-0.2947,0.5139 -0.8056,-0.0000,-0.2947,0.5139 -0.8056,-0.0000,-0.2947,0.5139 -0.8056,-0.0000,-0.2947,0.5139 -0.7978,-0.0000,-0.2932,0.5267 -0.7978,-0.0000,-0.2932,0.5267 -0.7978,-0.0000,-0.2932,0.5267 -0.7978,-0.0000,-0.2932,0.5267 -0.7898,-0.0000,-0.2918,0.5395 -0.7898,-0.0000,-0.2918,0.5395 -0.7898,-0.0000,-0.2918,0.5395 -0.7898,-0.0000,-0.2918,0.5395 -0.7815,-0.0000,-0.2904,0.5521 -0.7815,-0.0000,-0.2904,0.5521 -0.7815,-0.0000,-0.2904,0.5521 -0.7815,-0.0000,-0.2904,0.5521 -0.7730,-0.0000,-0.2891,0.5647 -0.7730,-0.0000,-0.2891,0.5647 -0.7730,-0.0000,-0.2891,0.5647 -0.7730,-0.0000,-0.2891,0.5647 -0.7643,-0.0000,-0.2878,0.5771 -0.7643,-0.0000,-0.2878,0.5771 -0.7643,-0.0000,-0.2878,0.5771 -0.7643,-0.0000,-0.2878,0.5771 -0.7553,-0.0000,-0.2865,0.5894 -0.7553,-0.0000,-0.2865,0.5894 -0.7553,-0.0000,-0.2865,0.5894 -0.7553,-0.0000,-0.2865,0.5894 -0.7461,-0.0000,-0.2853,0.6016 -0.7461,-0.0000,-0.2853,0.6016 -0.7461,-0.0000,-0.2853,0.6016 -0.7461,-0.0000,-0.2853,0.6016 -0.7367,-0.0000,-0.2841,0.6136 -0.7367,-0.0000,-0.2841,0.6136 -0.7367,-0.0000,-0.2841,0.6136 -0.7367,-0.0000,-0.2841,0.6136 -0.7271,-0.0000,-0.2830,0.6255 -0.7271,-0.0000,-0.2830,0.6255 -0.7271,-0.0000,-0.2830,0.6255 -0.7271,-0.0000,-0.2830,0.6255 -0.7172,-0.0000,-0.2819,0.6373 -0.7172,-0.0000,-0.2819,0.6373 -0.7172,-0.0000,-0.2819,0.6373 -0.7172,-0.0000,-0.2819,0.6373 -0.7071,-0.0000,-0.2808,0.6490 -0.7071,-0.0000,-0.2808,0.6490 -0.7071,-0.0000,-0.2808,0.6490 -0.7071,-0.0000,-0.2808,0.6490 -0.6968,-0.0000,-0.2798,0.6604 -0.6968,-0.0000,-0.2798,0.6604 -0.6968,-0.0000,-0.2798,0.6604 -0.6968,-0.0000,-0.2798,0.6604 -0.6863,-0.0000,-0.2788,0.6718 -0.6863,-0.0000,-0.2788,0.6718 -0.6863,-0.0000,-0.2788,0.6718 -0.6863,-0.0000,-0.2788,0.6718 -0.6756,-0.0000,-0.2779,0.6829 -0.6756,-0.0000,-0.2779,0.6829 -0.6756,-0.0000,-0.2779,0.6829 -0.6756,-0.0000,-0.2779,0.6829 -0.6646,-0.0000,-0.2769,0.6940 -0.6646,-0.0000,-0.2769,0.6940 -0.6646,-0.0000,-0.2769,0.6940 -0.6646,-0.0000,-0.2769,0.6940 -0.6535,-0.0000,-0.2761,0.7048 -0.6535,-0.0000,-0.2761,0.7048 -0.6535,-0.0000,-0.2761,0.7048 -0.6535,-0.0000,-0.2761,0.7048 -0.6422,-0.0000,-0.2752,0.7155 -0.6422,-0.0000,-0.2752,0.7155 -0.6422,-0.0000,-0.2752,0.7155 -0.6422,-0.0000,-0.2752,0.7155 -0.6306,-0.0000,-0.2744,0.7260 -0.6306,-0.0000,-0.2744,0.7260 -0.6306,-0.0000,-0.2744,0.7260 -0.6306,-0.0000,-0.2744,0.7260 -0.6189,-0.0000,-0.2737,0.7363 -0.6189,-0.0000,-0.2737,0.7363 -0.6189,-0.0000,-0.2737,0.7363 -0.6189,-0.0000,-0.2737,0.7363 -0.6069,-0.0000,-0.2730,0.7464 -0.6069,-0.0000,-0.2730,0.7464 -0.6069,-0.0000,-0.2730,0.7464 -0.6069,-0.0000,-0.2730,0.7464 -0.5948,-0.0000,-0.2723,0.7563 -0.5948,-0.0000,-0.2723,0.7563 -0.5948,-0.0000,-0.2723,0.7563 -0.5948,-0.0000,-0.2723,0.7563 -0.5825,-0.0000,-0.2716,0.7661 -0.5825,-0.0000,-0.2716,0.7661 -0.5825,-0.0000,-0.2716,0.7661 -0.5825,-0.0000,-0.2716,0.7661 -0.5700,-0.0000,-0.2710,0.7756 -0.5700,-0.0000,-0.2710,0.7756 -0.5700,-0.0000,-0.2710,0.7756 -0.5700,-0.0000,-0.2710,0.7756 -0.5574,-0.0000,-0.2705,0.7850 -0.5574,-0.0000,-0.2705,0.7850 -0.5574,-0.0000,-0.2705,0.7850 -0.5574,-0.0000,-0.2705,0.7850 -0.5445,-0.0000,-0.2700,0.7941 -0.5445,-0.0000,-0.2700,0.7941 -0.5445,-0.0000,-0.2700,0.7941 -0.5445,-0.0000,-0.2700,0.7941 -0.5315,-0.0000,-0.2695,0.8030 -0.5315,-0.0000,-0.2695,0.8030 -0.5315,-0.0000,-0.2695,0.8030 -0.5315,-0.0000,-0.2695,0.8030 -0.5184,-0.0000,-0.2691,0.8117 -0.5184,-0.0000,-0.2691,0.8117 -0.5184,-0.0000,-0.2691,0.8117 -0.5184,-0.0000,-0.2691,0.8117 -0.5050,-0.0000,-0.2687,0.8202 -0.5050,-0.0000,-0.2687,0.8202 -0.5050,-0.0000,-0.2687,0.8202 -0.5050,-0.0000,-0.2687,0.8202 -0.4915,-0.0000,-0.2684,0.8285 -0.4915,-0.0000,-0.2684,0.8285 -0.4915,-0.0000,-0.2684,0.8285 -0.4915,-0.0000,-0.2684,0.8285 -0.4779,-0.0000,-0.2682,0.8365 -0.4779,-0.0000,-0.2682,0.8365 -0.4779,-0.0000,-0.2682,0.8365 -0.4779,-0.0000,-0.2682,0.8365 -0.4640,-0.0000,-0.2680,0.8443 -0.4640,-0.0000,-0.2680,0.8443 -0.4640,-0.0000,-0.2680,0.8443 -0.4640,-0.0000,-0.2680,0.8443 -0.4501,-0.0000,-0.2678,0.8519 -0.4501,-0.0000,-0.2678,0.8519 -0.4501,-0.0000,-0.2678,0.8519 -0.4501,-0.0000,-0.2678,0.8519 -0.4360,-0.0000,-0.2677,0.8592 -0.4360,-0.0000,-0.2677,0.8592 -0.4360,-0.0000,-0.2677,0.8592 -0.4360,-0.0000,-0.2677,0.8592 -0.4218,-0.0000,-0.2677,0.8663 -0.4218,-0.0000,-0.2677,0.8663 -0.4218,-0.0000,-0.2677,0.8663 -0.4218,-0.0000,-0.2677,0.8663 -0.4074,-0.0000,-0.2677,0.8731 -0.4074,-0.0000,-0.2677,0.8731 -0.4074,-0.0000,-0.2677,0.8731 -0.4074,-0.0000,-0.2677,0.8731 -0.3929,-0.0000,-0.2678,0.8797 -0.3929,-0.0000,-0.2678,0.8797 -0.3929,-0.0000,-0.2678,0.8797 -0.3929,-0.0000,-0.2678,0.8797 -0.3783,-0.0000,-0.2680,0.8860 -0.3783,-0.0000,-0.2680,0.8860 -0.3783,-0.0000,-0.2680,0.8860 -0.3783,-0.0000,-0.2680,0.8860 -0.3635,-0.0000,-0.2683,0.8921 -0.3635,-0.0000,-0.2683,0.8921 -0.3635,-0.0000,-0.2683,0.8921 -0.3635,-0.0000,-0.2683,0.8921 -0.3487,-0.0000,-0.2687,0.8979 -0.3487,-0.0000,-0.2687,0.8979 -0.3487,-0.0000,-0.2687,0.8979 -0.3487,-0.0000,-0.2687,0.8979 -0.3337,-0.0000,-0.2692,0.9034 -0.3337,-0.0000,-0.2692,0.9034 -0.3337,-0.0000,-0.2692,0.9034 -0.3337,-0.0000,-0.2692,0.9034 -0.3186,-0.0000,-0.2698,0.9087 -0.3186,-0.0000,-0.2698,0.9087 -0.3186,-0.0000,-0.2698,0.9087 -0.3186,-0.0000,-0.2698,0.9087 -0.3034,-0.0000,-0.2705,0.9136 -0.3034,-0.0000,-0.2705,0.9136 -0.3034,-0.0000,-0.2705,0.9136 -0.3034,-0.0000,-0.2705,0.9136 -0.2882,-0.0000,-0.2714,0.9183 -0.2882,-0.0000,-0.2714,0.9183 -0.2882,-0.0000,-0.2714,0.9183 -0.2882,-0.0000,-0.2714,0.9183 -0.2728,-0.0000,-0.2725,0.9227 -0.2728,-0.0000,-0.2725,0.9227 -0.2728,-0.0000,-0.2725,0.9227 -0.2728,-0.0000,-0.2725,0.9227 -0.2573,-0.0000,-0.2738,0.9267 -0.2573,-0.0000,-0.2738,0.9267 -0.2573,-0.0000,-0.2738,0.9267 -0.2573,-0.0000,-0.2738,0.9267 -0.2418,-0.0000,-0.2753,0.9305 -0.2418,-0.0000,-0.2753,0.9305 -0.2418,-0.0000,-0.2753,0.9305 -0.2418,-0.0000,-0.2753,0.9305 -0.2262,-0.0000,-0.2771,0.9339 -0.2262,-0.0000,-0.2771,0.9339 -0.2262,-0.0000,-0.2771,0.9339 -0.2262,-0.0000,-0.2771,0.9339 -0.2105,-0.0000,-0.2792,0.9369 -0.2105,-0.0000,-0.2792,0.9369 -0.2105,-0.0000,-0.2792,0.9369 -0.2105,-0.0000,-0.2792,0.9369 -0.1947,-0.0000,-0.2818,0.9395 -0.1947,-0.0000,-0.2818,0.9395 -0.1947,-0.0000,-0.2818,0.9395 -0.1947,-0.0000,-0.2818,0.9395 -0.1789,-0.0000,-0.2848,0.9417 -0.1789,-0.0000,-0.2848,0.9417 -0.1789,-0.0000,-0.2848,0.9417 -0.1789,-0.0000,-0.2848,0.9417 -0.1630,-0.0000,-0.2886,0.9435 -0.1630,-0.0000,-0.2886,0.9435 -0.1630,-0.0000,-0.2886,0.9435 -0.1630,-0.0000,-0.2886,0.9435 -0.1471,-0.0000,-0.2933,0.9446 -0.1471,-0.0000,-0.2933,0.9446 -0.1471,-0.0000,-0.2933,0.9446 -0.1471,-0.0000,-0.2933,0.9446 -0.1312,-0.0000,-0.2991,0.9452 -0.1312,-0.0000,-0.2991,0.9452 -0.1312,-0.0000,-0.2991,0.9452 -0.1312,-0.0000,-0.2991,0.9452 -0.1152,-0.0000,-0.3067,0.9448 -0.1152,-0.0000,-0.3067,0.9448 -0.1152,-0.0000,-0.3067,0.9448 -0.1152,-0.0000,-0.3067,0.9448 -0.0991,-0.0000,-0.3167,0.9433 -0.0991,-0.0000,-0.3167,0.9433 -0.0991,-0.0000,-0.3167,0.9433 -0.0991,-0.0000,-0.3167,0.9433 -0.0831,-0.0000,-0.3307,0.9401 -0.0831,-0.0000,-0.3307,0.9401 -0.0831,-0.0000,-0.3307,0.9401 -0.0831,-0.0000,-0.3307,0.9401 -0.0670,-0.0000,-0.3514,0.9338 -0.0670,-0.0000,-0.3514,0.9338 -0.0670,-0.0000,-0.3514,0.9338 -0.0670,-0.0000,-0.3514,0.9338 -0.0510,-0.0000,-0.3848,0.9216 -0.0510,-0.0000,-0.3848,0.9216 -0.0510,-0.0000,-0.3848,0.9216 -0.0510,-0.0000,-0.3848,0.9216 -0.0351,-0.0000,-0.4473,0.8937 -0.0351,-0.0000,-0.4473,0.8937 -0.0351,-0.0000,-0.4473,0.8937 -0.0351,-0.0000,-0.4473,0.8937 -0.0196,-0.0000,-0.6000,0.7997 -0.0196,-0.0000,-0.6000,0.7997 -0.0196,-0.0000,-0.6000,0.7997 -0.0196,-0.0000,-0.6000,0.7997 -0.0079,-0.0000,-1.0000,-0.0001 -0.0079,-0.0000,-1.0000,-0.0001 -0.0079,-0.0000,-1.0000,-0.0001 -0.0079,-0.0000,-1.0000,-0.0001 -0.0162,-0.0000,-0.2425,-0.9700 -0.0162,-0.0000,-0.2425,-0.9700 -0.0162,-0.0000,-0.2425,-0.9700 -0.0162,-0.0000,-0.2425,-0.9700 -0.0314,-0.0000,0.0000,-0.9995 -0.0314,-0.0000,0.0000,-0.9995 -0.0314,-0.0000,0.0000,-0.9995 -0.0314,-0.0000,0.0000,-0.9995 -0.0473,-0.0000,0.0831,-0.9954 -0.0473,-0.0000,0.0831,-0.9954 -0.0473,-0.0000,0.0831,-0.9954 -0.0473,-0.0000,0.0831,-0.9954 -0.0633,-0.0000,0.1241,-0.9902 -0.0633,-0.0000,0.1241,-0.9902 -0.0633,-0.0000,0.1241,-0.9902 -0.0633,-0.0000,0.1241,-0.9902 -0.0793,-0.0000,0.1485,-0.9857 -0.0793,-0.0000,0.1485,-0.9857 -0.0793,-0.0000,0.1485,-0.9857 -0.0793,-0.0000,0.1485,-0.9857 -0.0954,-0.0000,0.1646,-0.9817 -0.0954,-0.0000,0.1646,-0.9817 -0.0954,-0.0000,0.1646,-0.9817 -0.0954,-0.0000,0.1646,-0.9817 -0.1114,-0.0000,0.1762,-0.9780 -0.1114,-0.0000,0.1762,-0.9780 -0.1114,-0.0000,0.1762,-0.9780 -0.1114,-0.0000,0.1762,-0.9780 -0.1275,-0.0000,0.1848,-0.9745 -0.1275,-0.0000,0.1848,-0.9745 -0.1275,-0.0000,0.1848,-0.9745 -0.1275,-0.0000,0.1848,-0.9745 -0.1435,-0.0000,0.1915,-0.9709 -0.1435,-0.0000,0.1915,-0.9709 -0.1435,-0.0000,0.1915,-0.9709 -0.1435,-0.0000,0.1915,-0.9709 -0.1594,-0.0000,0.1970,-0.9674 -0.1594,-0.0000,0.1970,-0.9674 -0.1594,-0.0000,0.1970,-0.9674 -0.1594,-0.0000,0.1970,-0.9674 -0.1753,-0.0000,0.2014,-0.9637 -0.1753,-0.0000,0.2014,-0.9637 -0.1753,-0.0000,0.2014,-0.9637 -0.1753,-0.0000,0.2014,-0.9637 -0.1912,-0.0000,0.2052,-0.9599 -0.1912,-0.0000,0.2052,-0.9599 -0.1912,-0.0000,0.2052,-0.9599 -0.1912,-0.0000,0.2052,-0.9599 -0.2070,-0.0000,0.2085,-0.9559 -0.2070,-0.0000,0.2085,-0.9559 -0.2070,-0.0000,0.2085,-0.9559 -0.2070,-0.0000,0.2085,-0.9559 -0.2227,-0.0000,0.2113,-0.9517 -0.2227,-0.0000,0.2113,-0.9517 -0.2227,-0.0000,0.2113,-0.9517 -0.2227,-0.0000,0.2113,-0.9517 -0.2384,-0.0000,0.2138,-0.9473 -0.2384,-0.0000,0.2138,-0.9473 -0.2384,-0.0000,0.2138,-0.9473 -0.2384,-0.0000,0.2138,-0.9473 -0.2540,-0.0000,0.2161,-0.9428 -0.2540,-0.0000,0.2161,-0.9428 -0.2540,-0.0000,0.2161,-0.9428 -0.2540,-0.0000,0.2161,-0.9428 -0.2695,-0.0000,0.2181,-0.9380 -0.2695,-0.0000,0.2181,-0.9380 -0.2695,-0.0000,0.2181,-0.9380 -0.2695,-0.0000,0.2181,-0.9380 -0.2849,-0.0000,0.2200,-0.9330 -0.2849,-0.0000,0.2200,-0.9330 -0.2849,-0.0000,0.2200,-0.9330 -0.2849,-0.0000,0.2200,-0.9330 -0.3002,-0.0000,0.2217,-0.9277 -0.3002,-0.0000,0.2217,-0.9277 -0.3002,-0.0000,0.2217,-0.9277 -0.3002,-0.0000,0.2217,-0.9277 -0.3155,-0.0000,0.2233,-0.9223 -0.3155,-0.0000,0.2233,-0.9223 -0.3155,-0.0000,0.2233,-0.9223 -0.3155,-0.0000,0.2233,-0.9223 -0.3306,-0.0000,0.2248,-0.9166 -0.3306,-0.0000,0.2248,-0.9166 -0.3306,-0.0000,0.2248,-0.9166 -0.3306,-0.0000,0.2248,-0.9166 -0.3457,-0.0000,0.2263,-0.9107 -0.3457,-0.0000,0.2263,-0.9107 -0.3457,-0.0000,0.2263,-0.9107 -0.3457,-0.0000,0.2263,-0.9107 -0.3606,-0.0000,0.2277,-0.9045 -0.3606,-0.0000,0.2277,-0.9045 -0.3606,-0.0000,0.2277,-0.9045 -0.3606,-0.0000,0.2277,-0.9045 -0.3754,-0.0000,0.2290,-0.8981 -0.3754,-0.0000,0.2290,-0.8981 -0.3754,-0.0000,0.2290,-0.8981 -0.3754,-0.0000,0.2290,-0.8981 -0.3901,-0.0000,0.2303,-0.8915 -0.3901,-0.0000,0.2303,-0.8915 -0.3901,-0.0000,0.2303,-0.8915 -0.3901,-0.0000,0.2303,-0.8915 -0.4047,-0.0000,0.2315,-0.8847 -0.4047,-0.0000,0.2315,-0.8847 -0.4047,-0.0000,0.2315,-0.8847 -0.4047,-0.0000,0.2315,-0.8847 -0.4192,-0.0000,0.2327,-0.8776 -0.4192,-0.0000,0.2327,-0.8776 -0.4192,-0.0000,0.2327,-0.8776 -0.4192,-0.0000,0.2327,-0.8776 -0.4335,-0.0000,0.2339,-0.8703 -0.4335,-0.0000,0.2339,-0.8703 -0.4335,-0.0000,0.2339,-0.8703 -0.4335,-0.0000,0.2339,-0.8703 -0.4477,-0.0000,0.2351,-0.8627 -0.4477,-0.0000,0.2351,-0.8627 -0.4477,-0.0000,0.2351,-0.8627 -0.4477,-0.0000,0.2351,-0.8627 -0.4617,-0.0000,0.2362,-0.8550 -0.4617,-0.0000,0.2362,-0.8550 -0.4617,-0.0000,0.2362,-0.8550 -0.4617,-0.0000,0.2362,-0.8550 -0.4756,-0.0000,0.2374,-0.8470 -0.4756,-0.0000,0.2374,-0.8470 -0.4756,-0.0000,0.2374,-0.8470 -0.4756,-0.0000,0.2374,-0.8470 -0.4894,-0.0000,0.2385,-0.8388 -0.4894,-0.0000,0.2385,-0.8388 -0.4894,-0.0000,0.2385,-0.8388 -0.4894,-0.0000,0.2385,-0.8388 -0.5030,-0.0000,0.2396,-0.8304 -0.5030,-0.0000,0.2396,-0.8304 -0.5030,-0.0000,0.2396,-0.8304 -0.5030,-0.0000,0.2396,-0.8304 -0.5164,-0.0000,0.2408,-0.8218 -0.5164,-0.0000,0.2408,-0.8218 -0.5164,-0.0000,0.2408,-0.8218 -0.5164,-0.0000,0.2408,-0.8218 -0.5297,-0.0000,0.2419,-0.8130 -0.5297,-0.0000,0.2419,-0.8130 -0.5297,-0.0000,0.2419,-0.8130 -0.5297,-0.0000,0.2419,-0.8130 -0.5428,-0.0000,0.2431,-0.8039 -0.5428,-0.0000,0.2431,-0.8039 -0.5428,-0.0000,0.2431,-0.8039 -0.5428,-0.0000,0.2431,-0.8039 -0.5558,-0.0000,0.2442,-0.7947 -0.5558,-0.0000,0.2442,-0.7947 -0.5558,-0.0000,0.2442,-0.7947 -0.5558,-0.0000,0.2442,-0.7947 -0.5685,-0.0000,0.2454,-0.7852 -0.5685,-0.0000,0.2454,-0.7852 -0.5685,-0.0000,0.2454,-0.7852 -0.5685,-0.0000,0.2454,-0.7852 -0.5811,-0.0000,0.2465,-0.7756 -0.5811,-0.0000,0.2465,-0.7756 -0.5811,-0.0000,0.2465,-0.7756 -0.5811,-0.0000,0.2465,-0.7756 -0.5936,-0.0000,0.2477,-0.7657 -0.5936,-0.0000,0.2477,-0.7657 -0.5936,-0.0000,0.2477,-0.7657 -0.5936,-0.0000,0.2477,-0.7657 -0.6058,-0.0000,0.2489,-0.7557 -0.6058,-0.0000,0.2489,-0.7557 -0.6058,-0.0000,0.2489,-0.7557 -0.6058,-0.0000,0.2489,-0.7557 -0.6179,-0.0000,0.2501,-0.7455 -0.6179,-0.0000,0.2501,-0.7455 -0.6179,-0.0000,0.2501,-0.7455 -0.6179,-0.0000,0.2501,-0.7455 -0.6297,-0.0000,0.2513,-0.7351 -0.6297,-0.0000,0.2513,-0.7351 -0.6297,-0.0000,0.2513,-0.7351 -0.6297,-0.0000,0.2513,-0.7351 -0.6414,-0.0000,0.2525,-0.7245 -0.6414,-0.0000,0.2525,-0.7245 -0.6414,-0.0000,0.2525,-0.7245 -0.6414,-0.0000,0.2525,-0.7245 -0.6528,-0.0000,0.2538,-0.7137 -0.6528,-0.0000,0.2538,-0.7137 -0.6528,-0.0000,0.2538,-0.7137 -0.6528,-0.0000,0.2538,-0.7137 -0.6641,-0.0000,0.2550,-0.7028 -0.6641,-0.0000,0.2550,-0.7028 -0.6641,-0.0000,0.2550,-0.7028 -0.6641,-0.0000,0.2550,-0.7028 -0.6752,-0.0000,0.2563,-0.6917 -0.6752,-0.0000,0.2563,-0.6917 -0.6752,-0.0000,0.2563,-0.6917 -0.6752,-0.0000,0.2563,-0.6917 -0.6860,-0.0000,0.2576,-0.6804 -0.6860,-0.0000,0.2576,-0.6804 -0.6860,-0.0000,0.2576,-0.6804 -0.6860,-0.0000,0.2576,-0.6804 -0.6967,-0.0000,0.2590,-0.6690 -0.6967,-0.0000,0.2590,-0.6690 -0.6967,-0.0000,0.2590,-0.6690 -0.6967,-0.0000,0.2590,-0.6690 -0.7071,-0.0000,0.2603,-0.6575 -0.7071,-0.0000,0.2603,-0.6575 -0.7071,-0.0000,0.2603,-0.6575 -0.7071,-0.0000,0.2603,-0.6575 -0.7173,-0.0000,0.2617,-0.6457 -0.7173,-0.0000,0.2617,-0.6457 -0.7173,-0.0000,0.2617,-0.6457 -0.7173,-0.0000,0.2617,-0.6457 -0.7273,-0.0000,0.2631,-0.6339 -0.7273,-0.0000,0.2631,-0.6339 -0.7273,-0.0000,0.2631,-0.6339 -0.7273,-0.0000,0.2631,-0.6339 -0.7371,-0.0000,0.2645,-0.6219 -0.7371,-0.0000,0.2645,-0.6219 -0.7371,-0.0000,0.2645,-0.6219 -0.7371,-0.0000,0.2645,-0.6219 -0.7467,-0.0000,0.2659,-0.6097 -0.7467,-0.0000,0.2659,-0.6097 -0.7467,-0.0000,0.2659,-0.6097 -0.7467,-0.0000,0.2659,-0.6097 -0.7560,-0.0000,0.2674,-0.5974 -0.7560,-0.0000,0.2674,-0.5974 -0.7560,-0.0000,0.2674,-0.5974 -0.7560,-0.0000,0.2674,-0.5974 -0.7651,-0.0000,0.2689,-0.5851 -0.7651,-0.0000,0.2689,-0.5851 -0.7651,-0.0000,0.2689,-0.5851 -0.7651,-0.0000,0.2689,-0.5851 -0.7740,-0.0000,0.2705,-0.5725 -0.7740,-0.0000,0.2705,-0.5725 -0.7740,-0.0000,0.2705,-0.5725 -0.7740,-0.0000,0.2705,-0.5725 -0.7826,-0.0000,0.2720,-0.5599 -0.7826,-0.0000,0.2720,-0.5599 -0.7826,-0.0000,0.2720,-0.5599 -0.7826,-0.0000,0.2720,-0.5599 -0.7910,-0.0000,0.2736,-0.5472 -0.7910,-0.0000,0.2736,-0.5472 -0.7910,-0.0000,0.2736,-0.5472 -0.7910,-0.0000,0.2736,-0.5472 -0.7992,-0.0000,0.2752,-0.5343 -0.7992,-0.0000,0.2752,-0.5343 -0.7992,-0.0000,0.2752,-0.5343 -0.7992,-0.0000,0.2752,-0.5343 -0.8072,-0.0000,0.2769,-0.5214 -0.8072,-0.0000,0.2769,-0.5214 -0.8072,-0.0000,0.2769,-0.5214 -0.8072,-0.0000,0.2769,-0.5214 -0.8149,-0.0000,0.2786,-0.5083 -0.8149,-0.0000,0.2786,-0.5083 -0.8149,-0.0000,0.2786,-0.5083 -0.8149,-0.0000,0.2786,-0.5083 -0.8223,-0.0000,0.2803,-0.4952 -0.8223,-0.0000,0.2803,-0.4952 -0.8223,-0.0000,0.2803,-0.4952 -0.8223,-0.0000,0.2803,-0.4952 -0.8295,-0.0000,0.2820,-0.4820 -0.8295,-0.0000,0.2820,-0.4820 -0.8295,-0.0000,0.2820,-0.4820 -0.8295,-0.0000,0.2820,-0.4820 -0.8365,-0.0000,0.2838,-0.4687 -0.8365,-0.0000,0.2838,-0.4687 -0.8365,-0.0000,0.2838,-0.4687 -0.8365,-0.0000,0.2838,-0.4687 -0.8433,-0.0000,0.2857,-0.4553 -0.8433,-0.0000,0.2857,-0.4553 -0.8433,-0.0000,0.2857,-0.4553 -0.8433,-0.0000,0.2857,-0.4553 -0.8497,-0.0000,0.2875,-0.4419 -0.8497,-0.0000,0.2875,-0.4419 -0.8497,-0.0000,0.2875,-0.4419 -0.8497,-0.0000,0.2875,-0.4419 -0.8560,-0.0000,0.2894,-0.4284 -0.8560,-0.0000,0.2894,-0.4284 -0.8560,-0.0000,0.2894,-0.4284 -0.8560,-0.0000,0.2894,-0.4284 -0.8620,-0.0000,0.2913,-0.4148 -0.8620,-0.0000,0.2913,-0.4148 -0.8620,-0.0000,0.2913,-0.4148 -0.8620,-0.0000,0.2913,-0.4148 -0.8677,-0.0000,0.2933,-0.4012 -0.8677,-0.0000,0.2933,-0.4012 -0.8677,-0.0000,0.2933,-0.4012 -0.8677,-0.0000,0.2933,-0.4012 -0.8732,-0.0000,0.2953,-0.3876 -0.8732,-0.0000,0.2953,-0.3876 -0.8732,-0.0000,0.2953,-0.3876 -0.8732,-0.0000,0.2953,-0.3876 -0.8785,-0.0000,0.2974,-0.3739 -0.8785,-0.0000,0.2974,-0.3739 -0.8785,-0.0000,0.2974,-0.3739 -0.8785,-0.0000,0.2974,-0.3739 -0.8835,-0.0000,0.2995,-0.3602 -0.8835,-0.0000,0.2995,-0.3602 -0.8835,-0.0000,0.2995,-0.3602 -0.8835,-0.0000,0.2995,-0.3602 -0.8883,-0.0000,0.3016,-0.3465 -0.8883,-0.0000,0.3016,-0.3465 -0.8883,-0.0000,0.3016,-0.3465 -0.8883,-0.0000,0.3016,-0.3465 -0.8928,-0.0000,0.3038,-0.3327 -0.8928,-0.0000,0.3038,-0.3327 -0.8928,-0.0000,0.3038,-0.3327 -0.8928,-0.0000,0.3038,-0.3327 -0.8970,-0.0000,0.3060,-0.3189 -0.8970,-0.0000,0.3060,-0.3189 -0.8970,-0.0000,0.3060,-0.3189 -0.8970,-0.0000,0.3060,-0.3189 -0.9010,-0.0000,0.3083,-0.3051 -0.9010,-0.0000,0.3083,-0.3051 -0.9010,-0.0000,0.3083,-0.3051 -0.9010,-0.0000,0.3083,-0.3051 -0.9048,-0.0000,0.3106,-0.2913 -0.9048,-0.0000,0.3106,-0.2913 -0.9048,-0.0000,0.3106,-0.2913 -0.9048,-0.0000,0.3106,-0.2913 -0.9083,-0.0000,0.3130,-0.2776 -0.9083,-0.0000,0.3130,-0.2776 -0.9083,-0.0000,0.3130,-0.2776 -0.9083,-0.0000,0.3130,-0.2776 -0.9116,-0.0000,0.3154,-0.2638 -0.9116,-0.0000,0.3154,-0.2638 -0.9116,-0.0000,0.3154,-0.2638 -0.9116,-0.0000,0.3154,-0.2638 -0.9146,-0.0000,0.3179,-0.2500 -0.9146,-0.0000,0.3179,-0.2500 -0.9146,-0.0000,0.3179,-0.2500 -0.9146,-0.0000,0.3179,-0.2500 -0.9174,-0.0000,0.3204,-0.2363 -0.9174,-0.0000,0.3204,-0.2363 -0.9174,-0.0000,0.3204,-0.2363 -0.9174,-0.0000,0.3204,-0.2363 -0.9199,-0.0000,0.3229,-0.2226 -0.9199,-0.0000,0.3229,-0.2226 -0.9199,-0.0000,0.3229,-0.2226 -0.9199,-0.0000,0.3229,-0.2226 -0.9222,-0.0000,0.3256,-0.2089 -0.9222,-0.0000,0.3256,-0.2089 -0.9222,-0.0000,0.3256,-0.2089 -0.9222,-0.0000,0.3256,-0.2089 -0.9242,-0.0000,0.3282,-0.1952 -0.9242,-0.0000,0.3282,-0.1952 -0.9242,-0.0000,0.3282,-0.1952 -0.9242,-0.0000,0.3282,-0.1952 -0.9260,-0.0000,0.3309,-0.1817 -0.9260,-0.0000,0.3309,-0.1817 -0.9260,-0.0000,0.3309,-0.1817 -0.9260,-0.0000,0.3309,-0.1817 -0.9276,-0.0000,0.3337,-0.1681 -0.9276,-0.0000,0.3337,-0.1681 -0.9276,-0.0000,0.3337,-0.1681 -0.9276,-0.0000,0.3337,-0.1681 -0.9289,-0.0000,0.3366,-0.1546 -0.9289,-0.0000,0.3366,-0.1546 -0.9289,-0.0000,0.3366,-0.1546 -0.9289,-0.0000,0.3366,-0.1546 -0.9300,-0.0000,0.3395,-0.1412 -0.9300,-0.0000,0.3395,-0.1412 -0.9300,-0.0000,0.3395,-0.1412 -0.9300,-0.0000,0.3395,-0.1412 -0.9308,-0.0000,0.3424,-0.1279 -0.9308,-0.0000,0.3424,-0.1279 -0.9308,-0.0000,0.3424,-0.1279 -0.9308,-0.0000,0.3424,-0.1279 -0.9314,-0.0000,0.3454,-0.1146 -0.9314,-0.0000,0.3454,-0.1146 -0.9314,-0.0000,0.3454,-0.1146 -0.9314,-0.0000,0.3454,-0.1146 -0.9318,-0.0000,0.3485,-0.1015 -0.9318,-0.0000,0.3485,-0.1015 -0.9318,-0.0000,0.3485,-0.1015 -0.9318,-0.0000,0.3485,-0.1015 -0.9320,-0.0000,0.3516,-0.0884 -0.9320,-0.0000,0.3516,-0.0884 -0.9320,-0.0000,0.3516,-0.0884 -0.9320,-0.0000,0.3516,-0.0884 -0.9319,-0.0000,0.3548,-0.0754 -0.9319,-0.0000,0.3548,-0.0754 -0.9319,-0.0000,0.3548,-0.0754 -0.9319,-0.0000,0.3548,-0.0754 -0.9316,-0.0000,0.3581,-0.0625 -0.9316,-0.0000,0.3581,-0.0625 -0.9316,-0.0000,0.3581,-0.0625 -0.9316,-0.0000,0.3581,-0.0625 -0.9311,-0.0000,0.3614,-0.0498 -0.9311,-0.0000,0.3614,-0.0498 -0.9311,-0.0000,0.3614,-0.0498 -0.9311,-0.0000,0.3614,-0.0498 -0.9303,-0.0000,0.3648,-0.0371 -0.9303,-0.0000,0.3648,-0.0371 -0.9303,-0.0000,0.3648,-0.0371 -0.9303,-0.0000,0.3648,-0.0371 -0.9294,-0.0000,0.3683,-0.0246 -0.9294,-0.0000,0.3683,-0.0246 -0.9294,-0.0000,0.3683,-0.0246 -0.9294,-0.0000,0.3683,-0.0246 -0.9282,-0.0000,0.3718,-0.0122 -0.9282,-0.0000,0.3718,-0.0122 -0.9282,-0.0000,0.3718,-0.0122 -0.9282,-0.0000,0.3718,-0.0122 -0.9269,0.0000,0.3754,0.0000 -0.9269,0.0000,0.3754,0.0000 -0.9269,0.0000,0.3754,0.0000 -0.9269,0.0000,0.3754,0.0000 diff --git a/scripts/trajectories/full-circle-with-up-and-down-4s-fixed-pos-offset-Vector3.csv b/scripts/trajectories/full-circle-with-up-and-down-4s-fixed-pos-offset-Vector3.csv deleted file mode 100644 index c858131d94..0000000000 --- a/scripts/trajectories/full-circle-with-up-and-down-4s-fixed-pos-offset-Vector3.csv +++ /dev/null @@ -1,200 +0,0 @@ -10.0000,10.0000,10.0000,10.7012,9.9780,9.2874 -10.0000,10.0000,10.0000,10.7057,9.9556,9.2929 -10.0000,10.0000,10.0000,10.7095,9.9329,9.2985 -10.0000,10.0000,10.0000,10.7125,9.9100,9.3041 -10.0000,10.0000,10.0000,10.7147,9.8868,9.3097 -10.0000,10.0000,10.0000,10.7161,9.8634,9.3155 -10.0000,10.0000,10.0000,10.7166,9.8398,9.3212 -10.0000,10.0000,10.0000,10.7164,9.8161,9.3270 -10.0000,10.0000,10.0000,10.7153,9.7922,9.3328 -10.0000,10.0000,10.0000,10.7134,9.7682,9.3387 -10.0000,10.0000,10.0000,10.7106,9.7442,9.3446 -10.0000,10.0000,10.0000,10.7070,9.7201,9.3506 -10.0000,10.0000,10.0000,10.7025,9.6960,9.3565 -10.0000,10.0000,10.0000,10.6972,9.6719,9.3626 -10.0000,10.0000,10.0000,10.6910,9.6479,9.3686 -10.0000,10.0000,10.0000,10.6839,9.6240,9.3748 -10.0000,10.0000,10.0000,10.6760,9.6002,9.3809 -10.0000,10.0000,10.0000,10.6671,9.5766,9.3871 -10.0000,10.0000,10.0000,10.6575,9.5532,9.3933 -10.0000,10.0000,10.0000,10.6470,9.5300,9.3996 -10.0000,10.0000,10.0000,10.6356,9.5070,9.4059 -10.0000,10.0000,10.0000,10.6234,9.4843,9.4122 -10.0000,10.0000,10.0000,10.6103,9.4620,9.4186 -10.0000,10.0000,10.0000,10.5964,9.4399,9.4250 -10.0000,10.0000,10.0000,10.5817,9.4183,9.4314 -10.0000,10.0000,10.0000,10.5662,9.3971,9.4379 -10.0000,10.0000,10.0000,10.5499,9.3763,9.4444 -10.0000,10.0000,10.0000,10.5328,9.3560,9.4510 -10.0000,10.0000,10.0000,10.5149,9.3362,9.4576 -10.0000,10.0000,10.0000,10.4963,9.3169,9.4642 -10.0000,10.0000,10.0000,10.4769,9.2982,9.4708 -10.0000,10.0000,10.0000,10.4569,9.2801,9.4775 -10.0000,10.0000,10.0000,10.4361,9.2626,9.4842 -10.0000,10.0000,10.0000,10.4147,9.2457,9.4910 -10.0000,10.0000,10.0000,10.3926,9.2295,9.4977 -10.0000,10.0000,10.0000,10.3698,9.2140,9.5045 -10.0000,10.0000,10.0000,10.3465,9.1993,9.5114 -10.0000,10.0000,10.0000,10.3226,9.1852,9.5182 -10.0000,10.0000,10.0000,10.2981,9.1720,9.5251 -10.0000,10.0000,10.0000,10.2731,9.1595,9.5321 -10.0000,10.0000,10.0000,10.2476,9.1478,9.5390 -10.0000,10.0000,10.0000,10.2216,9.1370,9.5460 -10.0000,10.0000,10.0000,10.1951,9.1270,9.5530 -10.0000,10.0000,10.0000,10.1683,9.1179,9.5601 -10.0000,10.0000,10.0000,10.1410,9.1096,9.5671 -10.0000,10.0000,10.0000,10.1134,9.1023,9.5742 -10.0000,10.0000,10.0000,10.0855,9.0959,9.5813 -10.0000,10.0000,10.0000,10.0572,9.0904,9.5885 -10.0000,10.0000,10.0000,10.0287,9.0858,9.5957 -10.0000,10.0000,10.0000,10.0000,9.0822,9.6029 -10.0000,10.0000,10.0000,9.9711,9.0796,9.6101 -10.0000,10.0000,10.0000,9.9420,9.0779,9.6173 -10.0000,10.0000,10.0000,9.9128,9.0773,9.6246 -10.0000,10.0000,10.0000,9.8835,9.0776,9.6319 -10.0000,10.0000,10.0000,9.8541,9.0788,9.6392 -10.0000,10.0000,10.0000,9.8247,9.0811,9.6465 -10.0000,10.0000,10.0000,9.7953,9.0844,9.6539 -10.0000,10.0000,10.0000,9.7660,9.0887,9.6613 -10.0000,10.0000,10.0000,9.7368,9.0940,9.6687 -10.0000,10.0000,10.0000,9.7076,9.1002,9.6761 -10.0000,10.0000,10.0000,9.6787,9.1075,9.6835 -10.0000,10.0000,10.0000,9.6499,9.1157,9.6910 -10.0000,10.0000,10.0000,9.6213,9.1250,9.6985 -10.0000,10.0000,10.0000,9.5930,9.1352,9.7060 -10.0000,10.0000,10.0000,9.5650,9.1464,9.7135 -10.0000,10.0000,10.0000,9.5374,9.1585,9.7210 -10.0000,10.0000,10.0000,9.5101,9.1716,9.7286 -10.0000,10.0000,10.0000,9.4832,9.1856,9.7361 -10.0000,10.0000,10.0000,9.4567,9.2005,9.7437 -10.0000,10.0000,10.0000,9.4307,9.2164,9.7513 -10.0000,10.0000,10.0000,9.4052,9.2331,9.7589 -10.0000,10.0000,10.0000,9.3802,9.2508,9.7666 -10.0000,10.0000,10.0000,9.3558,9.2693,9.7742 -10.0000,10.0000,10.0000,9.3319,9.2886,9.7819 -10.0000,10.0000,10.0000,9.3087,9.3087,9.7895 -10.0000,10.0000,10.0000,9.2862,9.3297,9.7972 -10.0000,10.0000,10.0000,9.2643,9.3514,9.8049 -10.0000,10.0000,10.0000,9.2431,9.3739,9.8126 -10.0000,10.0000,10.0000,9.2227,9.3971,9.8203 -10.0000,10.0000,10.0000,9.2030,9.4210,9.8281 -10.0000,10.0000,10.0000,9.1841,9.4455,9.8358 -10.0000,10.0000,10.0000,9.1661,9.4708,9.8436 -10.0000,10.0000,10.0000,9.1488,9.4966,9.8513 -10.0000,10.0000,10.0000,9.1324,9.5231,9.8591 -10.0000,10.0000,10.0000,9.1169,9.5501,9.8669 -10.0000,10.0000,10.0000,9.1023,9.5776,9.8747 -10.0000,10.0000,10.0000,9.0886,9.6056,9.8825 -10.0000,10.0000,10.0000,9.0758,9.6341,9.8903 -10.0000,10.0000,10.0000,9.0640,9.6630,9.8981 -10.0000,10.0000,10.0000,9.0532,9.6924,9.9059 -10.0000,10.0000,10.0000,9.0433,9.7221,9.9137 -10.0000,10.0000,10.0000,9.0344,9.7521,9.9215 -10.0000,10.0000,10.0000,9.0265,9.7824,9.9294 -10.0000,10.0000,10.0000,9.0197,9.8130,9.9372 -10.0000,10.0000,10.0000,9.0138,9.8438,9.9451 -10.0000,10.0000,10.0000,9.0090,9.8748,9.9529 -10.0000,10.0000,10.0000,9.0052,9.9060,9.9607 -10.0000,10.0000,10.0000,9.0025,9.9372,9.9686 -10.0000,10.0000,10.0000,9.0008,9.9686,9.9764 -10.0000,10.0000,10.0000,9.0001,10.0000,9.9843 -10.0000,10.0000,10.0000,9.0005,10.0314,9.9921 -10.0000,10.0000,10.0000,9.0020,10.0628,10.0000 -10.0000,10.0000,10.0000,9.0045,10.0941,10.0079 -10.0000,10.0000,10.0000,9.0080,10.1253,10.0157 -10.0000,10.0000,10.0000,9.0126,10.1564,10.0236 -10.0000,10.0000,10.0000,9.0182,10.1873,10.0314 -10.0000,10.0000,10.0000,9.0248,10.2180,10.0393 -10.0000,10.0000,10.0000,9.0325,10.2484,10.0471 -10.0000,10.0000,10.0000,9.0412,10.2786,10.0550 -10.0000,10.0000,10.0000,9.0508,10.3084,10.0628 -10.0000,10.0000,10.0000,9.0615,10.3379,10.0706 -10.0000,10.0000,10.0000,9.0731,10.3670,10.0785 -10.0000,10.0000,10.0000,9.0857,10.3957,10.0863 -10.0000,10.0000,10.0000,9.0992,10.4239,10.0941 -10.0000,10.0000,10.0000,9.1136,10.4516,10.1019 -10.0000,10.0000,10.0000,9.1290,10.4788,10.1097 -10.0000,10.0000,10.0000,9.1452,10.5055,10.1175 -10.0000,10.0000,10.0000,9.1623,10.5316,10.1253 -10.0000,10.0000,10.0000,9.1803,10.5571,10.1331 -10.0000,10.0000,10.0000,9.1991,10.5819,10.1409 -10.0000,10.0000,10.0000,9.2186,10.6061,10.1487 -10.0000,10.0000,10.0000,9.2390,10.6296,10.1564 -10.0000,10.0000,10.0000,9.2601,10.6523,10.1642 -10.0000,10.0000,10.0000,9.2819,10.6744,10.1719 -10.0000,10.0000,10.0000,9.3044,10.6956,10.1797 -10.0000,10.0000,10.0000,9.3276,10.7161,10.1874 -10.0000,10.0000,10.0000,9.3514,10.7357,10.1951 -10.0000,10.0000,10.0000,9.3758,10.7545,10.2028 -10.0000,10.0000,10.0000,9.4008,10.7725,10.2105 -10.0000,10.0000,10.0000,9.4264,10.7895,10.2181 -10.0000,10.0000,10.0000,9.4524,10.8057,10.2258 -10.0000,10.0000,10.0000,9.4790,10.8210,10.2334 -10.0000,10.0000,10.0000,9.5060,10.8354,10.2411 -10.0000,10.0000,10.0000,9.5334,10.8488,10.2487 -10.0000,10.0000,10.0000,9.5612,10.8612,10.2563 -10.0000,10.0000,10.0000,9.5893,10.8728,10.2639 -10.0000,10.0000,10.0000,9.6178,10.8833,10.2714 -10.0000,10.0000,10.0000,9.6465,10.8929,10.2790 -10.0000,10.0000,10.0000,9.6755,10.9014,10.2865 -10.0000,10.0000,10.0000,9.7046,10.9090,10.2940 -10.0000,10.0000,10.0000,9.7340,10.9156,10.3015 -10.0000,10.0000,10.0000,9.7635,10.9212,10.3090 -10.0000,10.0000,10.0000,9.7931,10.9258,10.3165 -10.0000,10.0000,10.0000,9.8227,10.9293,10.3239 -10.0000,10.0000,10.0000,9.8524,10.9319,10.3313 -10.0000,10.0000,10.0000,9.8821,10.9335,10.3387 -10.0000,10.0000,10.0000,9.9117,10.9340,10.3461 -10.0000,10.0000,10.0000,9.9413,10.9336,10.3535 -10.0000,10.0000,10.0000,9.9707,10.9322,10.3608 -10.0000,10.0000,10.0000,10.0000,10.9298,10.3681 -10.0000,10.0000,10.0000,10.0291,10.9264,10.3754 -10.0000,10.0000,10.0000,10.0580,10.9221,10.3827 -10.0000,10.0000,10.0000,10.0867,10.9168,10.3899 -10.0000,10.0000,10.0000,10.1150,10.9105,10.3971 -10.0000,10.0000,10.0000,10.1431,10.9033,10.4043 -10.0000,10.0000,10.0000,10.1708,10.8953,10.4115 -10.0000,10.0000,10.0000,10.1981,10.8863,10.4187 -10.0000,10.0000,10.0000,10.2250,10.8764,10.4258 -10.0000,10.0000,10.0000,10.2515,10.8657,10.4329 -10.0000,10.0000,10.0000,10.2775,10.8541,10.4399 -10.0000,10.0000,10.0000,10.3030,10.8417,10.4470 -10.0000,10.0000,10.0000,10.3280,10.8284,10.4540 -10.0000,10.0000,10.0000,10.3524,10.8144,10.4610 -10.0000,10.0000,10.0000,10.3763,10.7997,10.4679 -10.0000,10.0000,10.0000,10.3995,10.7841,10.4749 -10.0000,10.0000,10.0000,10.4222,10.7679,10.4818 -10.0000,10.0000,10.0000,10.4441,10.7510,10.4886 -10.0000,10.0000,10.0000,10.4654,10.7334,10.4955 -10.0000,10.0000,10.0000,10.4860,10.7152,10.5023 -10.0000,10.0000,10.0000,10.5059,10.6964,10.5090 -10.0000,10.0000,10.0000,10.5251,10.6769,10.5158 -10.0000,10.0000,10.0000,10.5435,10.6570,10.5225 -10.0000,10.0000,10.0000,10.5611,10.6365,10.5292 -10.0000,10.0000,10.0000,10.5780,10.6155,10.5358 -10.0000,10.0000,10.0000,10.5940,10.5940,10.5424 -10.0000,10.0000,10.0000,10.6093,10.5721,10.5490 -10.0000,10.0000,10.0000,10.6237,10.5499,10.5556 -10.0000,10.0000,10.0000,10.6373,10.5272,10.5621 -10.0000,10.0000,10.0000,10.6500,10.5042,10.5686 -10.0000,10.0000,10.0000,10.6619,10.4809,10.5750 -10.0000,10.0000,10.0000,10.6729,10.4573,10.5814 -10.0000,10.0000,10.0000,10.6831,10.4335,10.5878 -10.0000,10.0000,10.0000,10.6924,10.4095,10.5941 -10.0000,10.0000,10.0000,10.7008,10.3852,10.6004 -10.0000,10.0000,10.0000,10.7083,10.3609,10.6067 -10.0000,10.0000,10.0000,10.7150,10.3364,10.6129 -10.0000,10.0000,10.0000,10.7207,10.3119,10.6191 -10.0000,10.0000,10.0000,10.7256,10.2873,10.6252 -10.0000,10.0000,10.0000,10.7296,10.2627,10.6314 -10.0000,10.0000,10.0000,10.7328,10.2381,10.6374 -10.0000,10.0000,10.0000,10.7351,10.2136,10.6435 -10.0000,10.0000,10.0000,10.7365,10.1891,10.6494 -10.0000,10.0000,10.0000,10.7371,10.1648,10.6554 -10.0000,10.0000,10.0000,10.7368,10.1406,10.6613 -10.0000,10.0000,10.0000,10.7357,10.1165,10.6672 -10.0000,10.0000,10.0000,10.7338,10.0927,10.6730 -10.0000,10.0000,10.0000,10.7311,10.0691,10.6788 -10.0000,10.0000,10.0000,10.7275,10.0458,10.6845 -10.0000,10.0000,10.0000,10.7232,10.0227,10.6903 -10.0000,10.0000,10.0000,10.7181,10.0000,10.6959 diff --git a/scripts/trajectories/full-circle-with-up-and-down-4s.csv b/scripts/trajectories/full-circle-with-up-and-down-4s.csv deleted file mode 100644 index 31692f4673..0000000000 --- a/scripts/trajectories/full-circle-with-up-and-down-4s.csv +++ /dev/null @@ -1,800 +0,0 @@ -0.9223,-0.0000,0.3863,-0.0119 -0.9223,-0.0000,0.3863,-0.0119 -0.9223,-0.0000,0.3863,-0.0119 -0.9223,-0.0000,0.3863,-0.0119 -0.9235,-0.0000,0.3828,-0.0240 -0.9235,-0.0000,0.3828,-0.0240 -0.9235,-0.0000,0.3828,-0.0240 -0.9235,-0.0000,0.3828,-0.0240 -0.9245,-0.0000,0.3794,-0.0363 -0.9245,-0.0000,0.3794,-0.0363 -0.9245,-0.0000,0.3794,-0.0363 -0.9245,-0.0000,0.3794,-0.0363 -0.9253,-0.0000,0.3760,-0.0486 -0.9253,-0.0000,0.3760,-0.0486 -0.9253,-0.0000,0.3760,-0.0486 -0.9253,-0.0000,0.3760,-0.0486 -0.9259,-0.0000,0.3727,-0.0611 -0.9259,-0.0000,0.3727,-0.0611 -0.9259,-0.0000,0.3727,-0.0611 -0.9259,-0.0000,0.3727,-0.0611 -0.9263,-0.0000,0.3695,-0.0737 -0.9263,-0.0000,0.3695,-0.0737 -0.9263,-0.0000,0.3695,-0.0737 -0.9263,-0.0000,0.3695,-0.0737 -0.9265,-0.0000,0.3663,-0.0865 -0.9265,-0.0000,0.3663,-0.0865 -0.9265,-0.0000,0.3663,-0.0865 -0.9265,-0.0000,0.3663,-0.0865 -0.9264,-0.0000,0.3632,-0.0993 -0.9264,-0.0000,0.3632,-0.0993 -0.9264,-0.0000,0.3632,-0.0993 -0.9264,-0.0000,0.3632,-0.0993 -0.9261,-0.0000,0.3602,-0.1122 -0.9261,-0.0000,0.3602,-0.1122 -0.9261,-0.0000,0.3602,-0.1122 -0.9261,-0.0000,0.3602,-0.1122 -0.9256,-0.0000,0.3572,-0.1252 -0.9256,-0.0000,0.3572,-0.1252 -0.9256,-0.0000,0.3572,-0.1252 -0.9256,-0.0000,0.3572,-0.1252 -0.9248,-0.0000,0.3543,-0.1383 -0.9248,-0.0000,0.3543,-0.1383 -0.9248,-0.0000,0.3543,-0.1383 -0.9248,-0.0000,0.3543,-0.1383 -0.9239,-0.0000,0.3515,-0.1515 -0.9239,-0.0000,0.3515,-0.1515 -0.9239,-0.0000,0.3515,-0.1515 -0.9239,-0.0000,0.3515,-0.1515 -0.9226,-0.0000,0.3487,-0.1648 -0.9226,-0.0000,0.3487,-0.1648 -0.9226,-0.0000,0.3487,-0.1648 -0.9226,-0.0000,0.3487,-0.1648 -0.9212,-0.0000,0.3460,-0.1781 -0.9212,-0.0000,0.3460,-0.1781 -0.9212,-0.0000,0.3460,-0.1781 -0.9212,-0.0000,0.3460,-0.1781 -0.9195,-0.0000,0.3433,-0.1914 -0.9195,-0.0000,0.3433,-0.1914 -0.9195,-0.0000,0.3433,-0.1914 -0.9195,-0.0000,0.3433,-0.1914 -0.9176,-0.0000,0.3407,-0.2049 -0.9176,-0.0000,0.3407,-0.2049 -0.9176,-0.0000,0.3407,-0.2049 -0.9176,-0.0000,0.3407,-0.2049 -0.9154,-0.0000,0.3382,-0.2183 -0.9154,-0.0000,0.3382,-0.2183 -0.9154,-0.0000,0.3382,-0.2183 -0.9154,-0.0000,0.3382,-0.2183 -0.9130,-0.0000,0.3357,-0.2319 -0.9130,-0.0000,0.3357,-0.2319 -0.9130,-0.0000,0.3357,-0.2319 -0.9130,-0.0000,0.3357,-0.2319 -0.9104,-0.0000,0.3332,-0.2454 -0.9104,-0.0000,0.3332,-0.2454 -0.9104,-0.0000,0.3332,-0.2454 -0.9104,-0.0000,0.3332,-0.2454 -0.9075,-0.0000,0.3308,-0.2590 -0.9075,-0.0000,0.3308,-0.2590 -0.9075,-0.0000,0.3308,-0.2590 -0.9075,-0.0000,0.3308,-0.2590 -0.9043,-0.0000,0.3285,-0.2726 -0.9043,-0.0000,0.3285,-0.2726 -0.9043,-0.0000,0.3285,-0.2726 -0.9043,-0.0000,0.3285,-0.2726 -0.9009,-0.0000,0.3262,-0.2862 -0.9009,-0.0000,0.3262,-0.2862 -0.9009,-0.0000,0.3262,-0.2862 -0.9009,-0.0000,0.3262,-0.2862 -0.8973,-0.0000,0.3240,-0.2998 -0.8973,-0.0000,0.3240,-0.2998 -0.8973,-0.0000,0.3240,-0.2998 -0.8973,-0.0000,0.3240,-0.2998 -0.8934,-0.0000,0.3218,-0.3134 -0.8934,-0.0000,0.3218,-0.3134 -0.8934,-0.0000,0.3218,-0.3134 -0.8934,-0.0000,0.3218,-0.3134 -0.8893,-0.0000,0.3197,-0.3271 -0.8893,-0.0000,0.3197,-0.3271 -0.8893,-0.0000,0.3197,-0.3271 -0.8893,-0.0000,0.3197,-0.3271 -0.8849,-0.0000,0.3176,-0.3407 -0.8849,-0.0000,0.3176,-0.3407 -0.8849,-0.0000,0.3176,-0.3407 -0.8849,-0.0000,0.3176,-0.3407 -0.8803,-0.0000,0.3156,-0.3543 -0.8803,-0.0000,0.3156,-0.3543 -0.8803,-0.0000,0.3156,-0.3543 -0.8803,-0.0000,0.3156,-0.3543 -0.8754,-0.0000,0.3136,-0.3678 -0.8754,-0.0000,0.3136,-0.3678 -0.8754,-0.0000,0.3136,-0.3678 -0.8754,-0.0000,0.3136,-0.3678 -0.8703,-0.0000,0.3116,-0.3814 -0.8703,-0.0000,0.3116,-0.3814 -0.8703,-0.0000,0.3116,-0.3814 -0.8703,-0.0000,0.3116,-0.3814 -0.8650,-0.0000,0.3097,-0.3949 -0.8650,-0.0000,0.3097,-0.3949 -0.8650,-0.0000,0.3097,-0.3949 -0.8650,-0.0000,0.3097,-0.3949 -0.8593,-0.0000,0.3079,-0.4083 -0.8593,-0.0000,0.3079,-0.4083 -0.8593,-0.0000,0.3079,-0.4083 -0.8593,-0.0000,0.3079,-0.4083 -0.8535,-0.0000,0.3061,-0.4217 -0.8535,-0.0000,0.3061,-0.4217 -0.8535,-0.0000,0.3061,-0.4217 -0.8535,-0.0000,0.3061,-0.4217 -0.8474,-0.0000,0.3043,-0.4351 -0.8474,-0.0000,0.3043,-0.4351 -0.8474,-0.0000,0.3043,-0.4351 -0.8474,-0.0000,0.3043,-0.4351 -0.8410,-0.0000,0.3026,-0.4484 -0.8410,-0.0000,0.3026,-0.4484 -0.8410,-0.0000,0.3026,-0.4484 -0.8410,-0.0000,0.3026,-0.4484 -0.8344,-0.0000,0.3010,-0.4617 -0.8344,-0.0000,0.3010,-0.4617 -0.8344,-0.0000,0.3010,-0.4617 -0.8344,-0.0000,0.3010,-0.4617 -0.8276,-0.0000,0.2993,-0.4748 -0.8276,-0.0000,0.2993,-0.4748 -0.8276,-0.0000,0.2993,-0.4748 -0.8276,-0.0000,0.2993,-0.4748 -0.8205,-0.0000,0.2978,-0.4879 -0.8205,-0.0000,0.2978,-0.4879 -0.8205,-0.0000,0.2978,-0.4879 -0.8205,-0.0000,0.2978,-0.4879 -0.8132,-0.0000,0.2962,-0.5010 -0.8132,-0.0000,0.2962,-0.5010 -0.8132,-0.0000,0.2962,-0.5010 -0.8132,-0.0000,0.2962,-0.5010 -0.8056,-0.0000,0.2947,-0.5139 -0.8056,-0.0000,0.2947,-0.5139 -0.8056,-0.0000,0.2947,-0.5139 -0.8056,-0.0000,0.2947,-0.5139 -0.7978,-0.0000,0.2932,-0.5267 -0.7978,-0.0000,0.2932,-0.5267 -0.7978,-0.0000,0.2932,-0.5267 -0.7978,-0.0000,0.2932,-0.5267 -0.7898,-0.0000,0.2918,-0.5395 -0.7898,-0.0000,0.2918,-0.5395 -0.7898,-0.0000,0.2918,-0.5395 -0.7898,-0.0000,0.2918,-0.5395 -0.7815,-0.0000,0.2904,-0.5521 -0.7815,-0.0000,0.2904,-0.5521 -0.7815,-0.0000,0.2904,-0.5521 -0.7815,-0.0000,0.2904,-0.5521 -0.7730,-0.0000,0.2891,-0.5647 -0.7730,-0.0000,0.2891,-0.5647 -0.7730,-0.0000,0.2891,-0.5647 -0.7730,-0.0000,0.2891,-0.5647 -0.7643,-0.0000,0.2878,-0.5771 -0.7643,-0.0000,0.2878,-0.5771 -0.7643,-0.0000,0.2878,-0.5771 -0.7643,-0.0000,0.2878,-0.5771 -0.7553,-0.0000,0.2865,-0.5894 -0.7553,-0.0000,0.2865,-0.5894 -0.7553,-0.0000,0.2865,-0.5894 -0.7553,-0.0000,0.2865,-0.5894 -0.7461,-0.0000,0.2853,-0.6016 -0.7461,-0.0000,0.2853,-0.6016 -0.7461,-0.0000,0.2853,-0.6016 -0.7461,-0.0000,0.2853,-0.6016 -0.7367,-0.0000,0.2841,-0.6136 -0.7367,-0.0000,0.2841,-0.6136 -0.7367,-0.0000,0.2841,-0.6136 -0.7367,-0.0000,0.2841,-0.6136 -0.7271,-0.0000,0.2830,-0.6255 -0.7271,-0.0000,0.2830,-0.6255 -0.7271,-0.0000,0.2830,-0.6255 -0.7271,-0.0000,0.2830,-0.6255 -0.7172,-0.0000,0.2819,-0.6373 -0.7172,-0.0000,0.2819,-0.6373 -0.7172,-0.0000,0.2819,-0.6373 -0.7172,-0.0000,0.2819,-0.6373 -0.7071,-0.0000,0.2808,-0.6490 -0.7071,-0.0000,0.2808,-0.6490 -0.7071,-0.0000,0.2808,-0.6490 -0.7071,-0.0000,0.2808,-0.6490 -0.6968,-0.0000,0.2798,-0.6604 -0.6968,-0.0000,0.2798,-0.6604 -0.6968,-0.0000,0.2798,-0.6604 -0.6968,-0.0000,0.2798,-0.6604 -0.6863,-0.0000,0.2788,-0.6718 -0.6863,-0.0000,0.2788,-0.6718 -0.6863,-0.0000,0.2788,-0.6718 -0.6863,-0.0000,0.2788,-0.6718 -0.6756,-0.0000,0.2779,-0.6829 -0.6756,-0.0000,0.2779,-0.6829 -0.6756,-0.0000,0.2779,-0.6829 -0.6756,-0.0000,0.2779,-0.6829 -0.6646,-0.0000,0.2769,-0.6940 -0.6646,-0.0000,0.2769,-0.6940 -0.6646,-0.0000,0.2769,-0.6940 -0.6646,-0.0000,0.2769,-0.6940 -0.6535,-0.0000,0.2761,-0.7048 -0.6535,-0.0000,0.2761,-0.7048 -0.6535,-0.0000,0.2761,-0.7048 -0.6535,-0.0000,0.2761,-0.7048 -0.6422,-0.0000,0.2752,-0.7155 -0.6422,-0.0000,0.2752,-0.7155 -0.6422,-0.0000,0.2752,-0.7155 -0.6422,-0.0000,0.2752,-0.7155 -0.6306,-0.0000,0.2744,-0.7260 -0.6306,-0.0000,0.2744,-0.7260 -0.6306,-0.0000,0.2744,-0.7260 -0.6306,-0.0000,0.2744,-0.7260 -0.6189,-0.0000,0.2737,-0.7363 -0.6189,-0.0000,0.2737,-0.7363 -0.6189,-0.0000,0.2737,-0.7363 -0.6189,-0.0000,0.2737,-0.7363 -0.6069,-0.0000,0.2730,-0.7464 -0.6069,-0.0000,0.2730,-0.7464 -0.6069,-0.0000,0.2730,-0.7464 -0.6069,-0.0000,0.2730,-0.7464 -0.5948,-0.0000,0.2723,-0.7563 -0.5948,-0.0000,0.2723,-0.7563 -0.5948,-0.0000,0.2723,-0.7563 -0.5948,-0.0000,0.2723,-0.7563 -0.5825,-0.0000,0.2716,-0.7661 -0.5825,-0.0000,0.2716,-0.7661 -0.5825,-0.0000,0.2716,-0.7661 -0.5825,-0.0000,0.2716,-0.7661 -0.5700,-0.0000,0.2710,-0.7756 -0.5700,-0.0000,0.2710,-0.7756 -0.5700,-0.0000,0.2710,-0.7756 -0.5700,-0.0000,0.2710,-0.7756 -0.5574,-0.0000,0.2705,-0.7850 -0.5574,-0.0000,0.2705,-0.7850 -0.5574,-0.0000,0.2705,-0.7850 -0.5574,-0.0000,0.2705,-0.7850 -0.5445,-0.0000,0.2700,-0.7941 -0.5445,-0.0000,0.2700,-0.7941 -0.5445,-0.0000,0.2700,-0.7941 -0.5445,-0.0000,0.2700,-0.7941 -0.5315,-0.0000,0.2695,-0.8030 -0.5315,-0.0000,0.2695,-0.8030 -0.5315,-0.0000,0.2695,-0.8030 -0.5315,-0.0000,0.2695,-0.8030 -0.5184,-0.0000,0.2691,-0.8117 -0.5184,-0.0000,0.2691,-0.8117 -0.5184,-0.0000,0.2691,-0.8117 -0.5184,-0.0000,0.2691,-0.8117 -0.5050,-0.0000,0.2687,-0.8202 -0.5050,-0.0000,0.2687,-0.8202 -0.5050,-0.0000,0.2687,-0.8202 -0.5050,-0.0000,0.2687,-0.8202 -0.4915,-0.0000,0.2684,-0.8285 -0.4915,-0.0000,0.2684,-0.8285 -0.4915,-0.0000,0.2684,-0.8285 -0.4915,-0.0000,0.2684,-0.8285 -0.4779,-0.0000,0.2682,-0.8365 -0.4779,-0.0000,0.2682,-0.8365 -0.4779,-0.0000,0.2682,-0.8365 -0.4779,-0.0000,0.2682,-0.8365 -0.4640,-0.0000,0.2680,-0.8443 -0.4640,-0.0000,0.2680,-0.8443 -0.4640,-0.0000,0.2680,-0.8443 -0.4640,-0.0000,0.2680,-0.8443 -0.4501,-0.0000,0.2678,-0.8519 -0.4501,-0.0000,0.2678,-0.8519 -0.4501,-0.0000,0.2678,-0.8519 -0.4501,-0.0000,0.2678,-0.8519 -0.4360,-0.0000,0.2677,-0.8592 -0.4360,-0.0000,0.2677,-0.8592 -0.4360,-0.0000,0.2677,-0.8592 -0.4360,-0.0000,0.2677,-0.8592 -0.4218,-0.0000,0.2677,-0.8663 -0.4218,-0.0000,0.2677,-0.8663 -0.4218,-0.0000,0.2677,-0.8663 -0.4218,-0.0000,0.2677,-0.8663 -0.4074,-0.0000,0.2677,-0.8731 -0.4074,-0.0000,0.2677,-0.8731 -0.4074,-0.0000,0.2677,-0.8731 -0.4074,-0.0000,0.2677,-0.8731 -0.3929,-0.0000,0.2678,-0.8797 -0.3929,-0.0000,0.2678,-0.8797 -0.3929,-0.0000,0.2678,-0.8797 -0.3929,-0.0000,0.2678,-0.8797 -0.3783,-0.0000,0.2680,-0.8860 -0.3783,-0.0000,0.2680,-0.8860 -0.3783,-0.0000,0.2680,-0.8860 -0.3783,-0.0000,0.2680,-0.8860 -0.3635,-0.0000,0.2683,-0.8921 -0.3635,-0.0000,0.2683,-0.8921 -0.3635,-0.0000,0.2683,-0.8921 -0.3635,-0.0000,0.2683,-0.8921 -0.3487,-0.0000,0.2687,-0.8979 -0.3487,-0.0000,0.2687,-0.8979 -0.3487,-0.0000,0.2687,-0.8979 -0.3487,-0.0000,0.2687,-0.8979 -0.3337,-0.0000,0.2692,-0.9034 -0.3337,-0.0000,0.2692,-0.9034 -0.3337,-0.0000,0.2692,-0.9034 -0.3337,-0.0000,0.2692,-0.9034 -0.3186,-0.0000,0.2698,-0.9087 -0.3186,-0.0000,0.2698,-0.9087 -0.3186,-0.0000,0.2698,-0.9087 -0.3186,-0.0000,0.2698,-0.9087 -0.3034,-0.0000,0.2705,-0.9136 -0.3034,-0.0000,0.2705,-0.9136 -0.3034,-0.0000,0.2705,-0.9136 -0.3034,-0.0000,0.2705,-0.9136 -0.2882,-0.0000,0.2714,-0.9183 -0.2882,-0.0000,0.2714,-0.9183 -0.2882,-0.0000,0.2714,-0.9183 -0.2882,-0.0000,0.2714,-0.9183 -0.2728,-0.0000,0.2725,-0.9227 -0.2728,-0.0000,0.2725,-0.9227 -0.2728,-0.0000,0.2725,-0.9227 -0.2728,-0.0000,0.2725,-0.9227 -0.2573,-0.0000,0.2738,-0.9267 -0.2573,-0.0000,0.2738,-0.9267 -0.2573,-0.0000,0.2738,-0.9267 -0.2573,-0.0000,0.2738,-0.9267 -0.2418,-0.0000,0.2753,-0.9305 -0.2418,-0.0000,0.2753,-0.9305 -0.2418,-0.0000,0.2753,-0.9305 -0.2418,-0.0000,0.2753,-0.9305 -0.2262,-0.0000,0.2771,-0.9339 -0.2262,-0.0000,0.2771,-0.9339 -0.2262,-0.0000,0.2771,-0.9339 -0.2262,-0.0000,0.2771,-0.9339 -0.2105,-0.0000,0.2792,-0.9369 -0.2105,-0.0000,0.2792,-0.9369 -0.2105,-0.0000,0.2792,-0.9369 -0.2105,-0.0000,0.2792,-0.9369 -0.1947,-0.0000,0.2818,-0.9395 -0.1947,-0.0000,0.2818,-0.9395 -0.1947,-0.0000,0.2818,-0.9395 -0.1947,-0.0000,0.2818,-0.9395 -0.1789,-0.0000,0.2848,-0.9417 -0.1789,-0.0000,0.2848,-0.9417 -0.1789,-0.0000,0.2848,-0.9417 -0.1789,-0.0000,0.2848,-0.9417 -0.1630,-0.0000,0.2886,-0.9435 -0.1630,-0.0000,0.2886,-0.9435 -0.1630,-0.0000,0.2886,-0.9435 -0.1630,-0.0000,0.2886,-0.9435 -0.1471,-0.0000,0.2933,-0.9446 -0.1471,-0.0000,0.2933,-0.9446 -0.1471,-0.0000,0.2933,-0.9446 -0.1471,-0.0000,0.2933,-0.9446 -0.1312,-0.0000,0.2991,-0.9452 -0.1312,-0.0000,0.2991,-0.9452 -0.1312,-0.0000,0.2991,-0.9452 -0.1312,-0.0000,0.2991,-0.9452 -0.1152,-0.0000,0.3067,-0.9448 -0.1152,-0.0000,0.3067,-0.9448 -0.1152,-0.0000,0.3067,-0.9448 -0.1152,-0.0000,0.3067,-0.9448 -0.0991,-0.0000,0.3167,-0.9433 -0.0991,-0.0000,0.3167,-0.9433 -0.0991,-0.0000,0.3167,-0.9433 -0.0991,-0.0000,0.3167,-0.9433 -0.0831,-0.0000,0.3307,-0.9401 -0.0831,-0.0000,0.3307,-0.9401 -0.0831,-0.0000,0.3307,-0.9401 -0.0831,-0.0000,0.3307,-0.9401 -0.0670,-0.0000,0.3514,-0.9338 -0.0670,-0.0000,0.3514,-0.9338 -0.0670,-0.0000,0.3514,-0.9338 -0.0670,-0.0000,0.3514,-0.9338 -0.0510,-0.0000,0.3848,-0.9216 -0.0510,-0.0000,0.3848,-0.9216 -0.0510,-0.0000,0.3848,-0.9216 -0.0510,-0.0000,0.3848,-0.9216 -0.0351,-0.0000,0.4473,-0.8937 -0.0351,-0.0000,0.4473,-0.8937 -0.0351,-0.0000,0.4473,-0.8937 -0.0351,-0.0000,0.4473,-0.8937 -0.0196,-0.0000,0.6000,-0.7997 -0.0196,-0.0000,0.6000,-0.7997 -0.0196,-0.0000,0.6000,-0.7997 -0.0196,-0.0000,0.6000,-0.7997 -0.0079,0.0000,1.0000,0.0001 -0.0079,0.0000,1.0000,0.0001 -0.0079,0.0000,1.0000,0.0001 -0.0079,0.0000,1.0000,0.0001 -0.0162,0.0000,0.2425,0.9700 -0.0162,0.0000,0.2425,0.9700 -0.0162,0.0000,0.2425,0.9700 -0.0162,0.0000,0.2425,0.9700 -0.0314,-0.0000,-0.0000,0.9995 -0.0314,-0.0000,-0.0000,0.9995 -0.0314,-0.0000,-0.0000,0.9995 -0.0314,-0.0000,-0.0000,0.9995 -0.0473,-0.0000,-0.0831,0.9954 -0.0473,-0.0000,-0.0831,0.9954 -0.0473,-0.0000,-0.0831,0.9954 -0.0473,-0.0000,-0.0831,0.9954 -0.0633,-0.0000,-0.1241,0.9902 -0.0633,-0.0000,-0.1241,0.9902 -0.0633,-0.0000,-0.1241,0.9902 -0.0633,-0.0000,-0.1241,0.9902 -0.0793,-0.0000,-0.1485,0.9857 -0.0793,-0.0000,-0.1485,0.9857 -0.0793,-0.0000,-0.1485,0.9857 -0.0793,-0.0000,-0.1485,0.9857 -0.0954,-0.0000,-0.1646,0.9817 -0.0954,-0.0000,-0.1646,0.9817 -0.0954,-0.0000,-0.1646,0.9817 -0.0954,-0.0000,-0.1646,0.9817 -0.1114,-0.0000,-0.1762,0.9780 -0.1114,-0.0000,-0.1762,0.9780 -0.1114,-0.0000,-0.1762,0.9780 -0.1114,-0.0000,-0.1762,0.9780 -0.1275,-0.0000,-0.1848,0.9745 -0.1275,-0.0000,-0.1848,0.9745 -0.1275,-0.0000,-0.1848,0.9745 -0.1275,-0.0000,-0.1848,0.9745 -0.1435,-0.0000,-0.1915,0.9709 -0.1435,-0.0000,-0.1915,0.9709 -0.1435,-0.0000,-0.1915,0.9709 -0.1435,-0.0000,-0.1915,0.9709 -0.1594,-0.0000,-0.1970,0.9674 -0.1594,-0.0000,-0.1970,0.9674 -0.1594,-0.0000,-0.1970,0.9674 -0.1594,-0.0000,-0.1970,0.9674 -0.1753,-0.0000,-0.2014,0.9637 -0.1753,-0.0000,-0.2014,0.9637 -0.1753,-0.0000,-0.2014,0.9637 -0.1753,-0.0000,-0.2014,0.9637 -0.1912,-0.0000,-0.2052,0.9599 -0.1912,-0.0000,-0.2052,0.9599 -0.1912,-0.0000,-0.2052,0.9599 -0.1912,-0.0000,-0.2052,0.9599 -0.2070,-0.0000,-0.2085,0.9559 -0.2070,-0.0000,-0.2085,0.9559 -0.2070,-0.0000,-0.2085,0.9559 -0.2070,-0.0000,-0.2085,0.9559 -0.2227,-0.0000,-0.2113,0.9517 -0.2227,-0.0000,-0.2113,0.9517 -0.2227,-0.0000,-0.2113,0.9517 -0.2227,-0.0000,-0.2113,0.9517 -0.2384,-0.0000,-0.2138,0.9473 -0.2384,-0.0000,-0.2138,0.9473 -0.2384,-0.0000,-0.2138,0.9473 -0.2384,-0.0000,-0.2138,0.9473 -0.2540,-0.0000,-0.2161,0.9428 -0.2540,-0.0000,-0.2161,0.9428 -0.2540,-0.0000,-0.2161,0.9428 -0.2540,-0.0000,-0.2161,0.9428 -0.2695,-0.0000,-0.2181,0.9380 -0.2695,-0.0000,-0.2181,0.9380 -0.2695,-0.0000,-0.2181,0.9380 -0.2695,-0.0000,-0.2181,0.9380 -0.2849,-0.0000,-0.2200,0.9330 -0.2849,-0.0000,-0.2200,0.9330 -0.2849,-0.0000,-0.2200,0.9330 -0.2849,-0.0000,-0.2200,0.9330 -0.3002,-0.0000,-0.2217,0.9277 -0.3002,-0.0000,-0.2217,0.9277 -0.3002,-0.0000,-0.2217,0.9277 -0.3002,-0.0000,-0.2217,0.9277 -0.3155,-0.0000,-0.2233,0.9223 -0.3155,-0.0000,-0.2233,0.9223 -0.3155,-0.0000,-0.2233,0.9223 -0.3155,-0.0000,-0.2233,0.9223 -0.3306,-0.0000,-0.2248,0.9166 -0.3306,-0.0000,-0.2248,0.9166 -0.3306,-0.0000,-0.2248,0.9166 -0.3306,-0.0000,-0.2248,0.9166 -0.3457,-0.0000,-0.2263,0.9107 -0.3457,-0.0000,-0.2263,0.9107 -0.3457,-0.0000,-0.2263,0.9107 -0.3457,-0.0000,-0.2263,0.9107 -0.3606,-0.0000,-0.2277,0.9045 -0.3606,-0.0000,-0.2277,0.9045 -0.3606,-0.0000,-0.2277,0.9045 -0.3606,-0.0000,-0.2277,0.9045 -0.3754,-0.0000,-0.2290,0.8981 -0.3754,-0.0000,-0.2290,0.8981 -0.3754,-0.0000,-0.2290,0.8981 -0.3754,-0.0000,-0.2290,0.8981 -0.3901,-0.0000,-0.2303,0.8915 -0.3901,-0.0000,-0.2303,0.8915 -0.3901,-0.0000,-0.2303,0.8915 -0.3901,-0.0000,-0.2303,0.8915 -0.4047,-0.0000,-0.2315,0.8847 -0.4047,-0.0000,-0.2315,0.8847 -0.4047,-0.0000,-0.2315,0.8847 -0.4047,-0.0000,-0.2315,0.8847 -0.4192,-0.0000,-0.2327,0.8776 -0.4192,-0.0000,-0.2327,0.8776 -0.4192,-0.0000,-0.2327,0.8776 -0.4192,-0.0000,-0.2327,0.8776 -0.4335,-0.0000,-0.2339,0.8703 -0.4335,-0.0000,-0.2339,0.8703 -0.4335,-0.0000,-0.2339,0.8703 -0.4335,-0.0000,-0.2339,0.8703 -0.4477,-0.0000,-0.2351,0.8627 -0.4477,-0.0000,-0.2351,0.8627 -0.4477,-0.0000,-0.2351,0.8627 -0.4477,-0.0000,-0.2351,0.8627 -0.4617,-0.0000,-0.2362,0.8550 -0.4617,-0.0000,-0.2362,0.8550 -0.4617,-0.0000,-0.2362,0.8550 -0.4617,-0.0000,-0.2362,0.8550 -0.4756,-0.0000,-0.2374,0.8470 -0.4756,-0.0000,-0.2374,0.8470 -0.4756,-0.0000,-0.2374,0.8470 -0.4756,-0.0000,-0.2374,0.8470 -0.4894,-0.0000,-0.2385,0.8388 -0.4894,-0.0000,-0.2385,0.8388 -0.4894,-0.0000,-0.2385,0.8388 -0.4894,-0.0000,-0.2385,0.8388 -0.5030,-0.0000,-0.2396,0.8304 -0.5030,-0.0000,-0.2396,0.8304 -0.5030,-0.0000,-0.2396,0.8304 -0.5030,-0.0000,-0.2396,0.8304 -0.5164,-0.0000,-0.2408,0.8218 -0.5164,-0.0000,-0.2408,0.8218 -0.5164,-0.0000,-0.2408,0.8218 -0.5164,-0.0000,-0.2408,0.8218 -0.5297,-0.0000,-0.2419,0.8130 -0.5297,-0.0000,-0.2419,0.8130 -0.5297,-0.0000,-0.2419,0.8130 -0.5297,-0.0000,-0.2419,0.8130 -0.5428,-0.0000,-0.2431,0.8039 -0.5428,-0.0000,-0.2431,0.8039 -0.5428,-0.0000,-0.2431,0.8039 -0.5428,-0.0000,-0.2431,0.8039 -0.5558,-0.0000,-0.2442,0.7947 -0.5558,-0.0000,-0.2442,0.7947 -0.5558,-0.0000,-0.2442,0.7947 -0.5558,-0.0000,-0.2442,0.7947 -0.5685,-0.0000,-0.2454,0.7852 -0.5685,-0.0000,-0.2454,0.7852 -0.5685,-0.0000,-0.2454,0.7852 -0.5685,-0.0000,-0.2454,0.7852 -0.5811,-0.0000,-0.2465,0.7756 -0.5811,-0.0000,-0.2465,0.7756 -0.5811,-0.0000,-0.2465,0.7756 -0.5811,-0.0000,-0.2465,0.7756 -0.5936,-0.0000,-0.2477,0.7657 -0.5936,-0.0000,-0.2477,0.7657 -0.5936,-0.0000,-0.2477,0.7657 -0.5936,-0.0000,-0.2477,0.7657 -0.6058,-0.0000,-0.2489,0.7557 -0.6058,-0.0000,-0.2489,0.7557 -0.6058,-0.0000,-0.2489,0.7557 -0.6058,-0.0000,-0.2489,0.7557 -0.6179,-0.0000,-0.2501,0.7455 -0.6179,-0.0000,-0.2501,0.7455 -0.6179,-0.0000,-0.2501,0.7455 -0.6179,-0.0000,-0.2501,0.7455 -0.6297,-0.0000,-0.2513,0.7351 -0.6297,-0.0000,-0.2513,0.7351 -0.6297,-0.0000,-0.2513,0.7351 -0.6297,-0.0000,-0.2513,0.7351 -0.6414,-0.0000,-0.2525,0.7245 -0.6414,-0.0000,-0.2525,0.7245 -0.6414,-0.0000,-0.2525,0.7245 -0.6414,-0.0000,-0.2525,0.7245 -0.6528,-0.0000,-0.2538,0.7137 -0.6528,-0.0000,-0.2538,0.7137 -0.6528,-0.0000,-0.2538,0.7137 -0.6528,-0.0000,-0.2538,0.7137 -0.6641,-0.0000,-0.2550,0.7028 -0.6641,-0.0000,-0.2550,0.7028 -0.6641,-0.0000,-0.2550,0.7028 -0.6641,-0.0000,-0.2550,0.7028 -0.6752,-0.0000,-0.2563,0.6917 -0.6752,-0.0000,-0.2563,0.6917 -0.6752,-0.0000,-0.2563,0.6917 -0.6752,-0.0000,-0.2563,0.6917 -0.6860,-0.0000,-0.2576,0.6804 -0.6860,-0.0000,-0.2576,0.6804 -0.6860,-0.0000,-0.2576,0.6804 -0.6860,-0.0000,-0.2576,0.6804 -0.6967,-0.0000,-0.2590,0.6690 -0.6967,-0.0000,-0.2590,0.6690 -0.6967,-0.0000,-0.2590,0.6690 -0.6967,-0.0000,-0.2590,0.6690 -0.7071,-0.0000,-0.2603,0.6575 -0.7071,-0.0000,-0.2603,0.6575 -0.7071,-0.0000,-0.2603,0.6575 -0.7071,-0.0000,-0.2603,0.6575 -0.7173,-0.0000,-0.2617,0.6457 -0.7173,-0.0000,-0.2617,0.6457 -0.7173,-0.0000,-0.2617,0.6457 -0.7173,-0.0000,-0.2617,0.6457 -0.7273,-0.0000,-0.2631,0.6339 -0.7273,-0.0000,-0.2631,0.6339 -0.7273,-0.0000,-0.2631,0.6339 -0.7273,-0.0000,-0.2631,0.6339 -0.7371,-0.0000,-0.2645,0.6219 -0.7371,-0.0000,-0.2645,0.6219 -0.7371,-0.0000,-0.2645,0.6219 -0.7371,-0.0000,-0.2645,0.6219 -0.7467,-0.0000,-0.2659,0.6097 -0.7467,-0.0000,-0.2659,0.6097 -0.7467,-0.0000,-0.2659,0.6097 -0.7467,-0.0000,-0.2659,0.6097 -0.7560,-0.0000,-0.2674,0.5974 -0.7560,-0.0000,-0.2674,0.5974 -0.7560,-0.0000,-0.2674,0.5974 -0.7560,-0.0000,-0.2674,0.5974 -0.7651,-0.0000,-0.2689,0.5851 -0.7651,-0.0000,-0.2689,0.5851 -0.7651,-0.0000,-0.2689,0.5851 -0.7651,-0.0000,-0.2689,0.5851 -0.7740,-0.0000,-0.2705,0.5725 -0.7740,-0.0000,-0.2705,0.5725 -0.7740,-0.0000,-0.2705,0.5725 -0.7740,-0.0000,-0.2705,0.5725 -0.7826,-0.0000,-0.2720,0.5599 -0.7826,-0.0000,-0.2720,0.5599 -0.7826,-0.0000,-0.2720,0.5599 -0.7826,-0.0000,-0.2720,0.5599 -0.7910,-0.0000,-0.2736,0.5472 -0.7910,-0.0000,-0.2736,0.5472 -0.7910,-0.0000,-0.2736,0.5472 -0.7910,-0.0000,-0.2736,0.5472 -0.7992,-0.0000,-0.2752,0.5343 -0.7992,-0.0000,-0.2752,0.5343 -0.7992,-0.0000,-0.2752,0.5343 -0.7992,-0.0000,-0.2752,0.5343 -0.8072,-0.0000,-0.2769,0.5214 -0.8072,-0.0000,-0.2769,0.5214 -0.8072,-0.0000,-0.2769,0.5214 -0.8072,-0.0000,-0.2769,0.5214 -0.8149,-0.0000,-0.2786,0.5083 -0.8149,-0.0000,-0.2786,0.5083 -0.8149,-0.0000,-0.2786,0.5083 -0.8149,-0.0000,-0.2786,0.5083 -0.8223,-0.0000,-0.2803,0.4952 -0.8223,-0.0000,-0.2803,0.4952 -0.8223,-0.0000,-0.2803,0.4952 -0.8223,-0.0000,-0.2803,0.4952 -0.8295,-0.0000,-0.2820,0.4820 -0.8295,-0.0000,-0.2820,0.4820 -0.8295,-0.0000,-0.2820,0.4820 -0.8295,-0.0000,-0.2820,0.4820 -0.8365,-0.0000,-0.2838,0.4687 -0.8365,-0.0000,-0.2838,0.4687 -0.8365,-0.0000,-0.2838,0.4687 -0.8365,-0.0000,-0.2838,0.4687 -0.8433,-0.0000,-0.2857,0.4553 -0.8433,-0.0000,-0.2857,0.4553 -0.8433,-0.0000,-0.2857,0.4553 -0.8433,-0.0000,-0.2857,0.4553 -0.8497,-0.0000,-0.2875,0.4419 -0.8497,-0.0000,-0.2875,0.4419 -0.8497,-0.0000,-0.2875,0.4419 -0.8497,-0.0000,-0.2875,0.4419 -0.8560,-0.0000,-0.2894,0.4284 -0.8560,-0.0000,-0.2894,0.4284 -0.8560,-0.0000,-0.2894,0.4284 -0.8560,-0.0000,-0.2894,0.4284 -0.8620,-0.0000,-0.2913,0.4148 -0.8620,-0.0000,-0.2913,0.4148 -0.8620,-0.0000,-0.2913,0.4148 -0.8620,-0.0000,-0.2913,0.4148 -0.8677,-0.0000,-0.2933,0.4012 -0.8677,-0.0000,-0.2933,0.4012 -0.8677,-0.0000,-0.2933,0.4012 -0.8677,-0.0000,-0.2933,0.4012 -0.8732,-0.0000,-0.2953,0.3876 -0.8732,-0.0000,-0.2953,0.3876 -0.8732,-0.0000,-0.2953,0.3876 -0.8732,-0.0000,-0.2953,0.3876 -0.8785,-0.0000,-0.2974,0.3739 -0.8785,-0.0000,-0.2974,0.3739 -0.8785,-0.0000,-0.2974,0.3739 -0.8785,-0.0000,-0.2974,0.3739 -0.8835,-0.0000,-0.2995,0.3602 -0.8835,-0.0000,-0.2995,0.3602 -0.8835,-0.0000,-0.2995,0.3602 -0.8835,-0.0000,-0.2995,0.3602 -0.8883,-0.0000,-0.3016,0.3465 -0.8883,-0.0000,-0.3016,0.3465 -0.8883,-0.0000,-0.3016,0.3465 -0.8883,-0.0000,-0.3016,0.3465 -0.8928,-0.0000,-0.3038,0.3327 -0.8928,-0.0000,-0.3038,0.3327 -0.8928,-0.0000,-0.3038,0.3327 -0.8928,-0.0000,-0.3038,0.3327 -0.8970,-0.0000,-0.3060,0.3189 -0.8970,-0.0000,-0.3060,0.3189 -0.8970,-0.0000,-0.3060,0.3189 -0.8970,-0.0000,-0.3060,0.3189 -0.9010,-0.0000,-0.3083,0.3051 -0.9010,-0.0000,-0.3083,0.3051 -0.9010,-0.0000,-0.3083,0.3051 -0.9010,-0.0000,-0.3083,0.3051 -0.9048,-0.0000,-0.3106,0.2913 -0.9048,-0.0000,-0.3106,0.2913 -0.9048,-0.0000,-0.3106,0.2913 -0.9048,-0.0000,-0.3106,0.2913 -0.9083,-0.0000,-0.3130,0.2776 -0.9083,-0.0000,-0.3130,0.2776 -0.9083,-0.0000,-0.3130,0.2776 -0.9083,-0.0000,-0.3130,0.2776 -0.9116,-0.0000,-0.3154,0.2638 -0.9116,-0.0000,-0.3154,0.2638 -0.9116,-0.0000,-0.3154,0.2638 -0.9116,-0.0000,-0.3154,0.2638 -0.9146,-0.0000,-0.3179,0.2500 -0.9146,-0.0000,-0.3179,0.2500 -0.9146,-0.0000,-0.3179,0.2500 -0.9146,-0.0000,-0.3179,0.2500 -0.9174,-0.0000,-0.3204,0.2363 -0.9174,-0.0000,-0.3204,0.2363 -0.9174,-0.0000,-0.3204,0.2363 -0.9174,-0.0000,-0.3204,0.2363 -0.9199,-0.0000,-0.3229,0.2226 -0.9199,-0.0000,-0.3229,0.2226 -0.9199,-0.0000,-0.3229,0.2226 -0.9199,-0.0000,-0.3229,0.2226 -0.9222,-0.0000,-0.3256,0.2089 -0.9222,-0.0000,-0.3256,0.2089 -0.9222,-0.0000,-0.3256,0.2089 -0.9222,-0.0000,-0.3256,0.2089 -0.9242,-0.0000,-0.3282,0.1952 -0.9242,-0.0000,-0.3282,0.1952 -0.9242,-0.0000,-0.3282,0.1952 -0.9242,-0.0000,-0.3282,0.1952 -0.9260,-0.0000,-0.3309,0.1817 -0.9260,-0.0000,-0.3309,0.1817 -0.9260,-0.0000,-0.3309,0.1817 -0.9260,-0.0000,-0.3309,0.1817 -0.9276,-0.0000,-0.3337,0.1681 -0.9276,-0.0000,-0.3337,0.1681 -0.9276,-0.0000,-0.3337,0.1681 -0.9276,-0.0000,-0.3337,0.1681 -0.9289,-0.0000,-0.3366,0.1546 -0.9289,-0.0000,-0.3366,0.1546 -0.9289,-0.0000,-0.3366,0.1546 -0.9289,-0.0000,-0.3366,0.1546 -0.9300,-0.0000,-0.3395,0.1412 -0.9300,-0.0000,-0.3395,0.1412 -0.9300,-0.0000,-0.3395,0.1412 -0.9300,-0.0000,-0.3395,0.1412 -0.9308,-0.0000,-0.3424,0.1279 -0.9308,-0.0000,-0.3424,0.1279 -0.9308,-0.0000,-0.3424,0.1279 -0.9308,-0.0000,-0.3424,0.1279 -0.9314,-0.0000,-0.3454,0.1146 -0.9314,-0.0000,-0.3454,0.1146 -0.9314,-0.0000,-0.3454,0.1146 -0.9314,-0.0000,-0.3454,0.1146 -0.9318,-0.0000,-0.3485,0.1015 -0.9318,-0.0000,-0.3485,0.1015 -0.9318,-0.0000,-0.3485,0.1015 -0.9318,-0.0000,-0.3485,0.1015 -0.9320,-0.0000,-0.3516,0.0884 -0.9320,-0.0000,-0.3516,0.0884 -0.9320,-0.0000,-0.3516,0.0884 -0.9320,-0.0000,-0.3516,0.0884 -0.9319,-0.0000,-0.3548,0.0754 -0.9319,-0.0000,-0.3548,0.0754 -0.9319,-0.0000,-0.3548,0.0754 -0.9319,-0.0000,-0.3548,0.0754 -0.9316,-0.0000,-0.3581,0.0625 -0.9316,-0.0000,-0.3581,0.0625 -0.9316,-0.0000,-0.3581,0.0625 -0.9316,-0.0000,-0.3581,0.0625 -0.9311,-0.0000,-0.3614,0.0498 -0.9311,-0.0000,-0.3614,0.0498 -0.9311,-0.0000,-0.3614,0.0498 -0.9311,-0.0000,-0.3614,0.0498 -0.9303,-0.0000,-0.3648,0.0371 -0.9303,-0.0000,-0.3648,0.0371 -0.9303,-0.0000,-0.3648,0.0371 -0.9303,-0.0000,-0.3648,0.0371 -0.9294,-0.0000,-0.3683,0.0246 -0.9294,-0.0000,-0.3683,0.0246 -0.9294,-0.0000,-0.3683,0.0246 -0.9294,-0.0000,-0.3683,0.0246 -0.9282,-0.0000,-0.3718,0.0122 -0.9282,-0.0000,-0.3718,0.0122 -0.9282,-0.0000,-0.3718,0.0122 -0.9282,-0.0000,-0.3718,0.0122 -0.9269,-0.0000,-0.3754,-0.0000 -0.9269,-0.0000,-0.3754,-0.0000 -0.9269,-0.0000,-0.3754,-0.0000 -0.9269,-0.0000,-0.3754,-0.0000 diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index 690f495c7f..866d2eee2c 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -26,10 +26,12 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ + import pytest from .utils import * + """ Ambisonics """ @@ -56,156 +58,6 @@ def test_ambisonics_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file): ) -# Test compares rendering with just a trajectory file against rendering with a trajectory file + a zero ref rotation. -# These should be binary equivalent. -@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -def test_ambisonics_binaural_headrotation_refrotzero(test_info, in_fmt, out_fmt, trj_file): - compare_renderer_args( - test_info, - in_fmt, - out_fmt, - ref_kwargs={ - "name_extension": "refrotzero", - "trj_file": HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv") - }, - cut_kwargs={ - "trj_file": HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), - "refrot_file": HR_TRAJECTORY_DIR.joinpath("const000.csv") - } - ) - - -# Second test compares rendering with no head rotation against rendering with equal ref and head rotation. -# These should also be binary equivalent. -# Note that reference rotation is supplied per 4 subframes; head rotation per subframe. -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -def test_ambisonics_binaural_headrotation_refrotequal(test_info, in_fmt, out_fmt): - compare_renderer_args( - test_info, - in_fmt, - out_fmt, - ref_kwargs={ - "name_extension": "refrotequal", - }, - cut_kwargs={ - "trj_file": HR_TRAJECTORY_DIR.joinpath("azi_plus_2-ele_plus_2-every-100-frames.csv"), - "refrot_file": HR_TRAJECTORY_DIR.joinpath("azi_plus_2-ele_plus_2-every-25-rows.csv") - } - ) - -# This test compares rendering with: -# ref: head rotation trajectory file (OTR=NONE) -# cut: identical head rotation trajectory file as ref but in addition a constant -# reference vector in the looking direction of the coordinate system (OTR=REF_VEC) -@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -def test_ambisonics_binaural_headrotation_refveczero(test_info, in_fmt, out_fmt, trj_file): - compare_renderer_args( - test_info, - in_fmt, - out_fmt, - ref_kwargs={ - "name_extension": "refveczero", - "trj_file": HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv") - }, - cut_kwargs={ - "trj_file": HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), - "refvec_file": HR_TRAJECTORY_DIR.joinpath("const000-Vector3.csv") - } - ) - -# This test compares rendering with: -# ref: no head rotation (OTR=NONE) -# cut: rendering with head rotation and a ref vector which moves in the -# looking-direction of the head rotation and therefore compensates it (OTR=REF_VEC) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -def test_ambisonics_binaural_headrotation_refvecequal(test_info, in_fmt, out_fmt): - compare_renderer_args( - test_info, - in_fmt, - out_fmt, - ref_kwargs={ - "name_extension": "refvecequal", - }, - cut_kwargs={ - "trj_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s.csv"), - "refvec_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s-Vector3.csv") - } - ) - -# This test compares rendering with: -# ref: a head rotation trajectory with elevation (OTR=NONE) -# cut: a static head rotation and a reference position trajectory which moves -# in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -def test_ambisonics_binaural_headrotation_refvec_rotating(test_info, in_fmt, out_fmt): - compare_renderer_args( - test_info, - in_fmt, - out_fmt, - ref_kwargs={ - "name_extension": "refvec_rotating", - "trj_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s.csv"), - }, - cut_kwargs={ - "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), - "refvec_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s-ccw-Vector3.csv") - } - ) - -# This test compares rendering with: -# ref: a head rotation trajectory with elevation (OTR=NONE) -# cut: a static head rotation and a reference position trajectory which moves -# in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) -# which also contains a fixed position offset between listener and reference position (which -# gets compensated in the REF_VEV OTR modes) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -def test_ambisonics_binaural_headrotation_refvec_rotating_fixed_pos_offset(test_info, in_fmt, out_fmt): - compare_renderer_args( - test_info, - in_fmt, - out_fmt, - ref_kwargs={ - "name_extension": "refvec_rotating", - "trj_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s-ccw.csv"), - }, - cut_kwargs={ - "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), - "refvec_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s-fixed-pos-offset-Vector3.csv") - } - ) - -# This test compares rendering with: -# ref: a reference position trajectory with elevation and REF_VEC_LEV OTR mode (OTR=REF_VEC_LEV) -# cut: a reference position trajectory without the elevation and REF_VEC OTR mode (OTR=REF_VEC) -# Since the only difference between REF_VEC_LEV and REF_VEC is that *LEV ignores -# the height difference in positions, the output must be binary equivalent. -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -def test_ambisonics_binaural_headrotation_refveclev_vs_refvec(test_info, in_fmt, out_fmt): - compare_renderer_args( - test_info, - in_fmt, - out_fmt, - ref_kwargs={ - "name_extension": "refveclevel", - "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), - "refveclev_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s-Vector3.csv"), - }, - cut_kwargs={ - "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), - "refvec_file": HR_TRAJECTORY_DIR.joinpath("full-circle-4s-Vector3.csv") - } - ) - - """ Multichannel """ @@ -244,30 +96,6 @@ def test_multichannel_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), ) -# This test compares rendering with: -# ref: a head rotation trajectory with elevation (OTR=NONE) -# cut: a static head rotation and a reference position trajectory which moves -# in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) -def test_multichannel_binaural_headrotation_refvec_rotating(test_info, in_fmt, out_fmt): - if in_fmt in ["MONO", "STEREO"]: - pytest.skip("MONO or STEREO to Binaural rendering unsupported") - - compare_renderer_args( - test_info, - in_fmt, - out_fmt, - ref_kwargs={ - "name_extension": "refvec_rotating", - "trj_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s.csv"), - }, - cut_kwargs={ - "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), - "refvec_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s-ccw-Vector3.csv") - } - ) - """ ISM """ @@ -316,33 +144,6 @@ def test_ism_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file): in_meta_files=in_meta_files, ) -# This test compares rendering with: -# ref: a head rotation trajectory with elevation (OTR=NONE) -# cut: a static head rotation and a reference position trajectory which moves -# in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) -def test_ism_binaural_headrotation_refvec_rotating(test_info, in_fmt, out_fmt): - try: - in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt] - except: - in_meta_files = None - - compare_renderer_args( - test_info, - in_fmt, - out_fmt, - ref_kwargs={ - "name_extension": "refvec_rotating", - "trj_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s.csv"), - "in_meta_files": in_meta_files - }, - cut_kwargs={ - "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), - "refvec_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s-ccw-Vector3.csv"), - "in_meta_files": in_meta_files - } - ) """ MASA """ diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index 7a98dff300..143c33b066 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -31,11 +31,12 @@ import subprocess as sp import sys from pathlib import Path from tempfile import TemporaryDirectory -from typing import Optional, Tuple, Dict +from typing import Optional, Tuple import numpy as np import pytest + from .compare_audio import compare_audio_arrays from .constants import * @@ -105,10 +106,6 @@ def run_renderer( metadata_input: Optional[str] = None, in_meta_files: Optional[list] = None, trj_file: Optional[str] = None, - name_extension: Optional[str] = None, - refrot_file: Optional[str] = None, - refvec_file: Optional[str] = None, - refveclev_file: Optional[str] = None, output_path_base: str = OUTPUT_PATH_CUT, binary_suffix: str = "", is_comparetest: Optional[bool] = False, @@ -119,23 +116,6 @@ def run_renderer( else: trj_name = "" - if refrot_file is not None: - refrot_name = f"_{refrot_file.stem}" - else: - refrot_name = "" - - if refvec_file is not None: - refvec_name = f"_{refvec_file.stem}" - else: - refvec_name = "" - - if refveclev_file is not None: - refveclev_name = f"_{refveclev_file.stem}" - else: - refveclev_name = "" - - - if not isinstance(out_fmt, str): out_name = f"{out_fmt.stem}" else: @@ -156,7 +136,7 @@ def run_renderer( in_file = FORMAT_TO_FILE[in_fmt] in_name = in_fmt - out_file = str(output_path_base.joinpath(f"{in_name}_to_{out_name}{trj_name}{refrot_name}{refvec_name}{refveclev_name}{name_extension}.wav")) + out_file = str(output_path_base.joinpath(f"{in_name}_to_{out_name}{trj_name}.wav")) cmd = RENDERER_CMD[:] cmd[2] = str(in_file) @@ -172,18 +152,6 @@ def run_renderer( if trj_file is not None: cmd.extend(["-tf", str(trj_file)]) - if refrot_file is not None: - cmd.extend(["-rf", str(refrot_file)]) - cmd.extend(["-otr", "ref"]) - - if refvec_file is not None: - cmd.extend(["-rvf", str(refvec_file)]) - cmd.extend(["-otr", "ref_vec"]) - - if refveclev_file is not None: - cmd.extend(["-rvf", str(refveclev_file)]) - cmd.extend(["-otr", "ref_vec_lev"]) - run_cmd(cmd) return pyaudio3dtools.audiofile.readfile(out_file) @@ -254,8 +222,3 @@ def compare_renderer_vs_pyscripts(test_info, in_fmt, out_fmt, **kwargs): ref, ref_fs = run_pyscripts(in_fmt, out_fmt, **kwargs) cut, cut_fs = run_renderer(in_fmt, out_fmt, **kwargs) check_BE(test_info, ref, ref_fs, cut, cut_fs) - -def compare_renderer_args(test_info, in_fmt, out_fmt, ref_kwargs: Dict, cut_kwargs: Dict): - ref, ref_fs = run_renderer(in_fmt, out_fmt, **ref_kwargs) - cut, cut_fs = run_renderer(in_fmt, out_fmt, **cut_kwargs) - check_BE(test_info, ref, ref_fs, cut, cut_fs) \ No newline at end of file -- GitLab From faffb8dc51d707c4dc2c30f051183724937a584a Mon Sep 17 00:00:00 2001 From: malenov Date: Tue, 28 Mar 2023 18:02:02 +0200 Subject: [PATCH 21/43] remove unused function --- lib_com/bitstream.c | 58 --------------------------------------------- 1 file changed, 58 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index d0d7f442c6..c28c04112b 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -269,64 +269,6 @@ ivas_error ind_list_realloc( return IVAS_ERR_OK; } -/*-------------------------------------------------------------------* - * ind_list_metadata_realloc() - * - * Re-allocate list of metadata indices if the IVAS total bitrate has changed - *-------------------------------------------------------------------*/ - -// ivas_error ind_list_metadata_realloc( -// BSTR_ENC_HANDLE hMetaData, /* i/o: encoder bitstream handle */ -// const IVAS_FORMAT ivas_format, /* i : IVAS format */ -// const int32_t ivas_total_brate /* i : IVAS total bitrate */ -//) -//{ -// int16_t i, max_num_indices_metadata; -// INDICE_HANDLE new_ind_list_metadata; -// -// if ( hMetaData != NULL && hMetaData->ind_list != NULL ) -// { -// /* get the maximum allowed number of indices in the list */ -// max_num_indices_metadata = get_max_num_indices_metadata( ivas_format, ivas_total_brate ); -// -// /* check, if the maximum number of allowed indices has changed */ -// if ( max_num_indices_metadata != hMetaData->max_num_indices ) -// { -// /* allocate new buffer of metadata indices */ -// if ( ( new_ind_list_metadata = (INDICE_HANDLE) malloc( max_num_indices_metadata * sizeof( Indice ) ) ) == NULL ) -// { -// return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of metadata indices!\n" ) ); -// } -// -// /* move indices from the old list to the new list */ -// i = 0; -// while ( hMetaData->ind_list[i].nb_bits > 0 ) -// { -// new_ind_list_metadata[i].id = hMetaData->ind_list[i].id; -// new_ind_list_metadata[i].value = hMetaData->ind_list[i].value; -// new_ind_list_metadata[i].nb_bits = hMetaData->ind_list[i].nb_bits; -// i++; -// } -// -// /* reset nb_bits of all other indices to -1 */ -// for ( ; i < max_num_indices_metadata; i++ ) -// { -// new_ind_list_metadata[i].nb_bits = -1; -// } -// -// /* free the old list */ -// free( hMetaData->ind_list ); -// -// /* set pointer to the new list */ -// hMetaData->ind_list = new_ind_list_metadata; -// -// /* set the new maximum for the allowed number of indices */ -// hMetaData->max_num_indices = max_num_indices_metadata; -// } -// } -// -// return IVAS_ERR_OK; -// } /*-----------------------------------------------------------------------* * get_max_num_indices() -- GitLab From 880f9a200c92f59677f36fa08d8c3fa142c7cc9c Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Tue, 28 Mar 2023 18:13:55 +0200 Subject: [PATCH 22/43] Update to main --- .gitignore | 12 + .gitlab-ci.yml | 43 + Workspace_msvc/lib_com.vcxproj | 2 +- Workspace_msvc/lib_com.vcxproj.filters | 6 +- Workspace_msvc/lib_util.vcxproj | 2 + apps/decoder.c | 302 +- apps/encoder.c | 51 +- apps/renderer.c | 329 +- lib_com/bitstream.c | 552 +-- lib_com/cldfb.c | 17 +- lib_com/cnst.h | 2 - lib_com/common_api_types.h | 27 + lib_com/ivas_cnst.h | 83 +- lib_com/ivas_cov_smooth.c | 49 +- lib_com/ivas_error.h | 29 +- lib_com/ivas_fb_mixer.c | 38 +- lib_com/{ivas_ism_config.c => ivas_ism_com.c} | 198 +- lib_com/ivas_masa_com.c | 26 + lib_com/ivas_mc_param_com.c | 1 - lib_com/ivas_prot.h | 294 +- lib_com/ivas_rom_com.h | 1 + lib_com/ivas_stat_com.h | 32 +- lib_com/ivas_transient_det.c | 29 - lib_com/options.h | 41 +- lib_com/prot.h | 69 +- lib_dec/acelp_core_dec.c | 20 +- lib_dec/fd_cng_dec.c | 72 +- lib_dec/init_dec.c | 9 +- lib_dec/ivas_agc_dec.c | 24 +- lib_dec/ivas_binRenderer_internal.c | 9 - lib_dec/ivas_core_dec.c | 17 +- lib_dec/ivas_corecoder_dec_reconfig.c | 3 - lib_dec/ivas_dec.c | 48 +- lib_dec/ivas_decision_matrix_dec.c | 4 +- lib_dec/ivas_dirac_dec.c | 21 +- lib_dec/ivas_dirac_output_synthesis_cov.c | 1 - lib_dec/ivas_init_dec.c | 261 +- lib_dec/ivas_ism_dec.c | 118 +- lib_dec/ivas_ism_dtx_dec.c | 143 +- lib_dec/ivas_ism_metadata_dec.c | 722 +++- lib_dec/ivas_ism_param_dec.c | 175 +- lib_dec/ivas_ism_renderer.c | 12 +- lib_dec/ivas_lfe_dec.c | 20 +- lib_dec/ivas_masa_dec.c | 27 +- lib_dec/ivas_mc_param_dec.c | 4 +- lib_dec/ivas_mcmasa_dec.c | 5 +- lib_dec/ivas_mct_dec.c | 92 +- lib_dec/ivas_objectRenderer_internal.c | 22 +- lib_dec/ivas_sba_dec.c | 175 +- lib_dec/ivas_sba_rendering_internal.c | 4 +- lib_dec/ivas_sce_dec.c | 25 +- lib_dec/ivas_spar_decoder.c | 127 +- lib_dec/ivas_spar_md_dec.c | 8 +- lib_dec/ivas_stat_dec.h | 30 +- lib_dec/ivas_tcx_core_dec.c | 16 +- lib_dec/lib_dec.c | 125 +- lib_dec/lib_dec.h | 36 +- lib_dec/stat_dec.h | 7 +- lib_enc/acelp_core_enc.c | 4 - lib_enc/acelp_core_switch_enc.c | 17 - lib_enc/amr_wb_enc.c | 7 +- lib_enc/bw_detect.c | 51 + lib_enc/cng_enc.c | 8 - lib_enc/dtx.c | 8 +- lib_enc/enc_ppp.c | 8 +- lib_enc/eval_pit_contr.c | 8 - lib_enc/fd_cng_enc.c | 20 +- lib_enc/igf_enc.c | 82 - lib_enc/init_enc.c | 55 +- lib_enc/ivas_agc_enc.c | 24 +- lib_enc/ivas_core_enc.c | 27 +- lib_enc/ivas_core_pre_proc_front.c | 18 +- lib_enc/ivas_corecoder_enc_reconfig.c | 228 +- lib_enc/ivas_cpe_enc.c | 41 +- lib_enc/ivas_decision_matrix_enc.c | 4 +- lib_enc/ivas_dirac_enc.c | 25 +- lib_enc/ivas_enc.c | 5 +- lib_enc/ivas_enc_cov_handler.c | 27 +- lib_enc/ivas_init_enc.c | 167 +- lib_enc/ivas_ism_dtx_enc.c | 234 +- lib_enc/ivas_ism_enc.c | 197 +- lib_enc/ivas_ism_metadata_enc.c | 754 ++++- lib_enc/ivas_ism_param_enc.c | 135 +- lib_enc/ivas_lfe_enc.c | 53 +- lib_enc/ivas_masa_enc.c | 55 +- lib_enc/ivas_mc_param_enc.c | 30 +- lib_enc/ivas_mcmasa_enc.c | 80 +- lib_enc/ivas_mct_enc.c | 96 +- lib_enc/ivas_mdct_core_enc.c | 17 + lib_enc/ivas_qmetadata_enc.c | 91 +- lib_enc/ivas_sba_enc.c | 112 +- lib_enc/ivas_sce_enc.c | 44 +- lib_enc/ivas_spar_encoder.c | 146 +- lib_enc/ivas_spar_md_enc.c | 53 +- lib_enc/ivas_stat_enc.h | 14 +- lib_enc/ivas_stereo_dmx_evs.c | 16 +- lib_enc/ivas_stereo_mdct_core_enc.c | 21 +- lib_enc/ivas_tcx_core_enc.c | 4 - lib_enc/lib_enc.c | 104 +- lib_enc/lib_enc.h | 7 +- lib_enc/pre_proc.c | 7 +- lib_enc/rst_enc.c | 4 - lib_enc/stat_enc.h | 20 +- lib_enc/tcx_utils_enc.c | 16 - lib_rend/ivas_crend.c | 1432 +------- lib_rend/ivas_dirac_dec_binaural_functions.c | 17 +- lib_rend/ivas_hrtf.c | 36 - lib_rend/ivas_objectRenderer.c | 281 +- lib_rend/ivas_objectRenderer_hrFilt.c | 11 + lib_rend/ivas_objectRenderer_sfx.c | 12 +- lib_rend/ivas_objectRenderer_sources.c | 15 + lib_rend/ivas_objectRenderer_vec.c | 17 +- lib_rend/ivas_orient_trk.c | 620 +++- lib_rend/ivas_prot_rend.h | 167 +- lib_rend/ivas_render_config.c | 7 + lib_rend/ivas_reverb.c | 177 +- lib_rend/ivas_rom_TdBinauralRenderer.c | 3 + lib_rend/ivas_rom_binauralRenderer.c | 4 + lib_rend/ivas_rom_binaural_crend_head.c | 2 + lib_rend/ivas_rom_rend.c | 2 +- lib_rend/ivas_rotation.c | 156 +- lib_rend/ivas_stat_rend.h | 86 +- lib_rend/lib_rend.c | 848 +++-- lib_rend/lib_rend.h | 35 + lib_util/audio_file_reader.c | 46 +- lib_util/audio_file_reader.h | 10 - lib_util/audio_file_writer.c | 4 + lib_util/head_rotation_file_reader.c | 92 +- lib_util/head_rotation_file_reader.h | 18 +- lib_util/ism_file_reader.c | 47 +- lib_util/ism_file_writer.c | 19 +- lib_util/ism_file_writer.h | 2 +- lib_util/ls_custom_file_reader.c | 6 +- lib_util/ls_custom_file_reader.h | 6 +- lib_util/masa_file_writer.c | 2 + lib_util/render_config_reader.c | 9 + lib_util/vector3_pair_file_reader.c | 166 + .../vector3_pair_file_reader.h | 130 +- scripts/IvasBuildAndRun.py | 1 - scripts/config/self_test.prm | 198 +- scripts/pyivastest/IvasModeAnalyzer.py | 5 +- scripts/pyivastest/IvasScriptsCommon.py | 3 - scripts/pyivastest/IvasSvnBuilder.py | 2 - scripts/testv/stv16c.wav | 4 +- scripts/testv/stv16n.wav | 4 +- scripts/testv/stv1ISM48s.wav | 4 +- scripts/testv/stv1MASA1TC48c.wav | 4 +- scripts/testv/stv1MASA1TC48n.wav | 4 +- scripts/testv/stv1MASA2TC48c.wav | 4 +- scripts/testv/stv1MASA2TC48n.wav | 2 +- scripts/testv/stv2ISM48s.wav | 4 +- scripts/testv/stv2MASA1TC48c.wav | 4 +- scripts/testv/stv2MASA2TC48c.wav | 4 +- scripts/testv/stv2OA32c.wav | 4 +- scripts/testv/stv2OA48c.wav | 4 +- scripts/testv/stv32c.wav | 4 +- scripts/testv/stv32n.wav | 4 +- scripts/testv/stv3ISM48s.wav | 4 +- scripts/testv/stv3OA32c.wav | 4 +- scripts/testv/stv3OA48c.wav | 4 +- scripts/testv/stv48c.wav | 4 +- scripts/testv/stv48n.wav | 4 +- scripts/testv/stv4ISM48n.wav | 2 +- scripts/testv/stv4ISM48s.wav | 4 +- scripts/testv/stv512MC48c.wav | 4 +- scripts/testv/stv514MC48c.wav | 4 +- scripts/testv/stv51MC48c.wav | 4 +- scripts/testv/stv714MC48c.wav | 4 +- scripts/testv/stv71MC48c.wav | 4 +- scripts/testv/stv8c.wav | 4 +- scripts/testv/stv8n.wav | 4 +- scripts/testv/stvFOA16c.wav | 4 +- scripts/testv/stvFOA32c.wav | 4 +- scripts/testv/stvFOA48c.wav | 4 +- scripts/testv/stvST16c.wav | 4 +- scripts/testv/stvST16n.wav | 4 +- scripts/testv/stvST32c.wav | 4 +- scripts/testv/stvST32n.wav | 4 +- scripts/testv/stvST48c.wav | 4 +- scripts/testv/stvST48n.wav | 4 +- ...s_2-ele_plus_2-every-100-frames-Euler.csv} | 0 ...zi_plus_2-ele_plus_2-every-100-frames.csv} | 0 .../azi_plus_2-ele_plus_2-every-25-rows.csv | 3000 +++++++++++++++++ scripts/trajectories/const000-Vector3.csv | 4 + .../trajectories/full-circle-4s-Vector3.csv | 200 ++ .../full-circle-4s-ccw-Vector3.csv | 200 ++ scripts/trajectories/full-circle-4s-ccw.csv | 800 +++++ scripts/trajectories/full-circle-4s.csv | 800 +++++ ...ull-circle-with-up-and-down-4s-Vector3.csv | 200 ++ ...circle-with-up-and-down-4s-ccw-Vector3.csv | 200 ++ .../full-circle-with-up-and-down-4s-ccw.csv | 800 +++++ ...p-and-down-4s-fixed-pos-offset-Vector3.csv | 200 ++ .../full-circle-with-up-and-down-4s.csv | 800 +++++ tests/renderer/test_renderer.py | 203 +- tests/renderer/utils.py | 43 +- 195 files changed, 14055 insertions(+), 5994 deletions(-) rename lib_com/{ivas_ism_config.c => ivas_ism_com.c} (73%) create mode 100644 lib_util/vector3_pair_file_reader.c rename lib_debug/segsnr.c => lib_util/vector3_pair_file_reader.h (52%) rename scripts/trajectories/{azi+2-ele+2-every-100-frames-Euler.csv => azi_plus_2-ele_plus_2-every-100-frames-Euler.csv} (100%) rename scripts/trajectories/{azi+2-ele+2-every-100-frames.csv => azi_plus_2-ele_plus_2-every-100-frames.csv} (100%) create mode 100644 scripts/trajectories/azi_plus_2-ele_plus_2-every-25-rows.csv create mode 100644 scripts/trajectories/const000-Vector3.csv create mode 100644 scripts/trajectories/full-circle-4s-Vector3.csv create mode 100644 scripts/trajectories/full-circle-4s-ccw-Vector3.csv create mode 100644 scripts/trajectories/full-circle-4s-ccw.csv create mode 100644 scripts/trajectories/full-circle-4s.csv create mode 100644 scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv create mode 100644 scripts/trajectories/full-circle-with-up-and-down-4s-ccw-Vector3.csv create mode 100644 scripts/trajectories/full-circle-with-up-and-down-4s-ccw.csv create mode 100644 scripts/trajectories/full-circle-with-up-and-down-4s-fixed-pos-offset-Vector3.csv create mode 100644 scripts/trajectories/full-circle-with-up-and-down-4s.csv diff --git a/.gitignore b/.gitignore index c87c691a4a..52512506d7 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,15 @@ Externals/ # coan output files that are created when cleaning out switches coan_out_* +/COMPLEXITY +/res +/tv +/wmops +/Workspace_msvc/renderer.args.json +/Workspace_msvc/encoder.args.json +/Workspace_msvc/decoder.args.json +/scripts/mem_analysis_enc_VBR_5k9.csv +/scripts/mem_analysis_enc_STEREO_sw.png +/scripts/mem_analysis_enc_STEREO_sw.csv +/scripts/mem_analysis_enc_STEREO_16k4_DTX.csv +*.pwv diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6d00b37f0a..082cf40cab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,6 +49,13 @@ stages: echo "Commit time was $CI_COMMIT_TIMESTAMP" date | xargs echo "System time is" +.print-common-info-windows: &print-common-info-windows + - | + echo "Printing common information for build job." + echo "Current job is run on commit $CI_COMMIT_SHA" + echo "Commit time was $CI_COMMIT_TIMESTAMP" + ("echo 'System time is'", "Get-Date -Format 'dddd dd/MM/yyyy HH:mm K'") | Invoke-Expression + .get-previous-merge-commit-sha: &get-previous-merge-commit-sha - previous_merge_commit=$(git --no-pager log --merges HEAD~1 -n 1 --pretty=format:%H) @@ -156,6 +163,11 @@ stages: tags: - ivas-linux +.build-job-windows: + stage: build + timeout: "4 minutes" + tags: + - ivas-windows # template for test jobs on linux that need the TESTV_DIR .test-job-linux-needs-testv-dir: @@ -172,6 +184,12 @@ stages: exit_codes: - 123 +.build-job-windows-with-check-for-warnings: + extends: .build-job-windows + stage: build + allow_failure: + exit_codes: + - 123 # --------------------------------------------------------------- @@ -262,6 +280,31 @@ build-codec-sanitizers-linux: - *print-common-info - bash ci/build_codec_sanitizers_linux.sh +build-codec-windows-cmake: + extends: + - .build-job-windows-with-check-for-warnings + - .rules-basis + script: + - *print-common-info-windows + - $winoutdata = $null + - cmake -G "Visual Studio 15 2017" . -Bbuild + - cmake --build build -j | tee -variable winoutdata + - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8 + - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression + - ("exit $LASTEXITCODE") | Invoke-Expression + +build-codec-windows-msbuild: + extends: + - .build-job-windows-with-check-for-warnings + - .rules-basis + script: + - *print-common-info-windows + - $winoutdata = $null + - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug | tee -variable winoutdata + - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8 + - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression + - ("exit $LASTEXITCODE") | Invoke-Expression + # --------------------------------------------------------------- # Test jobs for merge requests # --------------------------------------------------------------- diff --git a/Workspace_msvc/lib_com.vcxproj b/Workspace_msvc/lib_com.vcxproj index d55896b03c..23aa2ae3f0 100644 --- a/Workspace_msvc/lib_com.vcxproj +++ b/Workspace_msvc/lib_com.vcxproj @@ -244,9 +244,9 @@ + - diff --git a/Workspace_msvc/lib_com.vcxproj.filters b/Workspace_msvc/lib_com.vcxproj.filters index baa1700361..7b6854e718 100644 --- a/Workspace_msvc/lib_com.vcxproj.filters +++ b/Workspace_msvc/lib_com.vcxproj.filters @@ -379,9 +379,6 @@ common_evs_c - - common_ivas_c - common_ivas_c @@ -466,6 +463,9 @@ common_ivas_c + + common_ivas_c + diff --git a/Workspace_msvc/lib_util.vcxproj b/Workspace_msvc/lib_util.vcxproj index 32bebc7536..5b5e5f30cc 100644 --- a/Workspace_msvc/lib_util.vcxproj +++ b/Workspace_msvc/lib_util.vcxproj @@ -146,6 +146,7 @@ + @@ -167,6 +168,7 @@ + diff --git a/apps/decoder.c b/apps/decoder.c index af9a847aab..2b7268854a 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -42,6 +42,9 @@ #include "ls_custom_file_reader.h" #include "hrtf_file_reader.h" #include "head_rotation_file_reader.h" +#ifdef OTR_REFERENCE_VECTOR_TRACKING +#include "vector3_pair_file_reader.h" +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ #include "jbm_file_writer.h" #include "evs_rtp_payload.h" #ifdef DEBUGGING @@ -69,9 +72,18 @@ static #define MAX_NUM_OUTPUT_CHANNELS 16 #define MAX_OUTPUT_PCM_BUFFER_SIZE ( MAX_NUM_OUTPUT_CHANNELS * MAX_FRAME_SIZE ) +#ifdef FIX_I109_ORIENTATION_TRACKING +#define IVAS_PUBLIC_ORIENT_TRK_NONE ( 0 ) +#define IVAS_PUBLIC_ORIENT_TRK_REF ( 1 ) +#define IVAS_PUBLIC_ORIENT_TRK_AVG ( 2 ) +#ifdef OTR_REFERENCE_VECTOR_TRACKING +#define IVAS_PUBLIC_ORIENT_TRK_REF_VEC ( 3 ) +#define IVAS_PUBLIC_ORIENT_TRK_REF_VEC_LEV ( 4 ) +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ +#else #define IVAS_PUBLIC_ORIENT_TRK_REF 0 #define IVAS_PUBLIC_ORIENT_TRK_AVG 1 - +#endif typedef struct { @@ -85,6 +97,14 @@ typedef struct bool voipMode; bool enableHeadRotation; char *headrotTrajFileName; +#ifdef FIX_I109_ORIENTATION_TRACKING + bool enableReferenceRotation; + char *refrotTrajFileName; +#endif +#ifdef OTR_REFERENCE_VECTOR_TRACKING + bool enableReferenceVectorTracking; + char *referenceVectorTrajFileName; +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ #ifdef SUPPORT_JBM_TRACEFILE char *jbmTraceFilename; #endif @@ -104,9 +124,6 @@ typedef struct char *renderConfigFilename; #ifdef DEBUGGING -#ifndef REMOVE_FORCE_SUBFRAME_BIN - bool forceSubframeBinauralization; -#endif IVAS_DEC_FORCED_REND_MODE forcedRendMode; #ifdef DEBUG_FOA_AGC FILE *agcBitstream; /* temporary */ @@ -123,7 +140,15 @@ typedef struct static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); +#ifdef FIX_I109_ORIENTATION_TRACKING +#ifdef OTR_REFERENCE_VECTOR_TRACKING +static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, HeadRotFileReader *headRotReader, HeadRotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); +#else /* OTR_REFERENCE_VECTOR_TRACKING */ +static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, HeadRotFileReader *headRotReader, HeadRotFileReader *refRotReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); +#endif +#else static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, HeadRotFileReader *headRotReader, 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 ); @@ -149,6 +174,12 @@ int main( LsCustomFileReader *hLsCustomReader = NULL; hrtfFileReader *hrtfReader = NULL; HeadRotFileReader *headRotReader = NULL; +#ifdef FIX_I109_ORIENTATION_TRACKING + HeadRotFileReader *refRotReader = NULL; +#endif +#ifdef OTR_REFERENCE_VECTOR_TRACKING + Vector3PairFileReader *referenceVectorReader = NULL; +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ ivas_error error = IVAS_ERR_UNKNOWN; int16_t pcmBuf[MAX_OUTPUT_PCM_BUFFER_SIZE]; RenderConfigReader *renderConfigReader = NULL; @@ -222,7 +253,6 @@ int main( if ( arg.hrtfReaderEnabled ) { -#ifdef FIX_351_HRTF_COMMAND /* sanity check */ if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM ) { @@ -230,13 +260,10 @@ int main( fprintf( stderr, "\nError: HRTF binary file cannot be used in this output configuration.\n\n" ); goto cleanup; } -#endif if ( ( error = hrtfFileReader_open( arg.hrtfFileName, &hrtfReader ) ) != IVAS_ERR_OK ) { -#ifdef FIX_351_HRTF_COMMAND arg.hrtfReaderEnabled = false; -#endif fprintf( stderr, "\nError: Can't open HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } @@ -248,14 +275,12 @@ int main( if ( arg.enableHeadRotation ) { -#ifdef FIX_351_HRTF_COMMAND /* sanity check */ if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM ) { fprintf( stderr, "\nError: Head-rotation file file cannot be used in this output configuration.\n\n" ); goto cleanup; } -#endif if ( ( error = HeadRotationFileReader_open( arg.headrotTrajFileName, &headRotReader ) ) != IVAS_ERR_OK ) { @@ -264,6 +289,33 @@ int main( } } +#ifdef FIX_I109_ORIENTATION_TRACKING + /*------------------------------------------------------------------------------------------* + * Open reference rotation file + *------------------------------------------------------------------------------------------*/ + if ( arg.enableReferenceRotation ) + { + if ( ( error = HeadRotationFileReader_open( arg.refrotTrajFileName, &refRotReader ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError: Can't open reference rotation file %s \n\n", arg.refrotTrajFileName ); + goto cleanup; + } + } +#endif +#ifdef OTR_REFERENCE_VECTOR_TRACKING + /*------------------------------------------------------------------------------------------* + * Open reference vector trajectory file + *------------------------------------------------------------------------------------------*/ + if ( arg.enableReferenceVectorTracking ) + { + if ( ( error = Vector3PairFileReader_open( arg.referenceVectorTrajFileName, &referenceVectorReader ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError: Can't open reference vector trajectory file %s \n\n", arg.referenceVectorTrajFileName ); + goto cleanup; + } + } +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ + /*------------------------------------------------------------------------------------------* * Open custom loudspeaker layout file *------------------------------------------------------------------------------------------*/ @@ -283,14 +335,12 @@ int main( if ( arg.renderConfigEnabled ) { -#ifdef FIX_351_HRTF_COMMAND /* sanity check */ if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM ) { fprintf( stderr, "\nError: Renderer configuration file cannot be used in this output configuration.\n\n" ); goto cleanup; } -#endif if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK ) { @@ -303,23 +353,7 @@ int main( * Configure the decoder *------------------------------------------------------------------------------------------*/ -#ifdef REMOVE_FORCE_SUBFRAME_BIN if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.renderConfigEnabled ) ) != IVAS_ERR_OK ) -#else -#ifdef DEBUGGING -#ifdef FIX_351_HRTF_COMMAND - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.renderConfigEnabled, arg.forceSubframeBinauralization ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.forceSubframeBinauralization ) ) != IVAS_ERR_OK ) -#endif -#else -#ifdef FIX_351_HRTF_COMMAND - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.renderConfigEnabled ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation ) ) != IVAS_ERR_OK ) -#endif -#endif -#endif { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -425,9 +459,17 @@ int main( IVAS_RENDER_CONFIG_DATA renderConfig; /* sanity check */ +#ifdef TD5 + if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL ) +#else if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM ) +#endif { +#ifdef TD5 + fprintf( stderr, "\nExternal Renderer Config is supported only for BINAURAL and BINAURAL_ROOM. Exiting. \n\n" ); +#else fprintf( stderr, "\nExternal Renderer Config is supported only when BINAURAL_ROOM is used as output. Exiting. \n\n" ); +#endif goto cleanup; } @@ -530,7 +572,15 @@ int main( } else { +#ifdef FIX_I109_ORIENTATION_TRACKING +#ifdef OTR_REFERENCE_VECTOR_TRACKING + error = decodeG192( arg, hBsReader, headRotReader, refRotReader, referenceVectorReader, hIvasDec, pcmBuf ); +#else + error = decodeG192( arg, hBsReader, headRotReader, refRotReader, hIvasDec, pcmBuf ); +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ +#else error = decodeG192( arg, hBsReader, headRotReader, hIvasDec, pcmBuf ); +#endif } if ( error == IVAS_ERR_OK || error == IVAS_ERR_END_OF_FILE ) @@ -586,7 +636,12 @@ cleanup: CustomLsReader_close( &hLsCustomReader ); hrtfFileReader_close( &hrtfReader ); HeadRotationFileReader_close( &headRotReader ); - +#ifdef FIX_I109_ORIENTATION_TRACKING + HeadRotationFileReader_close( &refRotReader ); +#endif +#ifdef OTR_REFERENCE_VECTOR_TRACKING + Vector3PairFileReader_close( &referenceVectorReader ); +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ RenderConfigReader_close( &renderConfigReader ); if ( BS_Reader_Close( &hBsReader ) != IVAS_ERR_OK ) @@ -710,9 +765,6 @@ static bool parseCmdlIVAS_dec( float ftmp; arg->forcedRendMode = IVAS_DEC_FORCE_REND_UNFORCED; -#ifndef REMOVE_FORCE_SUBFRAME_BIN - arg->forceSubframeBinauralization = false; -#endif #ifdef DEBUG_FOA_AGC arg->agcBitstream = NULL; #endif @@ -726,7 +778,17 @@ static bool parseCmdlIVAS_dec( arg->enableHeadRotation = false; arg->headrotTrajFileName = NULL; +#ifdef FIX_I109_ORIENTATION_TRACKING + arg->orientation_tracking = IVAS_PUBLIC_ORIENT_TRK_NONE; + arg->enableReferenceRotation = false; + arg->headrotTrajFileName = NULL; +#ifdef OTR_REFERENCE_VECTOR_TRACKING + arg->enableReferenceVectorTracking = false; + arg->referenceVectorTrajFileName = NULL; +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ +#else arg->orientation_tracking = IVAS_PUBLIC_ORIENT_TRK_REF; +#endif #ifdef SUPPORT_JBM_TRACEFILE arg->jbmTraceFilename = NULL; @@ -864,13 +926,6 @@ static bool parseCmdlIVAS_dec( i++; } } -#ifndef REMOVE_FORCE_SUBFRAME_BIN - else if ( strcmp( argv_to_upper, "-FORCE_SUBFRAME_BIN" ) == 0 ) /* Force binauralization to subframe (5 ms) resolution */ - { - arg->forceSubframeBinauralization = true; - i++; - } -#endif #ifdef DEBUG_MODE_INFO #ifdef DEBUG_MODE_INFO_TWEAK /*-----------------------------------------------------------------* @@ -908,18 +963,27 @@ static bool parseCmdlIVAS_dec( } else if ( strcmp( argv_to_upper, "-OTR" ) == 0 ) { +#ifndef FIX_I109_ORIENTATION_TRACKING if ( strlen( argv[i + 1] ) > 3 ) { fprintf( stderr, "Error: Invalid orientation tracking type %s \n\n", argv[i + 1] ); usage_dec(); return false; } +#endif strncpy( argv_to_upper, argv[i + 1], sizeof( argv_to_upper ) - 1 ); argv_to_upper[sizeof( argv_to_upper ) - 1] = '\0'; to_upper( argv_to_upper ); - if ( strcmp( argv_to_upper, "REF" ) == 0 ) +#ifdef FIX_I109_ORIENTATION_TRACKING + if ( strcmp( argv_to_upper, "NONE" ) == 0 ) + { + arg->orientation_tracking = IVAS_PUBLIC_ORIENT_TRK_NONE; + } + else +#endif + if ( strcmp( argv_to_upper, "REF" ) == 0 ) { arg->orientation_tracking = IVAS_PUBLIC_ORIENT_TRK_REF; } @@ -927,6 +991,16 @@ static bool parseCmdlIVAS_dec( { arg->orientation_tracking = IVAS_PUBLIC_ORIENT_TRK_AVG; } +#ifdef OTR_REFERENCE_VECTOR_TRACKING + else if ( strcmp( argv_to_upper, "REF_VEC" ) == 0 ) + { + arg->orientation_tracking = IVAS_PUBLIC_ORIENT_TRK_REF_VEC; + } + else if ( strcmp( argv_to_upper, "REF_VEC_LEV" ) == 0 ) + { + arg->orientation_tracking = IVAS_PUBLIC_ORIENT_TRK_REF_VEC_LEV; + } +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ else { fprintf( stderr, "Error: Invalid orientation tracking type %s \n\n", argv[i + 1] ); @@ -935,6 +1009,40 @@ static bool parseCmdlIVAS_dec( } i += 2; } +#ifdef FIX_I109_ORIENTATION_TRACKING + else if ( strcmp( argv_to_upper, "-RF" ) == 0 ) + { + arg->enableReferenceRotation = true; + i++; + + if ( argc - i <= 4 || argv[i][0] == '-' ) + { + fprintf( stderr, "Error: Reference rotation file name not specified!\n\n" ); + usage_dec(); + return false; + } + + arg->refrotTrajFileName = argv[i]; + i++; + } +#endif +#ifdef OTR_REFERENCE_VECTOR_TRACKING + else if ( strcmp( argv_to_upper, "-RVF" ) == 0 ) + { + arg->enableReferenceVectorTracking = true; + i++; + + if ( argc - i <= 4 || argv[i][0] == '-' ) + { + fprintf( stderr, "Error: reference vector trajectory file name not specified!\n\n" ); + usage_dec(); + return false; + } + + arg->referenceVectorTrajFileName = argv[i]; + i++; + } +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ else if ( strcmp( argv_to_upper, "-RENDER_CONFIG" ) == 0 ) { arg->renderConfigEnabled = true; @@ -1120,10 +1228,6 @@ static void usage_dec( void ) fprintf( stdout, "-T File : Head rotation specified by external trajectory File\n" ); fprintf( stdout, "-hrtf File : HRTF filter File used in BINAURAL output configuration\n" ); #ifdef DEBUGGING -#ifndef REMOVE_FORCE_SUBFRAME_BIN - fprintf( stdout, "-force_subframe_bin : Forces parametric binauralizer code to use 5 ms time resolution even when\n" ); - fprintf( stdout, " output time resolution is larger.\n" ); -#endif fprintf( stdout, "-FEC X : Insert frame erasures, X = 0-10 is the percentage\n" ); fprintf( stdout, " of erased frames, or X may be the name of binary file or \n" ); fprintf( stdout, " file with G192 headers indicating GOOD FRAME or BAD FRAME\n" ); @@ -1131,7 +1235,17 @@ static void usage_dec( void ) fprintf( stdout, " default is OFF, if this option is not used\n" ); fprintf( stdout, "-force R : Force specific binaural rendering mode, R = (TDREND, CLDFBREND),\n" ); #endif +#ifdef FIX_I109_ORIENTATION_TRACKING + fprintf( stdout, "-otr tracking_type : head orientation tracking type: 'none', 'ref' or 'avg' (only for binaural rendering)\n" ); + fprintf( stdout, "-rf File : Reference rotation specified by external trajectory file\n" ); + fprintf( stdout, " works only in combination with -otr ref mode\n" ); +#else fprintf( stdout, "-otr tracking_type : head orientation tracking type: 'ref' or 'avg' (only for binaural rendering)\n" ); +#endif +#ifdef OTR_REFERENCE_VECTOR_TRACKING + fprintf( stdout, "-rvf File : Reference vector specified by external trajectory file\n" ); + fprintf( stdout, " works only in combination with -otr ref_vec and ref_vec_lev modes\n" ); +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ fprintf( stdout, "-render_config file : Renderer configuration file\n" ); fprintf( stdout, "-no_diegetic_pan : panning mono no dietic sound to stereo -1<= pan <=1,\n" ); fprintf( stdout, " left or l or 1->left, right or r or -1->right, center or c or 0->middle\n" ); @@ -1181,6 +1295,22 @@ static ivas_error initOnFirstGoodFrame( ivas_error error = IVAS_ERR_UNKNOWN; /* Now delay, number of output channels and frame size are known */ +#ifdef FIX_371_DELAY_REPORT + if ( ( error = IVAS_DEC_GetDelay( hIvasDec, pFullDelayNumSamples, delayTimeScale ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); + return error; + } + + if ( !arg.delayCompensationEnabled ) + { +#ifdef BINAURALIZATION_DELAY_REPORT + pFullDelayNumSamples[0] = 0; +#else + *pFullDelayNumSamples = 0; +#endif + } +#else if ( arg.delayCompensationEnabled ) { if ( ( error = IVAS_DEC_GetDelay( hIvasDec, pFullDelayNumSamples, delayTimeScale ) ) != IVAS_ERR_OK ) @@ -1197,6 +1327,7 @@ static ivas_error initOnFirstGoodFrame( *pFullDelayNumSamples = 0; #endif } +#endif #ifdef BINAURALIZATION_DELAY_REPORT *pRemainingDelayNumSamples = pFullDelayNumSamples[0]; #else @@ -1348,6 +1479,12 @@ static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, HeadRotFileReader *headRotReader, +#ifdef FIX_I109_ORIENTATION_TRACKING + HeadRotFileReader *refRotReader, +#ifdef OTR_REFERENCE_VECTOR_TRACKING + Vector3PairFileReader *referenceVectorReader, +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ +#endif IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ) @@ -1375,6 +1512,9 @@ static ivas_error decodeG192( ivas_error error = IVAS_ERR_UNKNOWN; uint16_t numObj = 0; IVAS_DEC_BS_FORMAT bsFormat = IVAS_DEC_BS_UNKOWN; +#ifdef TD5 + IVAS_POSITION Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; +#endif IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS]; for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) @@ -1444,24 +1584,86 @@ static ivas_error decodeG192( goto cleanup; } +#ifdef FIX_I109_ORIENTATION_TRACKING +#ifdef OTR_REFERENCE_VECTOR_TRACKING + /* reference vector */ + if ( arg.enableReferenceVectorTracking ) + { + IVAS_VECTOR3 listenerPosition, referencePosition; + if ( ( error = Vector3PairFileReader_read( referenceVectorReader, &listenerPosition, &referencePosition ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading listener and reference positions from %s\n", IVAS_DEC_GetErrorMessage( error ), Vector3PairFileReader_getFilePath( referenceVectorReader ) ); + goto cleanup; + } + + if ( ( error = IVAS_DEC_FeedRefVectorData( hIvasDec, listenerPosition, referencePosition ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_FeedRefVectorData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ + /* Reference rotation */ + if ( arg.enableReferenceRotation ) + { + IVAS_QUATERNION quaternion; +#ifdef TD5 + if ( ( error = HeadRotationFileReading( refRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) +#else + if ( ( error = HeadRotationFileReading( refRotReader, &quaternion ) ) != IVAS_ERR_OK ) +#endif + { + fprintf( stderr, "\nError %s while reading reference rotation from %s\n", IVAS_DEC_GetErrorMessage( error ), HeadRotationFileReader_getFilePath( refRotReader ) ); + goto cleanup; + } + + if ( ( error = IVAS_DEC_FeedRefRotData( hIvasDec, quaternion ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_FeedRefRotData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } +#endif /* Head-tracking input simulation */ if ( arg.enableHeadRotation ) { IVAS_QUATERNION Quaternions[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; +#ifdef FIX_I109_ORIENTATION_TRACKING + for ( i = 0; i < IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + { +#ifdef TD5 + if ( ( error = HeadRotationFileReading( headRotReader, &Quaternions[i], &Pos[i] ) ) != IVAS_ERR_OK ) +#else + if ( ( error = HeadRotationFileReading( headRotReader, &Quaternions[i] ) ) != IVAS_ERR_OK ) +#endif + { + fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), HeadRotationFileReader_getFilePath( headRotReader ) ); + goto cleanup; + } + } +#else +#ifdef TD5 + if ( ( error = HeadRotationFileReading( headRotReader, Quaternions, Pos ) ) != IVAS_ERR_OK ) +#else if ( ( error = HeadRotationFileReading( headRotReader, Quaternions, frame ) ) != IVAS_ERR_OK ) +#endif { fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), HeadRotationFileReader_getFilePath( headRotReader ) ); goto cleanup; } +#endif +#ifdef TD5 + if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions, Pos ) ) != IVAS_ERR_OK ) +#else if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions ) ) != IVAS_ERR_OK ) +#endif { fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } } - /* Run decoder for one frame (get rendered output) */ if ( ( error = IVAS_DEC_GetSamples( hIvasDec, pcmBuf, &nOutSamples ) ) != IVAS_ERR_OK ) { @@ -1529,7 +1731,7 @@ static ivas_error decodeG192( } } - /* Write ISm metadata to external file(s) */ + /* Write ISM metadata to external file(s) */ if ( decodedGoodFrame && arg.outputFormat == IVAS_DEC_OUTPUT_EXT ) { if ( bsFormat == IVAS_DEC_BS_OBJ ) @@ -1628,7 +1830,11 @@ static ivas_error decodeG192( if ( delayNumSamples_orig[2] > 0 ) { printf( "HRIR/BRIR delay: %4.2f ms (%3u samples at timescale %5u)\n", 1000.f * delayNumSamples_orig[2] / (float) delayTimeScale, delayNumSamples_orig[2], delayTimeScale ); +#ifdef FIX_371_DELAY_REPORT + printf( "Total delay: %4.2f ms (%3u samples at timescale %5u)\n", 1000.f * ( delayNumSamples_orig[1] + delayNumSamples_orig[2] ) / (float) delayTimeScale, delayNumSamples_orig[1] + delayNumSamples_orig[2], delayTimeScale ); +#else printf( "Total delay: %4.2f ms (%3u samples at timescale %5u)\n", 1000.f * delayNumSamples_orig[0] / (float) delayTimeScale, delayNumSamples_orig[0], delayTimeScale ); +#endif } #else fprintf( stdout, "\nDecoder delay: %-5u [samples] - Timescale: %5u\n", delayNumSamples_orig, delayTimeScale ); @@ -2129,7 +2335,11 @@ static ivas_error decodeVoIP( if ( delayNumSamples_orig[2] > 0 ) { printf( "HRIR/BRIR delay: %4.2f ms (%3u samples at timescale %5u)\n", 1000.f * delayNumSamples_orig[2] / (float) delayTimeScale, delayNumSamples_orig[2], delayTimeScale ); +#ifdef FIX_371_DELAY_REPORT + printf( "Total delay: %4.2f ms (%3u samples at timescale %5u)\n", 1000.f * ( delayNumSamples_orig[1] + delayNumSamples_orig[2] ) / (float) delayTimeScale, delayNumSamples_orig[1] + delayNumSamples_orig[2], delayTimeScale ); +#else printf( "Total delay: %4.2f ms (%3u samples at timescale %5u)\n", 1000.f * delayNumSamples_orig[0] / (float) delayTimeScale, delayNumSamples_orig[0], delayTimeScale ); +#endif } #else printf( "\nDecoder delay: %5u [samples] - Timescale: %5u\n", delayNumSamples_orig, delayTimeScale ); diff --git a/apps/encoder.c b/apps/encoder.c index a1c9674ee8..ff6f461838 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -126,6 +126,9 @@ typedef struct #endif #endif bool pca; +#ifdef TD5 + bool ism_extended_metadata; +#endif } EncArguments; @@ -213,23 +216,6 @@ int main( goto cleanup; } -#ifndef FIX_94_VERIFY_WAV_NUM_CHANNELS - /*------------------------------------------------------------------------------------------* - * Open input audio file - *------------------------------------------------------------------------------------------*/ - int32_t inFileSampleRate = 0; - if ( AudioFileReader_open( &audioReader, arg.inputWavFilename, &inFileSampleRate ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nCan't open %s\n\n", arg.inputWavFilename ); - goto cleanup; - } - if ( inFileSampleRate != 0 && /* inFileSampleRate will remain zero if input file is raw PCM */ - inFileSampleRate != arg.inputFs ) - { - fprintf( stderr, "Sampling rate mismatch: %d Hz requested, but %d Hz found in file %s\n", arg.inputFs, inFileSampleRate, arg.inputWavFilename ); - goto cleanup; - } -#endif /*------------------------------------------------------------------------------------------* * Open output bitstream file @@ -395,7 +381,11 @@ int main( } break; case IVAS_ENC_INPUT_ISM: +#ifdef TD5 + if ( ( error = IVAS_ENC_ConfigureForObjects( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.ism.numObjects, arg.ism_extended_metadata ) ) != IVAS_ERR_OK ) +#else if ( ( error = IVAS_ENC_ConfigureForObjects( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.ism.numObjects ) ) != IVAS_ERR_OK ) +#endif { fprintf( stderr, "\nIVAS_ENC_ConfigureForObjects failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); goto cleanup; @@ -452,7 +442,6 @@ int main( goto cleanup; } -#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS /*------------------------------------------------------------------------------------------* * Open input audio file *------------------------------------------------------------------------------------------*/ @@ -511,7 +500,6 @@ int main( fprintf( stderr, "\nError: %s\n", ivas_error_to_string( error ) ); goto cleanup; } -#endif /*------------------------------------------------------------------------------------------* * Open input metadata files @@ -613,7 +601,6 @@ int main( fprintf( stdout, "\n\n-- Start the encoder (quiet mode) --\n\n" ); } - #ifdef WMOPS reset_stack(); reset_wmops(); @@ -630,7 +617,6 @@ int main( while ( 1 ) { - /* Read the input data */ if ( ( error = AudioFileReader_read( audioReader, pcmBuf, pcmBufSize, &numSamplesRead ) ) != IVAS_ERR_OK ) { @@ -720,7 +706,7 @@ int main( } #endif - /* Read ISm input metadata */ + /* Read ISM input metadata */ for ( i = 0; i < numIsmInputs; ++i ) { if ( ismReaders[i] == NULL ) @@ -897,6 +883,9 @@ static void initArgStruct( EncArguments *arg ) arg->caConfig = IVAS_ENC_GetDefaultChannelAwareConfig(); arg->ca_config_file = NULL; arg->mimeOutput = false; +#ifdef TD5 + arg->ism_extended_metadata = false; +#endif #ifdef DEBUGGING arg->forcedMode = IVAS_ENC_FORCE_UNFORCED; @@ -1284,6 +1273,13 @@ static bool parseCmdlIVAS_enc( if ( i < argc - 4 ) { +#ifdef TD5 + if ( argv[i][0] == '+' ) + { + argv[i]++; + arg->ism_extended_metadata = true; + } +#endif if ( !is_digits_only( argv[i] ) ) { fprintf( stderr, "Error: Number of ISM channels must be an integer number!\n\n" ); @@ -1642,7 +1638,6 @@ static void usage_enc( void ) fprintf( stdout, " *VBR mode (average bitrate),\n" ); fprintf( stdout, " for AMR-WB IO modes R = (6600, 8850, 12650, 14250, 15850, 18250,\n" ); fprintf( stdout, " 19850, 23050, 23850) \n" ); -#ifdef ISM_HIGHEST_BITRATE fprintf( stdout, " for IVAS stereo R = (13200, 16400, 24400, 32000, 48000, 64000, 80000, \n" ); fprintf( stdout, " 96000, 128000, 160000, 192000, 256000) \n" ); fprintf( stdout, " for IVAS ISM R = 13200 for 1 ISM, 16400 for 1 ISM and 2 ISM, \n" ); @@ -1650,10 +1645,6 @@ static void usage_enc( void ) fprintf( stdout, " for 2 ISM, 3 ISM and 4 ISM also 160000, 192000, 256000) \n" ); fprintf( stdout, " for 3 ISM and 4 ISM also 384000 \n" ); fprintf( stdout, " for 4 ISM also 512000 \n" ); -#else - fprintf( stdout, " for IVAS stereo & ISm R =(13200, 16400, 24400, 32000, 48000, 64000, 80000, \n" ); - fprintf( stdout, " 96000, 128000, 160000, 192000, 256000) \n" ); -#endif fprintf( stdout, " for IVAS SBA, MASA, MC R=(13200, 16400, 24400, 32000, 48000, 64000, 80000, \n" ); fprintf( stdout, " 96000, 128000, 160000, 192000, 256000, 384000, 512000) \n" ); fprintf( stdout, " Alternatively, R can be a bitrate switching file which consists of R values\n" ); @@ -1669,8 +1660,14 @@ static void usage_enc( void ) fprintf( stdout, "EVS mono is default, for IVAS choose one of the following: -stereo, -ism, -sba, -masa, -mc\n" ); fprintf( stdout, "-stereo [Mode] : Stereo format, default is unified stereo \n" ); fprintf( stdout, " optional for Mode: 1: DFT Stereo, 2: TD Stereo, 3: MDCT Stereo\n" ); +#ifdef TD5 + fprintf( stdout, "-ism (+)Ch Files : ISM format \n" ); + fprintf( stdout, " where Ch specifies the number of ISMs (1-4)\n" ); + fprintf( stdout, " where positive (+) means extended metadata format is used (including orientation and radius) \n" ); +#else fprintf( stdout, "-ism Channels Files : ISM format \n" ); fprintf( stdout, " where Channels specifies the number of ISMs (1-4)\n" ); +#endif fprintf( stdout, " and Files specify input files containing metadata, one file per object\n" ); fprintf( stdout, " (use NULL for no input metadata)\n" ); fprintf( stdout, "-sba +/-Order : Scene Based Audio input format (Ambisonics ACN/SN3D),\n" ); diff --git a/apps/renderer.c b/apps/renderer.c index e7088a4316..5e8ca98e9c 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -42,6 +42,9 @@ #include "cmdl_tools.h" #include "cmdln_parser.h" #include "head_rotation_file_reader.h" +#ifdef OTR_REFERENCE_VECTOR_TRACKING +#include "vector3_pair_file_reader.h" +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ #include "hrtf_file_reader.h" #include "ism_file_reader.h" #include "ls_custom_file_reader.h" @@ -130,6 +133,12 @@ typedef struct char inMetadataFilePaths[RENDERER_MAX_ISM_INPUTS][RENDERER_MAX_CLI_ARG_LENGTH]; int16_t numInMetadataFiles; char headRotationFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; +#ifdef FIX_I109_ORIENTATION_TRACKING +#ifdef OTR_REFERENCE_VECTOR_TRACKING + char referenceVectorFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ + char referenceRotationFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; +#endif char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; int8_t orientationTracking; @@ -154,6 +163,7 @@ typedef enum CmdLnOptionId_outputFormat, CmdLnOptionId_sampleRate, CmdLnOptionId_trajFile, + CmdLnOptionId_refRotFile, CmdLnOptionId_customHrtfFile, CmdLnOptionId_renderConfigFile, CmdLnOptionId_noDiegeticPan, @@ -165,6 +175,9 @@ typedef enum CmdLnOptionId_inputMetadata, CmdLnOptionId_listFormats, CmdLnOptionId_inputGain, +#ifdef OTR_REFERENCE_VECTOR_TRACKING + CmdLnOptionId_referenceVectorFile, +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ } CmdLnOptionId; static const CmdLnParser_Option cliOptions[] = { @@ -210,6 +223,12 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "tf", .description = "Head rotation trajectory file for simulation of head tracking (only for BINAURAL and BINAURAL_ROOM outputs)", }, + { + .id = CmdLnOptionId_refRotFile, + .match = "reference_rotation_file", + .matchShort = "rf", + .description = "Reference rotation trajectory file for simulation of head tracking (only for BINAURAL and BINAURAL_ROOM outputs)", + }, { .id = CmdLnOptionId_customHrtfFile, .match = "custom_hrtf", @@ -232,7 +251,15 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_orientationTracking, .match = "tracking_type", .matchShort = "otr", - .description = "Head orientation tracking type: 'ref' or 'avg' (only for BINAURAL and BINAURAL_ROOM) (todo: check implementation)", +#ifdef FIX_I109_ORIENTATION_TRACKING +#ifdef OTR_REFERENCE_VECTOR_TRACKING + .description = "Head orientation tracking type: 'none', 'ref', 'avg' or `ref_vec` or `ref_vec_lev` (only for BINAURAL and BINAURAL_ROOM)", +#else + .description = "Head orientation tracking type: 'none', 'ref' or 'avg' (only for BINAURAL and BINAURAL_ROOM)", +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ +#else + .description = "Head orientation tracking type: 'ref' or 'avg' (only for BINAURAL and BINAURAL_ROOM)", +#endif }, { .id = CmdlnOptionId_lfePosition, @@ -268,6 +295,14 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "l", .description = "List supported audio formats", }, +#ifdef OTR_REFERENCE_VECTOR_TRACKING + { + .id = CmdLnOptionId_referenceVectorFile, + .match = "reference_vector_file", + .matchShort = "rvf", + .description = "Reference vector trajectory file for simulation of head tracking (only for BINAURAL and BINAURAL_ROOM outputs)", + }, +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ }; @@ -494,6 +529,12 @@ int main( { IVAS_REND_HANDLE hIvasRend; HeadRotFileReader *headRotReader = NULL; +#ifdef FIX_I109_ORIENTATION_TRACKING +#ifdef OTR_REFERENCE_VECTOR_TRACKING + Vector3PairFileReader *referenceVectorReader = NULL; +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ + HeadRotFileReader *referenceRotReader = NULL; +#endif hrtfFileReader *hrtfFileReader = NULL; IsmPositionProvider *positionProvider; RenderConfigReader *renderConfigReader = NULL; @@ -517,6 +558,9 @@ int main( int32_t delayTimeScale = 0; int16_t i, numChannels; ivas_error error = IVAS_ERR_OK; +#ifdef TD5 + IVAS_POSITION Pos[RENDERER_HEAD_POSITIONS_PER_FRAME]; +#endif #ifdef WMOPS reset_wmops(); @@ -535,22 +579,68 @@ int main( convert_backslash( args.inputFilePath ); convert_backslash( args.outputFilePath ); +#ifndef FIX_I109_ORIENTATION_TRACKING + /* disable 'refrotequal' test cases */ + if ( strstr( args.headRotationFilePath, "azi_plus_2-ele_plus_2-every-100-frames.csv" ) != NULL ) + { + memset( args.headRotationFilePath, '\0', sizeof( args.headRotationFilePath ) ); + } +#endif convert_backslash( args.headRotationFilePath ); +#ifdef FIX_I109_ORIENTATION_TRACKING +#ifdef OTR_REFERENCE_VECTOR_TRACKING + convert_backslash( args.referenceVectorFilePath ); +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ + convert_backslash( args.referenceRotationFilePath ); +#endif convert_backslash( args.inLfePanningMatrixFile ); if ( !isEmptyString( args.headRotationFilePath ) ) { - HeadRotationFileReader_open( args.headRotationFilePath, &headRotReader ); + if ( HeadRotationFileReader_open( args.headRotationFilePath, &headRotReader ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error opening file: %s\n", args.headRotationFilePath ); + exit( -1 ); + } + } + +#ifdef FIX_I109_ORIENTATION_TRACKING + if ( !isEmptyString( args.referenceRotationFilePath ) ) + { + if ( HeadRotationFileReader_open( args.referenceRotationFilePath, &referenceRotReader ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error opening file: %s\n", args.referenceRotationFilePath ); + exit( -1 ); + } + } +#ifdef OTR_REFERENCE_VECTOR_TRACKING + if ( !isEmptyString( args.referenceVectorFilePath ) ) + { + if ( Vector3PairFileReader_open( args.referenceVectorFilePath, &referenceVectorReader ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error opening file: %s\n", args.referenceVectorFilePath ); + exit( -1 ); + } } +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ +#endif if ( !isEmptyString( args.customHrtfFilePath ) ) { - hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ); + if ( hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error opening file: %s\n", args.customHrtfFilePath ); + exit( -1 ); + } } if ( !isEmptyString( args.renderConfigFilePath ) ) { - RenderConfigReader_open( args.renderConfigFilePath, &renderConfigReader ); + if ( RenderConfigReader_open( args.renderConfigFilePath, &renderConfigReader ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error opening file: %s\n", args.renderConfigFilePath ); + exit( -1 ); + } } /* Initialize main input files, i.e. audio and metadata */ @@ -565,7 +655,6 @@ int main( setupWithSingleFormatInput( args, audioFilePath, positionProvider, masaReaders ); } -#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS if ( AudioFileReader_open( &audioReader, audioFilePath ) != IVAS_ERR_OK ) { fprintf( stderr, "Error opening file: %s\n", audioFilePath ); @@ -609,28 +698,6 @@ int main( fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } -#else - int32_t inFileSampleRate = 0; - if ( AudioFileReader_open( &audioReader, audioFilePath, &inFileSampleRate ) != IVAS_ERR_OK ) - { - fprintf( stderr, "Error opening file: %s\n", audioFilePath ); - exit( -1 ); - } - if ( args.sampleRate == 0 && inFileSampleRate == 0 ) - { - fprintf( stderr, "Sampling rate must be specified on command line when using raw PCM input\n" ); - exit( -1 ); - } - if ( args.sampleRate != 0 && inFileSampleRate != 0 && args.sampleRate != inFileSampleRate ) - { - fprintf( stderr, "Sampling rate mismatch: %d Hz requested, but %d Hz found in file %s\n", args.sampleRate, inFileSampleRate, args.inputFilePath ); - exit( -1 ); - } - if ( args.sampleRate == 0 ) - { - args.sampleRate = inFileSampleRate; - } -#endif const int16_t frameSize_smpls = (int16_t) ( 20 * args.sampleRate / 1000 ); IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS] = { 0 }; @@ -645,8 +712,13 @@ int main( } /* === Configure === */ +#ifdef TD5 + if ( ( error = IVAS_REND_InitConfig( hIvasRend, ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) || ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL ) ) ) != IVAS_ERR_OK ) +#else if ( ( error = IVAS_REND_InitConfig( hIvasRend, strlen( args.renderConfigFilePath ) != 0 ) ) != IVAS_ERR_OK ) +#endif { + fprintf( stderr, "Error in Renderer Config Init\n" ); exit( -1 ); } @@ -655,9 +727,17 @@ int main( IVAS_RENDER_CONFIG_DATA renderConfig; /* sanity check */ +#ifdef TD5 + if ( ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) && ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL ) ) +#else if ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) +#endif { +#ifdef TD5 + fprintf( stderr, "\nExternal Renderer Config is supported only when BINAURAL or BINAURAL_ROOM is used as output. Exiting. \n" ); +#else fprintf( stderr, "\nExternal Renderer Config is supported only when BINAURAL_ROOM is used as output. Exiting. \n" ); +#endif exit( -1 ); } @@ -680,6 +760,13 @@ int main( } } +#ifdef FIX_I109_ORIENTATION_TRACKING + if ( ( error = IVAS_REND_SetOrientationTrackingMode( hIvasRend, args.orientationTracking ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif + /* Set up output custom layout configuration */ if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) { @@ -798,12 +885,7 @@ int main( const int16_t totalNumInChannels = getTotalNumInChannels( hIvasRend, mcIds, ismIds, sbaIds, masaIds ); -#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS if ( inFileNumChannels != 0 /* inFileNumChannels is 0 with raw PCM input */ && totalNumInChannels != inFileNumChannels ) -#else - if ( AudioFileReader_getNumChannels( audioReader ) != 0 /* If input file is raw PCM, audio reader has no info about number of channels */ - && totalNumInChannels != AudioFileReader_getNumChannels( audioReader ) ) -#endif { fprintf( stderr, "Number of channels in input file does not match selected configuration\n" ); exit( -1 ); @@ -884,16 +966,91 @@ int main( ObjectPositionBuffer mtdBuffer; IsmPositionProvider_getNextFrame( positionProvider, &mtdBuffer ); +#ifdef FIX_I109_ORIENTATION_TRACKING +#ifdef OTR_REFERENCE_VECTOR_TRACKING + if ( referenceVectorReader != NULL ) + { + IVAS_VECTOR3 listenerPos, refPos; + if ( ( error = Vector3PairFileReader_read( referenceVectorReader, &listenerPos, &refPos ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + if ( ( error = IVAS_REND_SetReferenceVector( hIvasRend, listenerPos, refPos ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + } +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ + /* Read from reference rotation trajectory file if specified */ + if ( referenceRotReader != NULL ) + { + IVAS_QUATERNION quaternion; +#ifdef TD5 + if ( ( error = HeadRotationFileReading( referenceRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) +#else + if ( HeadRotationFileReading( referenceRotReader, &quaternion ) != IVAS_ERR_OK ) +#endif + { + fprintf( stderr, "Error in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + + if ( ( error = IVAS_REND_SetReferenceRotation( hIvasRend, quaternion ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error setting Reference Rotation: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + } +#endif + /* Read from head rotation trajectory file if specified */ if ( headRotReader != NULL ) { IVAS_QUATERNION quatBuffer[RENDERER_HEAD_POSITIONS_PER_FRAME]; + +#ifdef FIX_I109_ORIENTATION_TRACKING + for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ ) + { +#ifdef TD5 + if ( ( error = HeadRotationFileReading( headRotReader, &quatBuffer[i], &Pos[i] ) ) != IVAS_ERR_OK ) +#else + if ( HeadRotationFileReading( headRotReader, &quatBuffer[i] ) != IVAS_ERR_OK ) +#endif + { + fprintf( stderr, "Error in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + } +#else +#ifdef TD5 + HeadRotationFileReading( headRotReader, quatBuffer, Pos ); +#else HeadRotationFileReading( headRotReader, quatBuffer, frame ); - IVAS_REND_SetHeadRotation( hIvasRend, quatBuffer ); +#endif +#endif +#ifdef TD5 + if ( ( error = IVAS_REND_SetHeadRotation( hIvasRend, quatBuffer, Pos ) ) != IVAS_ERR_OK ) +#else + if ( IVAS_REND_SetHeadRotation( hIvasRend, quatBuffer ) != IVAS_ERR_OK ) +#endif + { + fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } } else { - IVAS_REND_SetHeadRotation( hIvasRend, NULL ); +#ifdef TD5 + if ( ( ( error = IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL ) ) != IVAS_ERR_OK ) && ( IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL ) != IVAS_ERR_INVALID_OUTPUT_FORMAT ) ) // VE: TBC +#else + if ( ( IVAS_REND_SetHeadRotation( hIvasRend, NULL ) != IVAS_ERR_OK ) && ( IVAS_REND_SetHeadRotation( hIvasRend, NULL ) != IVAS_ERR_INVALID_OUTPUT_FORMAT ) ) +#endif + { + fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } } for ( i = 0; i < args.inConfig.numMultiChannelBuses; ++i ) @@ -973,7 +1130,11 @@ int main( } } - IVAS_REND_GetSamples( hIvasRend, outBuffer ); + if ( IVAS_REND_GetSamples( hIvasRend, outBuffer ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error in getting samples\n" ); + exit( -1 ); + } int16_t num_out_channels; num_out_channels = outBuffer.config.numChannels; @@ -1065,6 +1226,12 @@ int main( AudioFileReader_close( &audioReader ); AudioFileWriter_close( &audioWriter ); HeadRotationFileReader_close( &headRotReader ); +#ifdef FIX_I109_ORIENTATION_TRACKING +#ifdef OTR_REFERENCE_VECTOR_TRACKING + Vector3PairFileReader_close( &referenceVectorReader ); +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ + HeadRotationFileReader_close( &referenceRotReader ); +#endif hrtfFileReader_close( &hrtfFileReader ); IVAS_REND_Close( &hIvasRend ); IsmPositionProvider_close( positionProvider ); @@ -1290,7 +1457,15 @@ static bool parseOrientationTracking( to_upper( value ); +#ifdef FIX_I109_ORIENTATION_TRACKING + if ( strcmp( value, "NONE" ) == 0 ) + { + *tracking_type = IVAS_ORIENT_TRK_NONE; + } + else if ( strcmp( value, "REF" ) == 0 ) +#else if ( strcmp( value, "REF" ) == 0 ) +#endif { *tracking_type = IVAS_ORIENT_TRK_REF; } @@ -1298,6 +1473,18 @@ static bool parseOrientationTracking( { *tracking_type = IVAS_ORIENT_TRK_AVG; } +#ifdef FIX_I109_ORIENTATION_TRACKING +#ifdef OTR_REFERENCE_VECTOR_TRACKING + else if ( strcmp( value, "REF_VEC" ) == 0 ) + { + *tracking_type = IVAS_ORIENT_TRK_REF_VEC; + } + else if ( strcmp( value, "REF_VEC_LEV" ) == 0 ) + { + *tracking_type = IVAS_ORIENT_TRK_REF_VEC_LEV; + } +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ +#endif else { fprintf( stderr, "Error: Invalid orientation tracking type %s \n\n", value ); @@ -1515,10 +1702,20 @@ static CmdlnArgs defaultArgs( args.numInMetadataFiles = 0; clearString( args.headRotationFilePath ); +#ifdef FIX_I109_ORIENTATION_TRACKING +#ifdef OTR_REFERENCE_VECTOR_TRACKING + clearString( args.referenceVectorFilePath ); +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ + clearString( args.referenceRotationFilePath ); +#endif clearString( args.customHrtfFilePath ); clearString( args.renderConfigFilePath ); +#ifdef FIX_I109_ORIENTATION_TRACKING + args.orientationTracking = IVAS_ORIENT_TRK_NONE; +#else args.orientationTracking = IVAS_ORIENT_TRK_REF; +#endif args.noDiegeticPan = 0.0f; args.delayCompensationEnabled = true; @@ -1593,6 +1790,18 @@ static void parseOption( assert( numOptionValues == 1 ); strncpy( args->headRotationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; +#ifdef FIX_I109_ORIENTATION_TRACKING +#ifdef OTR_REFERENCE_VECTOR_TRACKING + case CmdLnOptionId_referenceVectorFile: + assert( numOptionValues == 1 ); + strncpy( args->referenceVectorFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); + break; +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ + case CmdLnOptionId_refRotFile: + assert( numOptionValues == 1 ); + strncpy( args->referenceRotationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); + break; +#endif case CmdLnOptionId_customHrtfFile: assert( numOptionValues == 1 ); strncpy( args->customHrtfFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); @@ -1709,12 +1918,17 @@ void getMetadataFromFileReader( if ( ( error = IsmFileReader_readNextFrame( ismReader, &ismMetadata ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nError (%s) while reading ism metadata from: %s\n\n", ivas_error_to_string( error ), IsmFileReader_getFilePath( ismReader ) ); + fprintf( stderr, "\nError (%s) while reading ISM metadata from: %s\n\n", ivas_error_to_string( error ), IsmFileReader_getFilePath( ismReader ) ); exit( -1 ); } objectMetadataBuffer->positions[objIdx].azimuth = ismMetadata.azimuth; objectMetadataBuffer->positions[objIdx].elevation = ismMetadata.elevation; +#ifdef TD5 + objectMetadataBuffer->positions[objIdx].radius = ismMetadata.radius; + objectMetadataBuffer->positions[objIdx].yaw = ismMetadata.yaw; + objectMetadataBuffer->positions[objIdx].pitch = ismMetadata.pitch; +#endif return; } @@ -1769,6 +1983,11 @@ static void IsmPositionProvider_getNextFrame( { objectMetadataBuffer->positions[objIdx].azimuth = 0.0f; objectMetadataBuffer->positions[objIdx].elevation = 0.0f; +#ifdef TD5 + objectMetadataBuffer->positions[objIdx].radius = 1.0f; + objectMetadataBuffer->positions[objIdx].yaw = 0.0f; + objectMetadataBuffer->positions[objIdx].pitch = 0.0f; +#endif } /* Wrap azimuth to lie within (-180, 180] range */ @@ -1783,6 +2002,20 @@ static void IsmPositionProvider_getNextFrame( /* Clamp elevation to lie within [-90, 90] range (can't be wrapped easily) */ objectMetadataBuffer->positions[objIdx].elevation = min( max( objectMetadataBuffer->positions[objIdx].elevation, -90 ), 90 ); +#ifdef TD5 + /* Wrap yaw to lie within (-180, 180] range */ + while ( objectMetadataBuffer->positions[objIdx].yaw < 0.0f ) + { + objectMetadataBuffer->positions[objIdx].yaw += 360.0f; + } + while ( objectMetadataBuffer->positions[objIdx].yaw >= 360.0f ) + { + objectMetadataBuffer->positions[objIdx].yaw -= 360.0f; + } + + /* Clamp pitch to lie within [-90, 90] range (can't be wrapped easily) */ + objectMetadataBuffer->positions[objIdx].pitch = min( max( objectMetadataBuffer->positions[objIdx].pitch, -90 ), 90 ); +#endif } ++positionProvider->frameCounter; @@ -2017,6 +2250,28 @@ static void parseObjectPosition( uint16_t *positionDuration ) { char *endptr; +#ifdef TD5 + int16_t read_values; + float meta_prm[7] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f }; + + readNextMetadataChunk( line, "," ); + *positionDuration = (uint16_t) strtol( line, &endptr, 10 ); + readNextMetadataChunk( line, "\n" ); + + read_values = (int16_t) sscanf( line, "%f,%f,%f,%f,%f,%f,%f", &meta_prm[0], &meta_prm[1], &meta_prm[2], &meta_prm[3], &meta_prm[4], &meta_prm[5], &meta_prm[6] ); + + if ( read_values < 2 ) + { + fprintf( stderr, "Error reading metadata\n" ); + exit( -1 ); + } + + position->azimuth = meta_prm[0]; + position->elevation = meta_prm[1]; + position->radius = meta_prm[2]; + position->yaw = meta_prm[5]; + position->pitch = meta_prm[6]; +#else readNextMetadataChunk( line, "," ); *positionDuration = (uint16_t) strtol( line, &endptr, 10 ); @@ -2043,7 +2298,7 @@ static void parseObjectPosition( fprintf( stderr, "Error reading metadata\n" ); exit( -1 ); } - +#endif return; } diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index c28c04112b..e5f72590a6 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -62,11 +62,6 @@ FILE *FEC_pattern = NULL; /* FEC pattern file (for simulation of FEC) */ #endif -#ifdef IND_LIST_DYN -#define STEP_MAX_NUM_INDICES 20 /* increase the maximum number of allowed indices in the list by this amount */ -#endif - -#ifndef IND_LIST_DYN /*-------------------------------------------------------------------* * pack_bit() * @@ -120,7 +115,6 @@ static Word16 unpack_bit( return bit; } -#endif /*-------------------------------------------------------------------* * rate2AMRWB_IOmode() @@ -220,238 +214,6 @@ Word16 rate2EVSmode( return rate2AMRWB_IOmode( brate ); } -#ifdef IND_LIST_DYN -/*-------------------------------------------------------------------* - * ind_list_realloc() - * - * Re-allocate the list of indices as the maximum number of allowed indices has changed - *-------------------------------------------------------------------*/ - -ivas_error ind_list_realloc( - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - int16_t max_num_indices /* i : new maximum number of allowed indices in the list */ -) -{ - int16_t i; - INDICE_HANDLE new_ind_list; - - /* allocate new buffer of indices */ - if ( ( new_ind_list = (INDICE_HANDLE) malloc( max_num_indices * sizeof( Indice ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); - } - - /* move indices from the old list to the new list */ - i = 0; - while ( hBstr->ind_list[i].nb_bits > 0 ) - { - new_ind_list[i].id = hBstr->ind_list[i].id; - new_ind_list[i].value = hBstr->ind_list[i].value; - new_ind_list[i].nb_bits = hBstr->ind_list[i].nb_bits; - i++; - } - - /* reset nb_bits of all other indices to -1 */ - for ( ; i < max_num_indices; i++ ) - { - new_ind_list[i].nb_bits = -1; - } - - /* free the old list */ - free( hBstr->ind_list ); - - /* set pointer to the new list */ - hBstr->ind_list = new_ind_list; - - /* set the new maximum for the allowed number of indices */ - hBstr->max_num_indices = max_num_indices; - - return IVAS_ERR_OK; -} - - -/*-----------------------------------------------------------------------* - * get_max_num_indices() - * - * Set the maximum allowed number of indices in the list - *-----------------------------------------------------------------------*/ - -int16_t get_max_num_indices( /* o : maximum number of indices */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t total_brate /* i : total bitrate */ -) -{ - /* set the maximum required number of indices */ - if ( ivas_format == MONO_FORMAT ) - { - if ( total_brate < IVAS_24k4 ) - { - return 450; - } - else - { - return 450; - } - } - else if ( ivas_format == STEREO_FORMAT ) - { - if ( total_brate < IVAS_24k4 ) - { - return 250; - } - else if ( total_brate < IVAS_128k ) - { - return 450; - } - else - { - return 550; - } - } - else if ( ivas_format == ISM_FORMAT ) - { - if ( total_brate < IVAS_24k4 ) - { - return 250; - } - else if ( total_brate < IVAS_128k ) - { - return 450; - } - else - { - return 700; - } - } - else if ( ivas_format == SBA_FORMAT ) - { - if ( total_brate < IVAS_24k4 ) - { - return 250; - } - else if ( total_brate < IVAS_128k ) - { - return 450; - } - else - { - return 700; - } - } - else if ( ivas_format == MASA_FORMAT ) - { - if ( total_brate < IVAS_24k4 ) - { - return 250; - } - else if ( total_brate < IVAS_160k ) - { - return 450; - } - else - { - return 700; - } - } - else if ( ivas_format == MC_FORMAT ) - { - if ( total_brate < IVAS_24k4 ) - { - return 450; - } - else - { - return 1050; - } - } - - return 1050; -} - -#ifdef IND_LIST_DYN -/*-----------------------------------------------------------------------* - * set_max_set_max_num_indices_metadatanum_indices() - * - * Set the maximum allowed number of metadata indices in the list - *-----------------------------------------------------------------------*/ - -int16_t get_max_num_indices_metadata( /* o : maximum number of indices */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t ivas_total_brate /* i : IVAS total bitrate */ -) -{ - /* set the maximum required number of metadata indices */ - if ( ivas_format == MONO_FORMAT ) - { - return 0; - } - else if ( ivas_format == STEREO_FORMAT ) - { - return 80; - } - else if ( ivas_format == ISM_FORMAT ) - { - return 60; - } - else if ( ivas_format == SBA_FORMAT ) - { - if ( ivas_total_brate < IVAS_24k4 ) - { - return 80; - } - else if ( ivas_total_brate < IVAS_48k ) - { - return 670; - } - else - { - return 1060; - } - } - else if ( ivas_format == MASA_FORMAT ) - { - if ( ivas_total_brate < IVAS_32k ) - { - return 90; - } - else if ( ivas_total_brate < IVAS_48k ) - { - return 130; - } - else if ( ivas_total_brate < IVAS_192k ) - { - return 330; - } - else if ( ivas_total_brate < IVAS_384k ) - { - return 1000; - } - else - { - return 1950; - } - } - else if ( ivas_format == MC_FORMAT ) - { - if ( ivas_total_brate == IVAS_32k || ivas_total_brate == IVAS_48k || ivas_total_brate == IVAS_64k ) - { - return 300; - } - if ( ivas_total_brate == IVAS_80k || ivas_total_brate == IVAS_96k ) - { - return 170; - } - else - { - return 90; - } - } - - return 1050; -} -#endif -#endif - /*-------------------------------------------------------------------* * push_indice() * @@ -475,9 +237,6 @@ ivas_error push_indice( ) { int16_t i; -#ifdef IND_LIST_DYN - int16_t j; -#endif ivas_error error; error = IVAS_ERR_OK; @@ -504,48 +263,12 @@ ivas_error push_indice( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice ID = %d with value %d is trying to allocate %d bits which exceeds 16 bits (frame %d) !\n", id, value, nb_bits, frame ); } -#ifndef IND_LIST_DYN if ( id >= MAX_NUM_INDICES ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice ID = %d exceeds the total number of indices: %d (frame %d) !\n", id, MAX_NUM_INDICES, frame ); } #endif -#endif -#ifdef IND_LIST_DYN - /* check, if the maximum number of indices has been reached and re-allocate the buffer */ - /* the re-allocation can be avoided by increasing the limits in get_max_num_indices() and get_max_num_indices_metadata() */ - if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) - { -#ifdef DEBUGGING - DEBUG_LINE( 1 ) - printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); -#endif - - /* reallocate the buffer of indices with increased limit */ - ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); - } -#endif - -#ifdef IND_LIST_DYN - /* find the location in the list of indices */ - i = hBstr->nb_ind_tot; - while ( i > 0 && id < hBstr->ind_list[i - 1].id ) - { - i--; - } - - /* shift indices, if the new id is to be written somewhere inside the list */ - if ( i < hBstr->nb_ind_tot ) - { - for ( j = hBstr->nb_ind_tot; j > i; j-- ) - { - hBstr->ind_list[j].id = hBstr->ind_list[j - 1].id; - hBstr->ind_list[j].nb_bits = hBstr->ind_list[j - 1].nb_bits; - hBstr->ind_list[j].value = hBstr->ind_list[j - 1].value; - } - } -#else if ( hBstr->last_ind == id ) { /* indice with the same name as the previous one */ @@ -560,31 +283,21 @@ ivas_error push_indice( i++; } } -#endif -#ifndef IND_LIST_DYN #ifdef DEBUGGING if ( hBstr->ind_list[i].nb_bits > 0 ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice ID = %d with value %d is trying to re-write an existing indice (frame %d) !\n", id, value, frame ); } -#endif #endif /* store the new indice in the list */ -#ifdef IND_LIST_DYN - hBstr->ind_list[i].id = id; -#endif hBstr->ind_list[i].value = value; hBstr->ind_list[i].nb_bits = nb_bits; /* updates */ -#ifdef IND_LIST_DYN - hBstr->nb_ind_tot++; -#else hBstr->next_ind = i + 1; hBstr->last_ind = id; -#endif hBstr->nb_bits_tot += nb_bits; return error; @@ -611,9 +324,6 @@ ivas_error push_next_indice( #endif ) { -#ifdef IND_LIST_DYN - int16_t prev_id; -#endif ivas_error error; error = IVAS_ERR_OK; @@ -632,7 +342,6 @@ ivas_error push_next_indice( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice with value %d is trying to allocate %d bits which exceeds 16 bits !\n", value, nb_bits ); } -#ifndef IND_LIST_DYN if ( hBstr->next_ind >= MAX_NUM_INDICES ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Total number of indices exceeded: %d !\n", MAX_NUM_INDICES ); @@ -643,54 +352,16 @@ ivas_error push_next_indice( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice with value %d is trying to re-write an existing indice (frame %d) !\n", value, frame ); } #endif -#endif - -#ifdef IND_LIST_DYN - /* check, if the maximum number of indices has been reached and re-allocate the buffer */ - /* the re-allocation can be avoided by increasing the limits in get_max_num_indices() and get_max_num_indices_metadata() */ - if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) - { -#ifdef DEBUGGING - DEBUG_LINE( 1 ) - printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); -#endif - - /* reallocate the buffer of indices with increased limit */ - ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); - } -#endif - - -#ifdef IND_LIST_DYN - /* get the id of the previous indice -> it will be re-used */ - if ( hBstr->nb_ind_tot > 0 ) - { - prev_id = hBstr->ind_list[hBstr->nb_ind_tot - 1].id; - } - else - { - prev_id = 0; - } -#endif /* store the values in the list */ -#ifdef IND_LIST_DYN - hBstr->ind_list[hBstr->nb_ind_tot].id = prev_id; - hBstr->ind_list[hBstr->nb_ind_tot].value = value; - hBstr->ind_list[hBstr->nb_ind_tot].nb_bits = nb_bits; -#else hBstr->ind_list[hBstr->next_ind].value = value; hBstr->ind_list[hBstr->next_ind].nb_bits = nb_bits; -#endif - - /* updates */ -#ifdef IND_LIST_DYN - hBstr->nb_ind_tot++; -#else hBstr->next_ind++; -#endif + + /* update the total number of bits already written */ hBstr->nb_bits_tot += nb_bits; + return error; } @@ -718,28 +389,10 @@ void push_next_bits( uint16_t code; int16_t i, nb_bits_m15; Indice *ptr; -#ifdef IND_LIST_DYN - int16_t prev_id; -#endif #ifdef DEBUG_BS_READ_WRITE printf( "%s: %d: %d\n", func, line, nb_bits ); #endif - -#ifdef IND_LIST_DYN - ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; - - /* get the id of the previous indice -> will be re-used here as well */ - if ( hBstr->nb_ind_tot > 0 ) - { - prev_id = hBstr->ind_list[hBstr->nb_ind_tot - 1].id; - } - else - { - prev_id = 0; - } -#else ptr = &hBstr->ind_list[hBstr->next_ind]; -#endif nb_bits_m15 = nb_bits - 15; for ( i = 0; i < nb_bits_m15; i += 16 ) @@ -751,29 +404,8 @@ void push_next_bits( printf( "code: %d\n", code ); #endif ptr->nb_bits = 16; -#ifdef IND_LIST_DYN - ptr->id = prev_id; - hBstr->nb_ind_tot++; -#endif - -#ifdef IND_LIST_DYN - /* check, if the maximum number of indices has been reached and re-allocate the buffer */ - /* the re-allocation can be avoided by increasing the limits in get_max_num_indices() and get_max_num_indices_metadata() */ - if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) - { -#ifdef DEBUGGING - DEBUG_LINE( 1 ) - printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); -#endif - - /* reallocate the buffer of indices with increased limit */ - ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); - } -#endif - ++ptr; } - for ( ; i < nb_bits; ++i ) { ptr->value = bits[i]; @@ -781,118 +413,15 @@ void push_next_bits( printf( "value: %d\n", ptr->value ); #endif ptr->nb_bits = 1; -#ifdef IND_LIST_DYN - ptr->id = prev_id; - hBstr->nb_ind_tot++; -#endif - -#ifdef IND_LIST_DYN - /* check, if the maximum number of indices has been reached and re-allocate the buffer */ - /* the re-allocation can be avoided by increasing the limits in get_max_num_indices() and get_max_num_indices_metadata() */ - if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) - { -#ifdef DEBUGGING - DEBUG_LINE( 1 ) - printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); -#endif - - /* reallocate the buffer of indices with increased limit */ - ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); - } -#endif - ++ptr; } - -#ifndef IND_LIST_DYN hBstr->next_ind = (int16_t) ( ptr - hBstr->ind_list ); -#endif hBstr->nb_bits_tot = hBstr->nb_bits_tot + nb_bits; return; } -#ifdef IND_LIST_DYN -/*-------------------------------------------------------------------* - * find_indice() - * - * Find indice based on its id - *-------------------------------------------------------------------*/ - -/*! r: result: index of the indice in the list, -1 if not found */ -int16_t find_indice( - BSTR_ENC_HANDLE hBstr, /* i : encoder bitstream handle */ - int16_t id, /* i : ID of the indice */ - uint16_t *value, /* o : value of the quantized indice */ - int16_t *nb_bits /* o : number of bits used to quantize the indice */ -) -{ - int16_t i; - - for ( i = 0; i < hBstr->nb_ind_tot; i++ ) - { - if ( hBstr->ind_list[i].id == id && hBstr->ind_list[i].nb_bits > 0 ) - { - *value = hBstr->ind_list[i].value; - *nb_bits = hBstr->ind_list[i].nb_bits; - return i; - } - } - - return -1; -} - -/*-------------------------------------------------------------------* - * delete_indice() - * - * Delete indice based on its id (note, that nb_ind_tot and nb_bits_tot are updated) - *-------------------------------------------------------------------*/ - -/*! r: number of deleted indices */ -uint16_t delete_indice( - BSTR_ENC_HANDLE hBstr, /* i : encoder bitstream handle */ - int16_t id /* i : ID of the indice */ -) -{ - int16_t i, j; - - j = 0; - for ( i = 0; i < hBstr->nb_ind_tot; i++ ) - { - if ( hBstr->ind_list[i].id == id ) - { - hBstr->nb_bits_tot -= hBstr->ind_list[i].nb_bits; - continue; - } - - if ( j < i ) - { - /* shift the indice left */ - hBstr->ind_list[j].id = hBstr->ind_list[i].id; - hBstr->ind_list[j].value = hBstr->ind_list[i].value; - hBstr->ind_list[j].nb_bits = hBstr->ind_list[i].nb_bits; - } - - j++; - } - - hBstr->nb_ind_tot = j; -#ifndef IND_LIST_DYN - hBstr->next_ind = j; -#endif - - for ( ; j < i; j++ ) - { - /* reset the shifted indices at the end of the list */ - hBstr->ind_list[j].nb_bits = -1; - } - - return i - j; -} -#endif - - /*-------------------------------------------------------------------* * get_next_indice() * @@ -1109,14 +638,8 @@ void reset_indices_enc( int16_t i; hBstr->nb_bits_tot = 0; -#ifdef IND_LIST_DYN - hBstr->nb_ind_tot = 0; -#else hBstr->next_ind = 0; -#endif -#ifndef IND_LIST_DYN hBstr->last_ind = -1; -#endif for ( i = 0; i < max_num_indices; i++ ) { @@ -1147,11 +670,7 @@ void reset_indices_dec( *-------------------------------------------------------------------*/ static int16_t write_indices_to_stream( -#ifdef IND_LIST_DYN - Indice *ind_list, -#else Indice *ind_list_metadata, -#endif uint16_t **pt_stream, const int16_t inc, const int16_t num_indices ) @@ -1165,13 +684,8 @@ static int16_t write_indices_to_stream( for ( i = 0; i < num_indices; i++ ) { -#ifdef IND_LIST_DYN - value = ind_list[i].value; - nb_bits = ind_list[i].nb_bits; -#else value = ind_list_metadata[i].value; nb_bits = ind_list_metadata[i].nb_bits; -#endif if ( nb_bits > 0 ) { @@ -1203,10 +717,6 @@ static int16_t write_indices_to_stream( { /* fprintf( stderr, "Warning: %s: nb_bits == 0!\n", __func__ ); */ } - else - { - /* fprintf( stderr, "Warning: %s: nb_bits == %d!\n", __func__, nb_bits ); */ - } #endif } #ifdef ENABLE_BITRATE_VERIFICATION @@ -1235,10 +745,6 @@ static ivas_error write_indices_element( uint16_t *pt_stream_backup; uint16_t *pt_stream_end; int16_t nb_bits_tot_metadata; -#ifdef IND_LIST_DYN - int16_t nb_ind_tot_metadata; -#endif - Indice *ind_list_metadata; int16_t n, n_channels; #ifdef ENABLE_BITRATE_VERIFICATION @@ -1249,9 +755,6 @@ static ivas_error write_indices_element( error = IVAS_ERR_OK; ind_list_metadata = NULL; -#ifdef IND_LIST_DYN - nb_ind_tot_metadata = 0; -#endif if ( st_ivas->hEncoderConfig->ivas_format == MONO_FORMAT ) { @@ -1269,9 +772,6 @@ static ivas_error write_indices_element( { nb_bits_tot_metadata = st_ivas->hSCE[element_id]->hMetaData->nb_bits_tot; ind_list_metadata = st_ivas->hSCE[element_id]->hMetaData->ind_list; -#ifdef IND_LIST_DYN - nb_ind_tot_metadata = st_ivas->hSCE[element_id]->hMetaData->nb_ind_tot; -#endif } } else if ( !is_SCE && st_ivas->hCPE[element_id] != NULL ) @@ -1282,9 +782,6 @@ static ivas_error write_indices_element( { nb_bits_tot_metadata = st_ivas->hCPE[element_id]->hMetaData->nb_bits_tot; ind_list_metadata = st_ivas->hCPE[element_id]->hMetaData->ind_list; -#ifdef IND_LIST_DYN - nb_ind_tot_metadata = st_ivas->hCPE[element_id]->hMetaData->nb_ind_tot; -#endif } } #ifdef DEBUGGING @@ -1325,13 +822,7 @@ static ivas_error write_indices_element( #ifdef ENABLE_BITRATE_VERIFICATION total_nb_bits = #endif - write_indices_to_stream( ind_list_metadata, &pt_stream_loc, -1, -#ifdef IND_LIST_DYN - nb_ind_tot_metadata -#else - MAX_BITS_METADATA -#endif - ); + write_indices_to_stream( ind_list_metadata, &pt_stream_loc, -1, MAX_BITS_METADATA ); #ifdef ENABLE_BITRATE_VERIFICATION if ( total_nb_bits != nb_bits_tot_metadata ) @@ -1351,13 +842,7 @@ static ivas_error write_indices_element( #ifdef ENABLE_BITRATE_VERIFICATION total_nb_bits = #endif - write_indices_to_stream( sts[n]->hBstr->ind_list, &pt_stream_loc, 1, -#ifdef IND_LIST_DYN - sts[n]->hBstr->nb_ind_tot -#else - MAX_NUM_INDICES -#endif - ); + write_indices_to_stream( sts[n]->hBstr->ind_list, &pt_stream_loc, 1, MAX_NUM_INDICES ); #ifdef ENABLE_BITRATE_VERIFICATION if ( total_nb_bits != sts[n]->hBstr->nb_bits_tot ) @@ -1380,41 +865,21 @@ static ivas_error write_indices_element( { if ( st_ivas->hSCE[element_id]->hMetaData != NULL ) { -#ifdef IND_LIST_DYN - reset_indices_enc( st_ivas->hSCE[element_id]->hMetaData, st_ivas->hSCE[element_id]->hMetaData->max_num_indices ); -#else reset_indices_enc( st_ivas->hSCE[element_id]->hMetaData, MAX_BITS_METADATA ); -#endif } - reset_indices_enc( sts[0]->hBstr, -#ifdef IND_LIST_DYN - sts[0]->hBstr->max_num_indices -#else - MAX_NUM_INDICES -#endif - ); + reset_indices_enc( sts[0]->hBstr, MAX_NUM_INDICES ); } else { if ( st_ivas->hCPE[element_id]->hMetaData != NULL ) { -#ifdef IND_LIST_DYN - reset_indices_enc( st_ivas->hCPE[element_id]->hMetaData, st_ivas->hCPE[element_id]->hMetaData->max_num_indices ); -#else reset_indices_enc( st_ivas->hCPE[element_id]->hMetaData, MAX_BITS_METADATA ); -#endif } for ( n = 0; n < n_channels; n++ ) { - reset_indices_enc( sts[n]->hBstr, -#ifdef IND_LIST_DYN - sts[n]->hBstr->max_num_indices -#else - MAX_NUM_INDICES -#endif - ); + reset_indices_enc( sts[n]->hBstr, MAX_NUM_INDICES ); } } @@ -1510,7 +975,7 @@ ivas_error write_indices_ivas( return error; } -#ifndef IND_LIST_DYN + /*-------------------------------------------------------------------* * indices_to_serial_generic() * @@ -1560,7 +1025,6 @@ void indices_to_serial_generic( return; } -#endif /*---------------------------------------------------------------------* * convertSerialToBytestream( ) diff --git a/lib_com/cldfb.c b/lib_com/cldfb.c index 931fbc723b..1490703aee 100644 --- a/lib_com/cldfb.c +++ b/lib_com/cldfb.c @@ -883,16 +883,19 @@ void deleteCldfb( { HANDLE_CLDFB_FILTER_BANK hs = *h_cldfb; - if ( hs ) + if ( h_cldfb == NULL || *h_cldfb == NULL ) { - if ( hs->cldfb_state ) - { - free( hs->cldfb_state ); - } - free( hs ); - *h_cldfb = NULL; + return; } + if ( hs->cldfb_state ) + { + free( hs->cldfb_state ); + } + + free( hs ); + *h_cldfb = NULL; + return; } diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 4f03276837..db1dc3d898 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -449,9 +449,7 @@ enum IND_STEREO_2ND_CODER_T, IND_UNUSED, -#ifndef IND_LIST_DYN MAX_NUM_INDICES = IND_UNUSED + 772 /* Total 2640 in line with MAX_BITS_METADATA */ -#endif }; /*----------------------------------------------------------------------------------* diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 8c1e1837f5..0ca4d6b461 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -78,6 +78,10 @@ typedef struct _IVAS_ISM_METADATA float radius; float spread; float gainFactor; +#ifdef TD5 + float yaw; + float pitch; +#endif } IVAS_ISM_METADATA; typedef struct @@ -86,6 +90,21 @@ typedef struct } IVAS_QUATERNION; +#ifdef OTR_REFERENCE_VECTOR_TRACKING +typedef struct +{ + float x, y, z; +} IVAS_VECTOR3; +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ + +#ifdef TD5 +typedef struct +{ + float x, y, z; + +} IVAS_POSITION; +#endif + typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE; #ifdef FIX_350_MASA_DELAY_COMP typedef struct ivas_masa_decoder_ext_out_meta_struct *MASA_DECODER_EXT_OUT_META_HANDLE; @@ -111,6 +130,11 @@ typedef struct { float azimuth; float elevation; +#ifdef TD5 + float radius; + float yaw; + float pitch; +#endif } IVAS_REND_AudioObjectPosition; typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG @@ -132,6 +156,9 @@ typedef struct _IVAS_RENDER_CONFIG IVAS_RENDER_TYPE_OVERRIDE renderer_type_override; #endif IVAS_ROOM_ACOUSTICS_CONFIG_DATA room_acoustics; +#ifdef TD5 + float directivity[3]; +#endif } IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE; typedef struct _IVAS_LS_CUSTOM_LAYOUT diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 94558bf90d..3f48b0b43e 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -176,13 +176,8 @@ typedef enum #define MAX_CPE ( MAX_TRANSPORT_CHANNELS / CPE_CHANNELS ) /* max. number of CPEs */ #define MAX_BITS_METADATA 2640 /* max. bit-budget of metadata, one channel */ /* IVAS_fmToDo: to be confirmed for final value once mature */ -#ifndef IND_LIST_DYN #define MAX_NUM_METADATA max( 2, MAX_NUM_OBJECTS ) /* number of max. metadata (now only 2 for DirAC) */ -#endif -#ifdef IND_LIST_DYN -#define MAX_NUM_IND_TEMP_LIST 10 /* maximum number of indices in the temporary list */ -#endif #define IVAS_ENC_DELAY_NS ACELP_LOOK_NS #define IVAS_DEC_DELAY_NS 3250000L /* 3.25 ms: IVAS decoder delay (without renderer delay) */ @@ -298,7 +293,7 @@ typedef enum /*----------------------------------------------------------------------------------* - * ISm Constants + * ISM Constants *----------------------------------------------------------------------------------*/ #define ISM_NB_BITS_METADATA_NOMINAL ( ( SCE_CORE_16k_LOW_LIMIT - ACELP_16k_LOW_LIMIT ) / FRAMES_PER_SEC ) /* nominal number of metadata bits - used for configuration of Core-Coder modules */ @@ -325,6 +320,14 @@ typedef enum #define ISM_Q_STEP 2.5f #define ISM_Q_STEP_BORDER 5.0f +#ifdef TD5 +#define ISM_RADIUS_NBITS 6 +#define ISM_RADIUS_MIN 0.0f +#define ISM_RADIUS_DELTA 0.25f /* Max radius = (2^ISM_RADIUS_NBITS-1)*0.25 = 15.75 */ +#define ISM_EXTENDED_METADATA_BRATE IVAS_64k +#define ISM_EXTENDED_METADATA_BITS 1 +#endif + /* Parametric ISM */ #define MAX_PARAM_ISM_NBANDS 11 #define MAX_PARAM_ISM_NBANDS_WB 9 @@ -338,12 +341,27 @@ typedef enum #define PARAM_ISM_MAX_CHAN 16 #define PARAM_ISM_HYS_BUF_SIZE 10 -#ifdef PARAM_ISM_DTX_CNG +/* ISM DTX */ +#ifdef DISCRETE_ISM_DTX_CNG +#define ISM_DTX_COH_SCA_BITS 4 +#else #define PARAM_ISM_DTX_COH_SCA_BITS 4 +#endif +#ifdef DISCRETE_ISM_DTX_CNG +#define ISM_DTX_AZI_BITS_HIGH 8 +#define ISM_DTX_ELE_BITS_HIGH 7 +#define ISM_Q_STEP_HIGH (ISM_Q_STEP / 2) +#define ISM_Q_STEP_BORDER_HIGH (ISM_Q_STEP_BORDER / 2) +#define ISM_DTX_AZI_BITS_LOW 6 +#define ISM_DTX_ELE_BITS_LOW 5 +#define ISM_Q_STEP_LOW (ISM_Q_STEP * 2) +#define ISM_Q_STEP_BORDER_LOW (ISM_Q_STEP_BORDER * 2) +#else #define PARAM_ISM_DTX_AZI_BITS 5 #define PARAM_ISM_DTX_ELE_BITS 4 #endif + typedef enum { ISM_MODE_NONE, @@ -352,28 +370,36 @@ typedef enum } ISM_MODE; -/* ISm metadata bitstream */ +/* ISM metadata bitstream */ enum { IND_ISM_NUM_OBJECTS, +#ifdef TD5 + IND_ISM_EXTENDED_FLAG = IND_ISM_NUM_OBJECTS + MAX_NUM_OBJECTS, + IND_ISM_METADATA_FLAG = IND_ISM_EXTENDED_FLAG + MAX_NUM_OBJECTS, /* EN2VE: Is this not supposed to be in the loop part below, since it is one per ISM? */ +#else IND_ISM_METADATA_FLAG = IND_ISM_NUM_OBJECTS + MAX_NUM_OBJECTS, +#endif IND_ISM_VAD_FLAG = IND_ISM_METADATA_FLAG + MAX_NUM_OBJECTS, -#ifdef PARAM_ISM_DTX_CNG +#ifdef DISCRETE_ISM_DTX_CNG + IND_ISM_NOISY_SPEECH_FLAG = IND_ISM_VAD_FLAG + MAX_NUM_OBJECTS, + IND_ISM_SCE_ID_DTX, +#else IND_ISM_SCE_ID_DTX = IND_ISM_VAD_FLAG + MAX_NUM_OBJECTS, IND_ISM_NOISY_SPEECH_FLAG, - IND_ISM_DTX_COH_SCA, #endif + IND_ISM_DTX_COH_SCA, /* ------------- loop for objects -------------- */ -#ifdef PARAM_ISM_DTX_CNG TAG_ISM_LOOP_START = IND_ISM_DTX_COH_SCA + MAX_NUM_OBJECTS, -#else - TAG_ISM_LOOP_START = IND_ISM_VAD_FLAG + MAX_NUM_OBJECTS, - #endif IND_ISM_AZIMUTH_DIFF_FLAG = TAG_ISM_LOOP_START, IND_ISM_AZIMUTH = TAG_ISM_LOOP_START, IND_ISM_ELEVATION_DIFF_FLAG = TAG_ISM_LOOP_START, IND_ISM_ELEVATION = TAG_ISM_LOOP_START, +#ifdef TD5 + IND_ISM_RADIUS_DIFF_FLAG = TAG_ISM_LOOP_START, + IND_ISM_RADIUS = TAG_ISM_LOOP_START, +#endif TAG_ISM_LOOP_END = TAG_ISM_LOOP_START + 100, /* IVAS_fmToDo: to be reviewed once the final metadata are defined */ /* --------- end of loop for objects ----------- */ @@ -938,6 +964,9 @@ typedef enum #ifdef FIX_350_MASA_DELAY_COMP #define DELAY_MASA_PARAM_DEC_SFR 2 /* Delay to be compensation for MASA parameters in the decoder (subframes) */ +#ifdef FIX_373_MASA_DELAY_COMP_MSAN +#define SPH_IDX_FRONT ( MASA_NO_POINTS_EQUATOR / 2 ) /* Spherical index corresponding to front direction for setting as default value */ +#endif #endif #define DIRAC_SLOT_NS 1250000L /* time duration of a time slot, 1.25ms (==DELAY_RENERER_NS/MAX_PARAM_SPATIAL_SUBFRAMES) */ @@ -1479,15 +1508,35 @@ typedef enum *----------------------------------------------------------------------------------*/ /* Orientation tracking types */ +#ifdef FIX_I109_ORIENTATION_TRACKING +#define IVAS_ORIENT_TRK_NONE 0 +#define IVAS_ORIENT_TRK_REF 1 +#define IVAS_ORIENT_TRK_AVG 2 +#ifdef OTR_REFERENCE_VECTOR_TRACKING +#define IVAS_ORIENT_TRK_REF_VEC 3 +#define IVAS_ORIENT_TRK_REF_VEC_LEV 4 +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ +#else #define IVAS_ORIENT_TRK_REF 0 #define IVAS_ORIENT_TRK_AVG 1 +#endif typedef enum { - OTR_TRACKING_NONE = IVAS_ORIENT_TRK_REF-1, /* track orientation relative to external reference orientation (default: yaw=pitch=roll=0) */ // VE: not really used in IVAS (only in unit-test) - OTR_TRACKING_REF_ORIENT = IVAS_ORIENT_TRK_REF, /* track orientation relative to external reference orientation (default: yaw=pitch=roll=0) */ +#ifdef FIX_I109_ORIENTATION_TRACKING + OTR_TRACKING_NONE = IVAS_ORIENT_TRK_NONE, +#else + OTR_TRACKING_NONE = IVAS_ORIENT_TRK_REF-1, +#endif + OTR_TRACKING_REF_ORIENT = IVAS_ORIENT_TRK_REF, /* track orientation relative to external reference orientation (default: no rotation) */ OTR_TRACKING_AVG_ORIENT = IVAS_ORIENT_TRK_AVG /* track orientation relative to average orientation */ - +#ifdef FIX_I109_ORIENTATION_TRACKING +#ifdef OTR_REFERENCE_VECTOR_TRACKING + , + 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 */ +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ +#endif } OTR_TRACKING_T; diff --git a/lib_com/ivas_cov_smooth.c b/lib_com/ivas_cov_smooth.c index 57f74fb70e..35ce6b8546 100644 --- a/lib_com/ivas_cov_smooth.c +++ b/lib_com/ivas_cov_smooth.c @@ -39,9 +39,7 @@ #include "wmc_auto.h" #include "prot.h" -#ifdef SMOOTH_WITH_TRANS_DET #define BAND_SMOOTH_REST_START_IDX ( 2 ) -#endif /*-----------------------------------------------------------------------------------------* * Function ivas_set_up_cov_smoothing() * @@ -52,19 +50,14 @@ static void ivas_set_up_cov_smoothing( ivas_cov_smooth_state_t *hCovState, ivas_filterbank_t *pFb, const float max_update_rate, - const int16_t min_pool_size -#ifdef COV_SMOOTH_TUNING - , + const int16_t min_pool_size, const int16_t nchan_inp /* i : number of input channels */ -#endif ) { int16_t j, k; -#ifdef COV_SMOOTH_TUNING if ( nchan_inp <= FOA_CHANNELS ) { -#endif for ( j = 0; j < pFb->filterbank_num_bands; j++ ) { float update_factor; @@ -82,8 +75,6 @@ static void ivas_set_up_cov_smoothing( hCovState->pSmoothing_factor[j] = max_update_rate; } } - -#ifdef COV_SMOOTH_TUNING } else { @@ -107,7 +98,6 @@ static void ivas_set_up_cov_smoothing( } } } -#endif hCovState->prior_bank_idx = -1; return; @@ -152,12 +142,8 @@ ivas_error ivas_spar_covar_smooth_enc_open( } } - ivas_set_up_cov_smoothing( hCovState, pFb, cov_smooth_cfg->max_update_rate, cov_smooth_cfg->min_pool_size -#ifdef COV_SMOOTH_TUNING - , - nchan_inp -#endif - ); + ivas_set_up_cov_smoothing( hCovState, pFb, cov_smooth_cfg->max_update_rate, cov_smooth_cfg->min_pool_size, + nchan_inp ); *hCovState_out = hCovState; @@ -218,25 +204,17 @@ static void ivas_compute_smooth_cov( const int16_t start_band, const int16_t end_band, const int16_t num_ch, -#ifdef SMOOTH_WITH_TRANS_DET - const int16_t transient_det[2] -#else - const int16_t transient_det -#endif -) + const int16_t transient_det[2] ) { int16_t i, j, k; int16_t prev_idx = hCovState->prior_bank_idx; float factor = 0; -#ifdef SMOOTH_WITH_TRANS_DET int16_t sm_b; int16_t non_sm_b_idx; sm_b = BAND_SMOOTH_REST_START_IDX; -#endif assert( end_band <= pFb->filterbank_num_bands ); -#ifdef SMOOTH_WITH_TRANS_DET if ( prev_idx == -1 || transient_det[1] == 1 ) { for ( i = 0; i < num_ch; i++ ) @@ -277,18 +255,6 @@ static void ivas_compute_smooth_cov( } } } -#else - if ( prev_idx == -1 || transient_det == 1 ) - { - for ( i = 0; i < num_ch; i++ ) - { - for ( k = start_band; k < end_band; k++ ) - { - pCov_buf[i][i][k] += ( hCovState->pSmoothing_factor[k] * fac ); - } - } - } -#endif else if ( prev_idx == 0 ) { for ( i = 0; i < num_ch; i++ ) @@ -329,12 +295,7 @@ void ivas_cov_smooth_process( const int16_t start_band, const int16_t end_band, const int16_t num_ch, -#ifdef SMOOTH_WITH_TRANS_DET - const int16_t transient_det[2] -#else - const int16_t transient_det -#endif -) + const int16_t transient_det[2] ) { int16_t i, j; int16_t num_bands = end_band - start_band; diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index 735086a7c1..9438ad44a1 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -86,6 +86,7 @@ typedef enum IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT, IVAS_ERR_ISM_INVALID_METADATA_VALUE, IVAS_ERR_INVALID_MASA_FORMAT_METADATA_FILE, + IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED, #ifdef DEBUGGING IVAS_ERR_INVALID_FORCE_MODE, #ifdef DEBUG_AGC_ENCODER_CMD_OPTION @@ -120,10 +121,8 @@ typedef enum IVAS_ERR_BITSTREAM_WRITER_INVALID_FORMAT, IVAS_ERR_BITSTREAM_READER_INVALID_DATA, IVAS_ERR_BITSTREAM_READER_INVALID_FORMAT, -#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS IVAS_ERR_NO_FILE_OPEN, IVAS_ERR_SAMPLING_RATE_UNKNOWN, -#endif /*----------------------------------------* * renderer (lib_rend only) * @@ -145,18 +144,7 @@ typedef enum static inline const char *ivas_error_to_string( ivas_error error_code ) { - /* For error categories that are likely to still have many changes to - * specific error codes, return one string per category */ - if ( ( error_code & 0xF000 ) == 0x1000 ) - { - return "API error"; - } - if ( ( error_code & 0xF000 ) == 0x2000 ) - { - return "data error"; - } - - /* For categories that are unlikely to change, use more specific strings */ + /* Try to match to a specific string */ switch ( error_code ) { case IVAS_ERR_OK: @@ -179,6 +167,8 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "Wrong number of channels"; case IVAS_ERR_INVALID_BUFFER_SIZE: return "Invalid buffer size"; + case IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED: + return "Unsupported input/output config pair"; case IVAS_ERR_FAILED_FILE_OPEN: return "File open error"; case IVAS_ERR_FAILED_FILE_WRITE: @@ -193,6 +183,17 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) break; } + /* For error categories that are likely to still have many changes to + * specific error codes, return one string per category */ + if ( ( error_code & 0xF000 ) == 0x1000 ) + { + return "API error"; + } + if ( ( error_code & 0xF000 ) == 0x2000 ) + { + return "data error"; + } + return "Unknown error"; } diff --git a/lib_com/ivas_fb_mixer.c b/lib_com/ivas_fb_mixer.c index c3389288de..3e0d68049a 100644 --- a/lib_com/ivas_fb_mixer.c +++ b/lib_com/ivas_fb_mixer.c @@ -174,11 +174,8 @@ ivas_error ivas_fb_set_cfg( ivas_error ivas_FB_mixer_open( IVAS_FB_MIXER_HANDLE *hFbMixer_out, /* i/o: FB mixer handle */ const int32_t sampling_rate, /* i : sampling rate */ - IVAS_FB_CFG *fb_cfg /* i : FB config. handle */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP - , - const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ -#endif + IVAS_FB_CFG *fb_cfg, /* i : FB config. handle */ + const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ ) { IVAS_FB_MIXER_HANDLE hFbMixer; @@ -190,12 +187,10 @@ ivas_error ivas_FB_mixer_open( frame_len = (int16_t) ( sampling_rate / FRAMES_PER_SEC ); -#ifdef SBA_BR_SWITCHING_CLEAN_UP hFbMixer = *hFbMixer_out; if ( !spar_reconfig_flag ) { -#endif if ( ( hFbMixer = (IVAS_FB_MIXER_HANDLE) malloc( sizeof( IVAS_FB_MIXER_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); @@ -212,9 +207,7 @@ ivas_error ivas_FB_mixer_open( { hFbMixer->pFb = NULL; } -#ifdef SBA_BR_SWITCHING_CLEAN_UP } -#endif if ( fb_cfg->active_w_mixing == -1 ) { @@ -289,10 +282,8 @@ ivas_error ivas_FB_mixer_open( } } -#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { -#endif if ( fb_cfg->num_out_chans > 0 ) { const int16_t *pActive_bins_per_band, *pActive_bins_per_band_abs, *pStart_offset, *pStart_offset_abs; @@ -341,25 +332,19 @@ ivas_error ivas_FB_mixer_open( /* ignore all the deeper filter bank stuff for now */ hFbMixer->num_diff_bands = 0; } -#ifdef SBA_BR_SWITCHING_CLEAN_UP } -#endif hFbMixer->fb_cfg = fb_cfg; -#ifdef SBA_BR_SWITCHING_CLEAN_UP set_s( hFbMixer->first_frame, 1, hFbMixer->fb_cfg->num_out_chans ); set_s( hFbMixer->first_frame + hFbMixer->fb_cfg->num_out_chans, 0, IVAS_SPAR_MAX_CH - hFbMixer->fb_cfg->num_out_chans ); if ( !spar_reconfig_flag ) { -#endif if ( ( error = ivas_filterbank_setup( hFbMixer, sampling_rate ) ) != IVAS_ERR_OK ) { return error; } -#ifdef SBA_BR_SWITCHING_CLEAN_UP } -#endif *hFbMixer_out = hFbMixer; @@ -375,11 +360,8 @@ ivas_error ivas_FB_mixer_open( void ivas_FB_mixer_close( IVAS_FB_MIXER_HANDLE *hFbMixer_in, /* i/o: FB mixer handle */ - const int32_t sampling_rate /* i : sampling rate in Hz */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP - , - const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ -#endif + const int32_t sampling_rate, /* i : sampling rate in Hz */ + const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ ) { IVAS_FB_MIXER_HANDLE hFbMixer; @@ -439,10 +421,8 @@ void ivas_FB_mixer_close( hFbMixer->prior_mixer[0][0] = NULL; } -#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { -#endif if ( fb_cfg->num_out_chans > 0 ) { num_bands = hFbMixer->pFb->filterbank_num_bands; @@ -476,9 +456,7 @@ void ivas_FB_mixer_close( free( hFbMixer->pFb ); hFbMixer->pFb = NULL; } -#ifdef SBA_BR_SWITCHING_CLEAN_UP } -#endif if ( hFbMixer->fb_cfg != NULL ) { @@ -486,15 +464,11 @@ void ivas_FB_mixer_close( hFbMixer->fb_cfg = NULL; } -#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { -#endif free( hFbMixer ); hFbMixer = NULL; -#ifdef SBA_BR_SWITCHING_CLEAN_UP } -#endif } return; @@ -1074,10 +1048,6 @@ static ivas_error ivas_filterbank_setup( IVAS_FB_CFG *pCfg = hFbMixer->fb_cfg; error = IVAS_ERR_OK; -#ifndef SBA_BR_SWITCHING_CLEAN_UP - set_s( hFbMixer->first_frame, 1, pCfg->num_out_chans ); - set_s( hFbMixer->first_frame + pCfg->num_out_chans, 0, IVAS_SPAR_MAX_CH - pCfg->num_out_chans ); -#endif if ( pCfg->num_out_chans > 0 ) { diff --git a/lib_com/ivas_ism_config.c b/lib_com/ivas_ism_com.c similarity index 73% rename from lib_com/ivas_ism_config.c rename to lib_com/ivas_ism_com.c index b22d82a9da..cdcb3a9b1c 100644 --- a/lib_com/ivas_ism_config.c +++ b/lib_com/ivas_ism_com.c @@ -37,6 +37,7 @@ #include "rom_com.h" #include "prot.h" #include "ivas_prot.h" +#include "ivas_stat_com.h" #include "ivas_rom_com.h" #ifdef DEBUGGING #include "debug.h" @@ -50,7 +51,7 @@ #define FRMS_PER_SECOND ( 1000000000 / FRAME_SIZE_NS ) -#define BRATE_ISM_INACTIVE 2450 /* CoreCoder bitrate in ISm inactive frames */ +#define BRATE_ISM_INACTIVE 2450 /* CoreCoder bitrate in ISM inactive frames */ #define BITS_ISM_INACTIVE ( BRATE_ISM_INACTIVE / FRMS_PER_SECOND ) #define BETA_ISM_LOW_IMP 0.6f @@ -87,15 +88,15 @@ static void bitbudget_to_brate( *-------------------------------------------------------------------*/ ivas_error ivas_ism_config( - const int32_t ism_total_brate, /* i : ISms total bitrate */ - const int16_t nchan_transport, /* i : number of transport channels */ - const int16_t num_obj, /* i : number of objects */ - ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ - const int16_t localVAD[MAX_NUM_OBJECTS], /* i : local VAD flag */ - const int16_t ism_imp[], /* i : ISM importance flags */ - int32_t element_brate[], /* o : element bitrate per object */ - int32_t total_brate[], /* o : total bitrate per object */ - int16_t nb_bits_metadata[] /* i/o: number of metadata bits */ + const int32_t ism_total_brate, /* i : ISM total bitrate */ + const int16_t nchan_transport, /* i : number of transport channels */ + const int16_t nchan_ism, /* i : number of objects */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + const int16_t localVAD[MAX_NUM_OBJECTS], /* i : local VAD flag */ + const int16_t ism_imp[], /* i : ISM importance flags */ + int32_t element_brate[], /* o : element bitrate per object */ + int32_t total_brate[], /* o : total bitrate per object */ + int16_t nb_bits_metadata[] /* i/o: number of metadata bits */ ) { int16_t ch; @@ -128,10 +129,16 @@ ivas_error ivas_ism_config( bits_element[n_ISms - 1] += bits_ism % n_ISms; bitbudget_to_brate( bits_element, element_brate, n_ISms ); - /* count ISm common signaling bits */ + /* count ISM common signaling bits */ if ( hIsmMeta != NULL ) { - nb_bits_metadata[0] += n_ISms * ISM_METADATA_FLAG_BITS + num_obj; +#ifdef TD5 + if ( ism_total_brate >= ISM_EXTENDED_METADATA_BRATE ) + { + nb_bits_metadata[0] += ISM_EXTENDED_METADATA_BITS; + } +#endif + nb_bits_metadata[0] += n_ISms * ISM_METADATA_FLAG_BITS + nchan_ism; for ( ch = 0; ch < n_ISms; ch++ ) { @@ -289,7 +296,7 @@ ivas_error ivas_ism_config( #ifdef DEBUGGING if ( bits_CoreCoder[ch] == SID_2k40 / FRAMES_PER_SEC ) { - printf( "\nWarning: ISm bitbudget equal to SID!\n" ); + printf( "\nWarning: ISM bitbudget equal to SID!\n" ); } #endif break; @@ -308,7 +315,7 @@ ivas_error ivas_ism_config( tmpL = sum_l( total_brate, n_ISms ) + bits_side * FRMS_PER_SECOND; if ( sum_l( element_brate, n_ISms ) != tmpL ) { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "\nError: Mismatch in ISm bit-budget distribution. Exiting!\n" ); + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "\nError: Mismatch in ISM bit-budget distribution. Exiting!\n" ); } } #endif @@ -320,7 +327,7 @@ ivas_error ivas_ism_config( /*-------------------------------------------------------------------* * ivas_ism_reset_metadata() * - * Reset ISm metadata parameters + * Reset ISM metadata parameters *-------------------------------------------------------------------*/ void ivas_ism_reset_metadata( @@ -329,15 +336,22 @@ void ivas_ism_reset_metadata( { hIsmMeta->azimuth = 0.0f; hIsmMeta->elevation = 0.0f; +#ifdef TD5 + hIsmMeta->yaw = 0.0f; + hIsmMeta->pitch = 0.0f; + hIsmMeta->radius = 1.0f; +#endif return; } + /*-------------------------------------------------------------------* * ivas_ism_reset_metadata_API() * - * Reset ISm metadata parameters + * Reset ISM metadata parameters *-------------------------------------------------------------------*/ + void ivas_ism_reset_metadata_API( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ) @@ -348,6 +362,7 @@ void ivas_ism_reset_metadata_API( return; } + /*-------------------------------------------------------------------* * ism_quant_meta() * @@ -356,10 +371,12 @@ void ivas_ism_reset_metadata_API( /*! r: index of the winning codeword */ int16_t ism_quant_meta( - const float val, /* i : scalar value to quantize */ - float *valQ, /* o : quantized value */ - const float borders[], /* i : level borders */ - const int16_t cbsize /* i : codebook size */ + const float val, /* i : scalar value to quantize */ + float *valQ, /* o : quantized value */ + const float borders[], /* i : level borders */ + const float q_step, /* i : quantization step */ + const float q_step_border, /* i : quantization step at the border */ + const int16_t cbsize /* i : codebook size */ ) { int16_t idx, idx_start; @@ -369,19 +386,19 @@ int16_t ism_quant_meta( { qlow = borders[0]; idx_start = 0; - step = ISM_Q_STEP_BORDER; + step = q_step_border; } else if ( val <= borders[2] ) { qlow = borders[1]; - idx_start = (int16_t) ( ( borders[1] - borders[0] ) / ISM_Q_STEP_BORDER ); - step = ISM_Q_STEP; + idx_start = (int16_t) ( ( borders[1] - borders[0] ) / q_step_border ); + step = q_step; } else { qlow = borders[2]; - idx_start = (int16_t) ( cbsize - 1 - ( borders[3] - borders[2] ) / ISM_Q_STEP_BORDER ); - step = ISM_Q_STEP_BORDER; + idx_start = (int16_t) ( cbsize - 1 - ( borders[3] - borders[2] ) / q_step_border ); + step = q_step_border; } idx = idx_start + (int16_t) max( 0.f, min( cbsize - 1, ( ( val - qlow ) / step + 0.5f ) ) ); @@ -399,31 +416,33 @@ int16_t ism_quant_meta( /*! r: dequantized value */ float ism_dequant_meta( - const int16_t idx, /* i : quantizer index */ - const float borders[], /* i : level borders */ - const int16_t cbsize /* i : codebook size */ + const int16_t idx, /* i : quantizer index */ + const float borders[], /* i : level borders */ + const float q_step, /* i : quantization step */ + const float q_step_border, /* i : quantization step at the border */ + const int16_t cbsize /* i : codebook size */ ) { int16_t idx_start; float qlow, step, valQ; - if ( idx <= ( borders[1] - borders[0] ) / ISM_Q_STEP_BORDER ) + if ( idx <= ( borders[1] - borders[0] ) / q_step_border ) { qlow = borders[0]; idx_start = 0; - step = ISM_Q_STEP_BORDER; + step = q_step_border; } - else if ( idx <= cbsize - 1 - ( borders[3] - borders[2] ) / ISM_Q_STEP_BORDER ) + else if ( idx <= cbsize - 1 - ( borders[3] - borders[2] ) / q_step_border ) { qlow = borders[1]; - idx_start = (int16_t) ( ( borders[1] - borders[0] ) / ISM_Q_STEP_BORDER ); - step = ISM_Q_STEP; + idx_start = (int16_t) ( ( borders[1] - borders[0] ) / q_step_border ); + step = q_step; } else { qlow = borders[2]; - idx_start = (int16_t) ( cbsize - 1 - ( borders[3] - borders[2] ) / ISM_Q_STEP_BORDER ); - step = ISM_Q_STEP_BORDER; + idx_start = (int16_t) ( cbsize - 1 - ( borders[3] - borders[2] ) / q_step_border ); + step = q_step_border; } valQ = ( idx - idx_start ) * step + qlow; @@ -440,12 +459,22 @@ float ism_dequant_meta( void ivas_param_ism_config( PARAM_ISM_CONFIG_HANDLE hParamIsm /* i/o: IVAS Param ISM Config Structure */ +#ifdef NCHAN_ISM_PARAMETER + , + const int16_t nchan_obj /* i : number of ISM channels */ +#endif ) { +#ifdef NCHAN_ISM_PARAMETER + int16_t i; + + hParamIsm->nbands = MAX_PARAM_ISM_NBANDS; +#else int16_t i, num_obj; hParamIsm->nbands = MAX_PARAM_ISM_NBANDS; num_obj = hParamIsm->num_obj; +#endif for ( i = 0; i < hParamIsm->nbands; i++ ) { @@ -453,7 +482,11 @@ void ivas_param_ism_config( } /* for elevation zero compute the max azi quantization indices */ +#ifdef NCHAN_ISM_PARAMETER + for ( i = 0; i < nchan_obj; i++ ) +#else for ( i = 0; i < num_obj; i++ ) +#endif { hParamIsm->last_az_diff[i] = 0; hParamIsm->last_az_sgn[i] = 1; @@ -490,3 +523,98 @@ ISM_MODE ivas_ism_mode_select( return ism_mode; } + + +/*--------------------------------------------------------------- + * ivas_ism_metadata_close() + * + * Deallocate ISM metadata handles + * ---------------------------------------------------------------*/ + +void ivas_ism_metadata_close( + ISM_METADATA_HANDLE hIsmMetaData[] /* i/o : object metadata handles */ +) +{ + int16_t n; + + if ( hIsmMetaData == NULL || hIsmMetaData == NULL ) + { + return; + } + + for ( n = 0; n < MAX_NUM_OBJECTS; n++ ) + { + if ( hIsmMetaData[n] != NULL ) + { + free( hIsmMetaData[n] ); + hIsmMetaData[n] = NULL; + } + } + + return; +} + + +#ifdef DISCRETE_ISM_DTX_CNG +/*-------------------------------------------------------------------* + * update_last_metadata() + * + * Store last metadata values + *-------------------------------------------------------------------*/ + +void update_last_metadata( + const int16_t nchan_ism, /* i : number of objects */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + const int16_t updt_flag[] /* i : last metadata update flag */ +) +{ + int16_t ch; + + for ( ch = 0; ch < nchan_ism; ch++ ) + { + if ( updt_flag[ch] == 1 ) + { + hIsmMeta[ch]->last_azimuth = hIsmMeta[ch]->azimuth; + hIsmMeta[ch]->last_elevation = hIsmMeta[ch]->elevation; + } + } + + return; +} + + +/*----------------------------------------------------------------* + * ivas_get_ism_sid_quan_bitbudget() + * + * Set quantization bits based on the number of coded objects + *----------------------------------------------------------------*/ + +void ivas_get_ism_sid_quan_bitbudget( + const int16_t nchan_ism, /* i : number of objects */ + int16_t *nBits_azimuth, /* o : number of Q bits for azimuth */ + int16_t *nBits_elevation, /* o : number of Q bits for elevation */ + float *q_step, /* o : quantization step */ + float *q_step_border, /* o : quantization step at the border */ + int16_t *nBits_coh, /* o : number of Q bits for coherence */ + int16_t *nBits_sce_id /* o : number of Q bits for sce_id_dtx */ +) +{ + *nBits_azimuth = ISM_DTX_AZI_BITS_HIGH; + *nBits_elevation = ISM_DTX_ELE_BITS_HIGH; + *q_step = ISM_Q_STEP_HIGH; + *q_step_border = ISM_Q_STEP_BORDER_HIGH; + *nBits_coh = ISM_DTX_COH_SCA_BITS; + *nBits_sce_id = 1; + + if ( nchan_ism >= 3 ) + { + *nBits_azimuth = ISM_DTX_AZI_BITS_LOW; + *nBits_elevation = ISM_DTX_ELE_BITS_LOW; + *q_step = ISM_Q_STEP_LOW; + *q_step_border = ISM_Q_STEP_BORDER_LOW; + *nBits_sce_id = 2; + } + + return; +} +#endif diff --git a/lib_com/ivas_masa_com.c b/lib_com/ivas_masa_com.c index 86f7676378..bd0336ad43 100644 --- a/lib_com/ivas_masa_com.c +++ b/lib_com/ivas_masa_com.c @@ -314,6 +314,10 @@ void masa_sample_rate_band_correction( int16_t *band_mapping, /* i/o: Band mapping used and modified */ IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: QMetadata structure for modification */ const int32_t sampling_rate /* i : Sampling rate */ +#ifdef FIX_373_MASA_DELAY_COMP_MSAN + , + MASA_DECODER_EXT_OUT_META_HANDLE hExtOutMeta /* i/o: MASA decoder metadata ext out buffer */ +#endif ) { uint8_t band, sf; @@ -386,6 +390,28 @@ void masa_sample_rate_band_correction( hQMetaData->twoDirBands[band] = 0; } } +#ifdef FIX_373_MASA_DELAY_COMP_MSAN + if ( hExtOutMeta != NULL ) + { + /* in decoder, zero the EXT out MASA meta buffer */ + for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) + { + for ( band = config->numCodingBands; band < MASA_FREQUENCY_BANDS; band++ ) + { + hExtOutMeta->directionIndex[0][sf][band] = SPH_IDX_FRONT; + hExtOutMeta->directToTotalRatio[0][sf][band] = 0u; + hExtOutMeta->spreadCoherence[0][sf][band] = 0u; + + hExtOutMeta->directionIndex[1][sf][band] = SPH_IDX_FRONT; + hExtOutMeta->directToTotalRatio[1][sf][band] = 0u; + hExtOutMeta->spreadCoherence[1][sf][band] = 0u; + + hExtOutMeta->surroundCoherence[sf][band] = 0u; + hExtOutMeta->diffuseToTotalRatio[sf][band] = UINT8_MAX; + } + } + } +#endif return; } diff --git a/lib_com/ivas_mc_param_com.c b/lib_com/ivas_mc_param_com.c index c6cfe0ed8f..acf7a8eae2 100644 --- a/lib_com/ivas_mc_param_com.c +++ b/lib_com/ivas_mc_param_com.c @@ -141,7 +141,6 @@ void ivas_param_mc_metadata_open( ivas_param_mc_default_icc_map( hMetadataPMC->icc_mapping_conf, hMetadataPMC->icc_mapping[i] ); } - /* init remaining flags and indices */ hMetadataPMC->param_frame_idx = 0; hMetadataPMC->flag_use_adaptive_icc_map = 0; diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index dbec066552..e8597bbf3c 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -124,7 +124,7 @@ void destroy_cpe_enc( ); void ivas_mct_enc_close( - MCT_ENC_HANDLE hMCT /* i/o: MCT encoder structure */ + MCT_ENC_HANDLE *hMCT /* i/o: MCT encoder structure */ ); ivas_error ivas_corecoder_enc_reconfig( @@ -202,12 +202,7 @@ ivas_error pre_proc_front_ivas( const int16_t front_vad_flag, /* i : front-VAD flag to overwrite VAD decision */ const int16_t force_front_vad, /* i : flag to force VAD decision */ const int16_t front_vad_dtx_flag, /* i : front-VAD DTX flag to overwrite VAD decision*/ -#ifdef LOW_RATE_TRANS_CORE_CODER const int32_t ivas_total_brate /* i : IVAS total bitrate */ -#else - const int32_t ivas_total_brate, /* i : IVAS total bitrate */ - const int16_t ivas_format /* i : IVAS format */ -#endif ); ivas_error pre_proc_ivas( @@ -267,13 +262,9 @@ void ivas_initialize_handles_enc( ); ivas_error ivas_init_encoder( - Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ -#ifndef IND_LIST_DYN - ,Indice ind_list[][MAX_NUM_INDICES] /* i : indices list */ -#endif -#ifndef IND_LIST_DYN - ,Indice ind_list_metadata[][MAX_BITS_METADATA] /* i : indices list metadata */ -#endif + Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ + Indice ind_list[][MAX_NUM_INDICES], /* i : indices list */ + Indice ind_list_metadata[][MAX_BITS_METADATA] /* i : indices list metadata */ ); void destroy_core_enc( @@ -298,7 +289,7 @@ ivas_error stereo_dmx_evs_init_encoder( ); void stereo_dmx_evs_close_encoder( - STEREO_DMX_EVS_ENC_HANDLE hStereoDmxEVS /* i/o: Stereo downmix for EVS encoder handle */ + STEREO_DMX_EVS_ENC_HANDLE *hStereoDmxEVS /* i/o: Stereo downmix for EVS encoder handle */ ); ivas_error ivas_dec( @@ -508,11 +499,10 @@ void stereo_tcx_core_dec( const int16_t last_element_mode, /* i : last element mode */ const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ STEREO_CNG_DEC_HANDLE hStereoCng, /* i : Stereo CNG handle */ - const int16_t nchan_out /* i : number of output channels */ -#ifdef PARAM_ISM_DTX_CNG - , - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const ISM_MODE ism_mode /* i : ISM mode (only needed if format is ISM) */ + const int16_t nchan_out, /* i : number of output channels */ + const IVAS_FORMAT ivas_format /* i : IVAS format */ +#ifndef DISCRETE_ISM_DTX_CNG + ,const ISM_MODE ism_mode /* i : ISM mode (only needed if format is ISM) */ #endif ); @@ -751,13 +741,13 @@ void dtx_read_padding_bits( /*----------------------------------------------------------------------------------* - * ISm prototypes + * ISM prototypes *----------------------------------------------------------------------------------*/ ivas_error ivas_ism_config( - const int32_t ism_total_brate, /* i : ISms total bitrate */ - const int16_t num_trans_ch, /* i : number of trans channels */ - const int16_t num_obj, /* i : number of objects */ + const int32_t ism_total_brate, /* i : ISM total bitrate */ + const int16_t nchan_transport, /* i : number of transport channels */ + const int16_t nchan_ism, /* i : number of objects */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ const int16_t localVAD[MAX_NUM_OBJECTS], /* i : local VAD flag */ const int16_t ism_imp[], /* i : ISM importance flags */ @@ -779,6 +769,8 @@ int16_t ism_quant_meta( const float val, /* i : scalar value to quantize */ float *valQ, /* o : quantized value */ const float borders[], /* i : level borders */ + const float q_step, /* i : quantization step */ + const float q_step_border, /* i : quantization step at the border */ const int16_t cbsize /* i : codebook size */ ); @@ -786,13 +778,22 @@ int16_t ism_quant_meta( float ism_dequant_meta( const int16_t idx, /* i : quantizer index */ const float borders[], /* i : level borders */ + const float q_step, /* i : quantization step */ + const float q_step_border, /* i : quantization step at the border */ const int16_t cbsize /* i : codebook size */ ); ivas_error ivas_set_ism_metadata( ISM_METADATA_HANDLE hIsmMeta, /* o : ISM metadata handle */ const float azimuth, /* i : azimuth value */ +#ifdef TD5 + const float elevation, /* i : elevation value */ + const float radius_meta, /* i : radius */ + const float yaw, /* i : yaw */ + const float pitch /* i : pitch */ +#else const float elevation /* i : elevation value */ +#endif ); ivas_error ivas_ism_metadata_enc_create( @@ -815,7 +816,10 @@ ivas_error ivas_ism_enc( ); ivas_error ivas_ism_metadata_enc( - const int32_t ism_total_brate, /* i : ISms total bitrate */ + const int32_t ism_total_brate, /* i : ISM total bitrate */ +#ifdef NCHAN_ISM_PARAMETER + const int16_t nchan_ism, /* i : number of ISM channels */ +#endif const int16_t nchan_transport, /* i : number of transport channels */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ SCE_ENC_HANDLE hSCE[], /* i/o: SCE encoder handles */ @@ -823,17 +827,28 @@ ivas_error ivas_ism_metadata_enc( int16_t nb_bits_metadata[], /* o : number of metadata bits */ const int16_t localVAD[], /* i : VAD flag */ const int16_t ism_mode, /* i : ISM mode */ +#ifdef TD5 + const PARAM_ISM_CONFIG_HANDLE hParamIsm, /* i : Param ISM Config Handle */ + const int16_t ism_extended_metadata_flag /* i : Extended metadata flag */ +#else const PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Config Handle */ +#endif ); ivas_error ivas_ism_metadata_dec( - const int32_t ism_total_brate, /* i : ISms total bitrate */ + const int32_t ism_total_brate, /* i : ISM total bitrate */ +#ifdef NCHAN_ISM_PARAMETER + const int16_t nchan_ism, /* i : number of ISM channels */ +#endif int16_t *nchan_transport, /* o : number of transport channels */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ SCE_DEC_HANDLE hSCE[], /* i/o: SCE decoder handles */ const int16_t bfi, /* i : bfi flag */ int16_t nb_bits_metadata[], /* o : number of metadata bits */ ISM_MODE ism_mode, /* i : ISM mode */ +#ifdef DISCRETE_ISM_DTX_CNG + ISM_DTX_DATA_DEC hISMDTX, /* i/o: ISM DTX structure */ +#endif const PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Config Handle */ ); @@ -859,10 +874,14 @@ void ivas_param_ism_enc( ); void ivas_param_ism_enc_close( - DIRAC_ENC_HANDLE hDirAC, /* i/o: encoder DirAC handle */ + DIRAC_ENC_HANDLE *hDirAC, /* i/o: encoder DirAC handle */ const int32_t input_Fs /* i : input sampling_rate */ ); +void ivas_ism_metadata_close( + ISM_METADATA_HANDLE hIsmMetaData[] /* i/o : object metadata handles */ +); + void ivas_param_ism_stereo_dmx( Encoder_Struct *st_ivas, /* i : IVAS encoder structure */ float data[MAX_NUM_OBJECTS][L_FRAME48k], /* i/o: input signal/stereo dmx */ @@ -871,6 +890,10 @@ void ivas_param_ism_stereo_dmx( void ivas_param_ism_config( PARAM_ISM_CONFIG_HANDLE hParamIsm /* i/o: IVAS Param ISM Config Structure */ +#ifdef NCHAN_ISM_PARAMETER + , + const int16_t nchan_ism /* i : number of ISM channels */ +#endif ); ivas_error ivas_ism_enc_config( @@ -878,8 +901,14 @@ ivas_error ivas_ism_enc_config( ); ivas_error ivas_ism_dec_config( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const int16_t num_obj /* i : number of objects in the bitstream */ + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ +#ifdef DISCRETE_ISM_DTX_CNG + , + const ISM_MODE last_ism_mode /* i/o: last ISM mode */ +#endif +#ifndef NCHAN_ISM_PARAMETER + ,const int16_t num_obj /* i : number of objects in the bitstream */ +#endif ); ivas_error ivas_param_ism_dec_open( @@ -887,7 +916,7 @@ ivas_error ivas_param_ism_dec_open( ); void ivas_param_ism_dec_close( - DIRAC_DEC_HANDLE hDirAC, /* i/o: decoder DirAC handle */ + DIRAC_DEC_HANDLE *hDirAC, /* i/o: decoder DirAC handle */ const AUDIO_CONFIG output_config /* i : output audio configuration */ ); @@ -901,56 +930,121 @@ void ivas_param_ism_params_to_masa_param_mapping( ); -#ifdef PARAM_ISM_DTX_CNG /*----------------------------------------------------------------------------------* * ISM DTX prototypes *----------------------------------------------------------------------------------*/ ivas_error ivas_ism_dtx_open( - Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ + Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ +); + +#ifdef DISCRETE_ISM_DTX_CNG +/*! r: indication of DTX frame */ +int16_t ivas_ism_dtx_enc( + ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ + SCE_ENC_HANDLE hSCE[MAX_SCE], /* i/o: SCE encoder structure */ + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + const int16_t nchan_ism, /* i : number of objects */ + const int16_t nchan_transport, /* i : number of transport channels */ + int16_t vad_flag[MAX_NUM_OBJECTS], /* i : VAD flag */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + int16_t md_diff_flag[], /* o : metadata differential flag */ + int16_t *sid_flag /* o : indication of SID frame */ ); +#else +/*! r: indication of DTX frame */ +int16_t ivas_ism_dtx_enc( + Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ + int16_t *sid_flag /* o : indication of SID frame */ +); +#endif ivas_error ivas_ism_dtx_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - int16_t *nb_bits_metadata /* o : number of metadata bits */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + int16_t *nb_bits_metadata /* o : number of metadata bits */ ); +#ifdef DISCRETE_ISM_DTX_CNG +void ivas_ism_metadata_sid_enc( + ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ + const int16_t flag_noisy_speech, /* i : noisy speech flag */ + const int16_t nchan_ism, /* i : number of objects */ + const int16_t nchan_transport, /* i : number of transport channels */ + const ISM_MODE ism_mode, /* i : ISM mode */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + const int16_t sid_flag, /* i : indication of SID frame */ + const int16_t md_diff_flag[], /* i : metadata differental flag */ + BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ + int16_t nb_bits_metadata[] /* o : number of metadata bits */ +); +#else void ivas_param_ism_metadata_dtx_enc( - BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ - ISM_METADATA_HANDLE hIsmMeta[], /* i : ISM metadata handles */ - ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ - PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Enc Handle */ + BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ + ISM_METADATA_HANDLE hIsmMeta[], /* i : ISM metadata handles */ + ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ + PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Enc Handle */ +#ifdef NCHAN_ISM_PARAMETER + ,const int16_t nchan_ism /* i : number of ISM channels */ +#endif ); +#endif +#ifdef DISCRETE_ISM_DTX_CNG +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 */ + 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 */ + const ISM_MODE ism_mode, /* i : ISM mode */ + int16_t *flag_noisy_speech, /* o : noisy speech flag */ + int16_t *sce_id_dtx, /* o : SCE DTX ID */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + int16_t nb_bits_metadata[] /* o : number of metadata bits */ +); +#else void ivas_param_ism_metadata_dtx_dec( - Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); +#endif void ivas_ism_get_sce_id_dtx( - ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ - SCE_ENC_HANDLE hSCE[MAX_SCE], /* i/o: SCE encoder structure */ - const int16_t nchan_transport, /* i : number of transport channels */ - const int16_t input_frame /* i : input frame length per channel */ + ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ + SCE_ENC_HANDLE hSCE[MAX_SCE], /* i/o: SCE encoder structure */ + const int16_t nchan_transport, /* i : number of transport channels */ + const int16_t input_frame /* i : input frame length per channel */ ); -void ivas_param_ism_compute_noisy_speech_flag( - Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ +void ivas_param_ism_compute_noisy_speech_flag( + Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ); -/*! r: indication of DTX frame */ -int16_t ivas_ism_dtx_enc( - Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ - int16_t *sid_flag /* o : indication of SID frame */ +void ivas_ism_coh_estim_dtx_enc( + ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ + SCE_ENC_HANDLE hSCE[MAX_SCE], /* i/o: SCE encoder structure */ + const int16_t nchan_transport, /* i : number of transport channels */ + const int16_t input_frame /* i : input frame length */ ); -void ivas_ism_coh_estim_dtx_enc( - ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ - SCE_ENC_HANDLE hSCE[MAX_SCE], /* i/o: SCE encoder structure */ - const int16_t nchan_transport, /* i : number of transport channels */ - const int16_t input_frame /* i : input frame length */ +#ifdef DISCRETE_ISM_DTX_CNG +void update_last_metadata( + const int16_t nchan_ism, /* i : number of objects */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + const int16_t updt_flag[] /* i : last metadata update flag */ +); + +void ivas_get_ism_sid_quan_bitbudget( + const int16_t nchan_ism, /* i : number of objects */ + int16_t *nBits_azimuth, /* o : number of Q bits for azimuth */ + int16_t *nBits_elevation, /* o : number of Q bits for elevation */ + float *q_step, /* o : quantization step */ + float *q_step_border, /* o : quantization step at the border */ + int16_t *nBits_coh, /* o : number of Q bits for coherence */ + int16_t *nBits_sce_id /* o : number of Q bits for sce_id_dtx */ ); #endif + /*----------------------------------------------------------------------------------* * DFT Stereo prototypes *----------------------------------------------------------------------------------*/ @@ -1292,9 +1386,9 @@ int16_t adapt_GR_rpg1_ief( /*! r: number of bits written */ int16_t write_GR1( BSTR_ENC_HANDLE hBstr, /* i/o: Encoder bitstream handle */ - const int16_t ind, /* i : bitstream index */ - const int16_t *in, /* i : input vector */ - const int16_t len /* i : vector length */ + const int16_t ind, /* i : bitstream index */ + const int16_t *in, /* i : input vector */ + const int16_t len /* i : vector length */ ); /*! r: number of bits written */ @@ -1998,9 +2092,6 @@ void InternalTCXDecoder( void stereo_mdct_core_enc( CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ -#ifdef IND_LIST_DYN - const int16_t ivas_format, /* i : IVAS format */ -#endif float new_samples[CPE_CHANNELS][L_INP], /* i : new samples */ float old_wsp[CPE_CHANNELS][L_WSP], /* i : 12.8kHz weighted speech (for LTP */ float pitch_buf[CPE_CHANNELS][NB_SUBFR16k] /* o : floating pitch for each subframe */ @@ -2717,7 +2808,9 @@ void ivas_mct_core_enc( CPE_ENC_HANDLE hCPE[MCT_MAX_BLOCKS], /* i/o: CPE encoder structures */ const int16_t nChannels, /* i : number of channels to be coded */ const int32_t ivas_total_brate, /* i : IVAS total bitrate */ +#ifndef DISABLE_BWD_MCT const int16_t switch_bw, /* i : flag bandwidth switch occurance */ +#endif const int16_t lfe_bits, /* i : bits spent for LFE */ const int16_t sba_order /* i : Ambisonic (SBA) order */ ); @@ -2844,7 +2937,7 @@ void ivas_mct_dec_mct( void apply_MCT_dec( MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ Decoder_State **sts, /* i/o: decoder state structure */ - float *x[MCT_MAX_CHANNELS][NB_DIV] /* i/o: decoded and dequan. spect. input to MCT */ + float *x[MCT_MAX_CHANNELS][NB_DIV] /* i/o: decoded and dequan. spect. input to MCT */ ); void mctStereoIGF_dec( @@ -2944,9 +3037,7 @@ void ivas_qmetadata_close( void restore_metadata_buffer( BSTR_ENC_HANDLE hMetaData, const int16_t next_ind_start, -#ifndef IND_LIST_DYN const int16_t last_ind_start, -#endif const int16_t bit_pos_start ); @@ -3250,7 +3341,7 @@ ivas_error ivas_dirac_enc_reconfigure( ); void ivas_dirac_enc_close( - DIRAC_ENC_HANDLE hDirAC, /* i/o: encoder DirAC handle */ + DIRAC_ENC_HANDLE *hDirAC, /* i/o: encoder DirAC handle */ const int32_t input_Fs /* i : input sampling_rate */ ); @@ -3302,7 +3393,7 @@ ivas_error ivas_dirac_dec_config( ); void ivas_dirac_dec_close( - DIRAC_DEC_HANDLE hDirAC /* i/o: decoder DirAC handle */ + DIRAC_DEC_HANDLE *hDirAC /* i/o: decoder DirAC handle */ ); void ivas_dirac_dec_read_BS( @@ -3530,7 +3621,7 @@ ivas_error ivas_param_mc_enc_reconfig( ); void ivas_param_mc_enc_close( - PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ + PARAM_MC_ENC_HANDLE *hParamMC, /* i/o: Parametric MC encoder handle */ const int32_t input_Fs /* i : input sampling rate */ ); @@ -3760,18 +3851,14 @@ void FdCngDecodeDiracMDCTStereoSID( ivas_error ivas_spar_enc_open( Encoder_Struct *st_ivas /* i/o: IVAS encoder handle */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP ,const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ -#endif ); void ivas_spar_enc_close( - SPAR_ENC_HANDLE hSpar, /* i/o: SPAR encoder handle */ + SPAR_ENC_HANDLE *hSpar, /* i/o: SPAR encoder handle */ const int32_t input_Fs, /* i : input sampling rate */ - const int16_t nchan_inp /* i : number of input channels */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP - ,const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ -#endif + const int16_t nchan_inp, /* i : number of input channels */ + const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ ); ivas_error ivas_spar_enc( @@ -3783,20 +3870,14 @@ ivas_error ivas_spar_enc( ); ivas_error ivas_spar_dec_open( - Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP - , + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ -#endif ); void ivas_spar_dec_close( - SPAR_DEC_HANDLE hSpar, /* i/o: SPAR decoder handle */ - const int32_t output_Fs /* i : output sampling rate */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP - , + SPAR_DEC_HANDLE *hSpar, /* i/o: SPAR decoder handle */ + const int32_t output_Fs, /* i : output sampling rate */ const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ -#endif ); ivas_error ivas_spar_dec( @@ -4166,11 +4247,7 @@ void ivas_enc_cov_handler_process( const int16_t end_band, const int16_t nchan_inp, const int16_t dtx_vad, -#ifdef SMOOTH_WITH_TRANS_DET const int16_t transient_det[2] -#else - const int16_t transient_det -#endif ); ivas_error ivas_spar_covar_smooth_enc_open( @@ -4192,37 +4269,25 @@ void ivas_cov_smooth_process( const int16_t start_band, const int16_t end_band, const int16_t num_ch, -#ifdef SMOOTH_WITH_TRANS_DET const int16_t transient_det[2] -#else - const int16_t transient_det -#endif ); /* Transient detector module */ -ivas_error ivas_transient_det_open( +ivas_error ivas_transient_det_open( ivas_trans_det_state_t **hTranDet, /* i/o: Transient detector handle */ const int32_t sampling_rate /* i : sampling rate */ ); -void ivas_transient_det_close( +void ivas_transient_det_close( ivas_trans_det_state_t **hTranDet /* i/o: Transient detector handle */ ); -#ifdef SMOOTH_WITH_TRANS_DET void ivas_transient_det_process( ivas_trans_det_state_t *hTranDet, /* i/o: SPAR TD handle */ float *pIn_pcm, /* i : input audio channels */ - const int16_t frame_len, /* i : frame length in samples */ + const int16_t frame_len, /* i : frame length in samples */ int16_t transient_det[2] /* o : transient det outputs */ ); -#else -int16_t ivas_transient_det_process( - ivas_trans_det_state_t *hTranDet, /* i/o: Transient detector handle */ - float *pIn_pcm, /* i : input audio channels */ - const int16_t frame_len /* i : frame length in samples */ -); -#endif void ivas_td_decorr_get_ducking_gains( ivas_trans_det_state_t *hTranDet, /* i/o: Transient detector handle */ @@ -4233,14 +4298,14 @@ void ivas_td_decorr_get_ducking_gains( const int16_t tdet_flag ); -ivas_error ivas_td_decorr_dec_open( +ivas_error ivas_td_decorr_dec_open( ivas_td_decorr_state_t **hTdDecorr, /* i/o: TD decorrelator handle */ const int32_t output_Fs, /* i : output sampling rate */ const int16_t nchan_internal, /* i : number of internal channels */ const int16_t ducking_flag /* i : ducking flag */ ); -void ivas_td_decorr_dec_close( +void ivas_td_decorr_dec_close( ivas_td_decorr_state_t **hTdDecorr /* i/o: TD decorrelator handle */ ); @@ -4459,7 +4524,7 @@ ivas_error ivas_masa_dec_open( ); void ivas_masa_dec_close( - MASA_DECODER_HANDLE hMasa /* i/o: MASA metadata structure */ + MASA_DECODER_HANDLE *hMasa /* i/o: MASA metadata structure */ ); ivas_error ivas_masa_decode( @@ -4477,7 +4542,7 @@ ivas_error ivas_masa_enc_open( ); void ivas_masa_enc_close( - MASA_ENCODER_HANDLE hMasa /* i/o: MASA metadata structure */ + MASA_ENCODER_HANDLE *hMasa /* i/o: MASA metadata structure */ #ifndef FIX_350_MASA_DELAY_COMP , const int16_t nchan_transport, /* i : Number of transport channels */ @@ -4564,6 +4629,9 @@ void masa_sample_rate_band_correction( int16_t *band_mapping, /* i/o: Band mapping used and modified */ IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: QMetadata structure for modification */ const int32_t sampling_rate /* i : sampling rate */ +#ifdef FIX_373_MASA_DELAY_COMP_MSAN + , MASA_DECODER_EXT_OUT_META_HANDLE hExtOutMeta /* i/o: MASA decoder metadata ext out buffer */ +#endif ); void invdct4_transform( @@ -4661,7 +4729,7 @@ void ivas_ism2sba( float buffer_td[][L_FRAME48k], /* i/o: TD signal buffers */ ISM_RENDERER_HANDLE hIsmRendererData, /* i/o: renderer data */ const ISM_METADATA_HANDLE hIsmMetaData[], /* i : object metadata */ - const int16_t num_objects, /* i : number of objects */ + const int16_t nchan_ism, /* i : number of objects */ const int16_t output_frame, /* i : output frame length per channel */ const int16_t sba_order /* i : SBA order */ ); @@ -4765,7 +4833,7 @@ ivas_error ivas_mcmasa_enc_open( ); void ivas_mcmasa_enc_close( - MCMASA_ENC_HANDLE hMcMasa, /* i/o: encoder McMASA handle */ + MCMASA_ENC_HANDLE *hMcMasa, /* i/o: encoder McMASA handle */ const int32_t input_Fs /* i : input sampling rate */ ); @@ -4888,7 +4956,7 @@ ivas_error ivas_create_lfe_enc( ); void ivas_lfe_enc_close( - LFE_ENC_HANDLE hLFE /* i/o: LFE encoder handle */ + LFE_ENC_HANDLE *hLFE /* i/o: LFE encoder handle */ ); void ivas_lfe_enc( @@ -4905,7 +4973,7 @@ ivas_error ivas_create_lfe_dec( ); void ivas_lfe_dec_close( - LFE_DEC_HANDLE hLFE /* i/o: LFE encoder handle */ + LFE_DEC_HANDLE *hLFE /* i/o: LFE encoder handle */ ); void ivas_lfe_dec( @@ -4980,20 +5048,14 @@ ivas_error ivas_fb_set_cfg( ivas_error ivas_FB_mixer_open( IVAS_FB_MIXER_HANDLE *hFbMixer, /* i/o: FB mixer handle */ const int32_t sampling_rate, /* i : sampling rate */ - IVAS_FB_CFG *fb_cfg /* i : FB config. handle */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP - , + IVAS_FB_CFG *fb_cfg, /* i : FB config. handle */ const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ -#endif ); void ivas_FB_mixer_close( IVAS_FB_MIXER_HANDLE *hFbMixer, /* i/o: FB mixer handle */ - const int32_t sampling_rate /* i : sampling rate in Hz */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP - , + const int32_t sampling_rate, /* i : sampling rate in Hz */ const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ -#endif ); void ivas_fb_mixer_pcm_ingest( diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index 0fea291b30..a095c9e4b4 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -318,6 +318,7 @@ extern const float McMASA_LFEGain_vectors[64]; extern const float ism_azimuth_borders[4]; extern const float ism_elevation_borders[4]; + /*----------------------------------------------------------------------------------* * Param ISM ROM tables *----------------------------------------------------------------------------------*/ diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index 8231588551..b445ac6f04 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -41,9 +41,20 @@ /*----------------------------------------------------------------------------------* - * Declaration of ISm common (encoder & decoder) structure + * Declaration of ISM common (encoder & decoder) structure *----------------------------------------------------------------------------------*/ +#ifdef TD5 +typedef struct +{ + int16_t last_azimuth_idx; /* last frame index of coded azimuth */ + int16_t azimuth_diff_cnt; /* FEC counter of consecutive differentially azimuth coded frames */ + int16_t last_elevation_idx; /* last frame index of coded elevation */ + int16_t elevation_diff_cnt; /* FEC counter of consecutive differentially elevation coded frames */ + +} ISM_METADATA_ANGLE, *ISM_METADATA_ANGLE_HANDLE; +#endif + /* ISM metadata handle (storage for one frame of read ISM metadata) */ typedef struct { @@ -52,11 +63,26 @@ typedef struct float azimuth; /* azimuth value read from the input metadata file */ float elevation; /* azimuth value read from the input metadata file */ - +#ifdef TD5 + float radius; + float yaw; /* azimuth orientation value read from the input metadata file */ + float pitch; /* elevation orientation value read from the input metadata file */ + ISM_METADATA_ANGLE angle[2]; /* Angle structs for [0] azimuth/elevation and [1] yaw/pitch */ + int16_t last_radius_idx; /* last frame index of coded radius */ + int16_t radius_diff_cnt; /* FEC counter of consecutive differentially radius coded frames */ +#else int16_t last_azimuth_idx; /* last frame index of coded azimuth */ int16_t azimuth_diff_cnt; /* FEC counter of consecutive differentially azimuth coded frames */ int16_t last_elevation_idx; /* last frame index of coded elevation */ int16_t elevation_diff_cnt; /* FEC counter of consecutive differentially elevation coded frames */ +#endif + +#ifdef DISCRETE_ISM_DTX_CNG + float last_azimuth; /* MD smoothing in DTX- last Q azimuth value */ + float last_elevation; /* MD smoothing in DTX - last Q elevation value */ + float last_true_azimuth; /* MD smoothing in DTX- last true Q azimuth value */ + float last_true_elevation; /* MD smoothing in DTX- last true Q elevation value */ +#endif } ISM_METADATA_FRAME, *ISM_METADATA_HANDLE; @@ -130,7 +156,9 @@ typedef struct ivas_param_ism_data_structure int16_t nbands; int16_t nblocks[MAX_PARAM_ISM_NBANDS]; int16_t band_grouping[MAX_PARAM_ISM_NBANDS + 1]; +#ifndef NCHAN_ISM_PARAMETER int16_t num_obj; +#endif int16_t azi_index[MAX_NUM_OBJECTS]; int16_t ele_index[MAX_NUM_OBJECTS]; diff --git a/lib_com/ivas_transient_det.c b/lib_com/ivas_transient_det.c index e2f2dfb766..1e8f53c7ca 100644 --- a/lib_com/ivas_transient_det.c +++ b/lib_com/ivas_transient_det.c @@ -211,43 +211,17 @@ void ivas_transient_det_close( * * Transient detection process call *-----------------------------------------------------------------------------------------*/ -#ifdef SMOOTH_WITH_TRANS_DET void ivas_transient_det_process( ivas_trans_det_state_t *hTranDet, /* i/o: SPAR TD handle */ float *pIn_pcm, /* i : input audio channels */ const int16_t frame_len, /* i : frame length in samples */ int16_t transient_det[2] /* o: transient det outputs */ ) -#else -int16_t ivas_transient_det_process( - ivas_trans_det_state_t *hTranDet, /* i/o: SPAR TD handle */ - float *pIn_pcm, /* i : input audio channels */ - const int16_t frame_len /* i : frame length in samples */ -) -#endif { -#ifdef SMOOTH_WITH_TRANS_DET float in_duck_gain[L_FRAME48k]; int16_t num_sf, sf, sf_samp, idx; -#else - int16_t trans; -#endif float mem = hTranDet->in_duck_gain; -#ifndef SMOOTH_WITH_TRANS_DET - ivas_td_decorr_get_ducking_gains( hTranDet, pIn_pcm, NULL, NULL, frame_len, IVAS_TDET_ONLY ); - - if ( mem - hTranDet->in_duck_gain > IVAS_TDET_PARM_TRANS_THR ) - { - trans = 1; - } - else - { - trans = 0; - } - - return trans; -#else ivas_td_decorr_get_ducking_gains( hTranDet, pIn_pcm, in_duck_gain, NULL, frame_len, IVAS_TDET_ONLY ); transient_det[0] = 0; @@ -270,7 +244,6 @@ int16_t ivas_transient_det_process( } return; -#endif } @@ -344,9 +317,7 @@ void ivas_td_decorr_get_ducking_gains( for ( i = 0; i < frame_len; i++ ) { in_duck_gain = ivas_calc_duck_gain( in_duck_gain, in_duck_coeff, e_slow[i], e_fast[i], duck_mult_fac ); -#ifdef SMOOTH_WITH_TRANS_DET pIn_duck_gains[i] = in_duck_gain; -#endif } hTranDet->in_duck_gain = in_duck_gain; } diff --git a/lib_com/options.h b/lib_com/options.h index 1c21751bfc..c054a9b5a7 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -132,7 +132,7 @@ /* ################# Start DEVELOPMENT switches ######################## */ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ -#define IND_LIST_DYN /* VA: Issue 18: Dynamic allocation of ind_list[] and ind_list_metadata[] based on # of transport channels */ +#define BITSTREAM_INDICES_MEMORY /* Don't count memory for bitstream Indice at the encoder - it is a temporary solution for development only */ #define LSF_RE_USE_SECONDARY_CHANNEL /* TD stereo Secondary channel LSF Q improvement */ #ifdef LSF_RE_USE_SECONDARY_CHANNEL @@ -141,33 +141,28 @@ #define DISABLE_ADAP_RES_COD_TMP /* temporary fix for IVAS-403, disables adaptive residual coding */ /*#define ITD_WINNER_GAIN_MODIFY */ /* ITD optimization - WORK IN PROGRESS */ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ -#define SBA_BR_SWITCHING_CLEAN_UP /*Issue 114: Clean up changes for the SBA reconfiguation functions*/ -#define LOW_RATE_TRANS_CORE_CODER /* Eri: Activate low-rate-encoding-of-transients contribution for core coder, affects MC, MASA and SBA */ -#define FIX_197_CREND_INTERFACE -#define FIX_329_ENABLE_TD_RENDERER_REVERB_MC /* Eri: Enable reverb for TD renderer for 5.1 and 7.1 with headtracking enabled for IVAS_dec */ -#define FIX_330_ENABLE_TD_RENDERER_REVERB_REND /* Eri: Enable reverb for TD renderer for ISM, 5.1 and 7.1 with headtracking enabled for IVAS_rend */ - -#define FIX_347_DTX_CRASH /* FhG: Fix crash that can happen with DTX */ -#define DISABLE_RES_CHANNELS_MCT /* decode only W and residual for Y when outputting to stereo */ -#define FIX_107_5MS_SUBFRAME_RENDERING -#define REMOVE_FORCE_SUBFRAME_BIN /* Issue 355: remove obsolete "-force_subframe_bin" command-line option. */ - -#define PARAM_ISM_DTX_CNG /* FhG: contribution 9 - DTX-CNG for ParamISM */ - -#define FIX_331_SBA_HBR_HOA_FIXES /* DLB: issue 331 - fix addressing low frequency stuttering with HOA inputs at high bitrates */ -#ifdef FIX_331_SBA_HBR_HOA_FIXES -#define COV_SMOOTH_TUNING -#define SBA_HPF_TUNING_ENC +#define FIX_I109_ORIENTATION_TRACKING /* Issue 109: Harmonize head and orientation tracking */ /*#define SBA_HPF_TUNING_DEC*/ -#define SMOOTH_WITH_TRANS_DET -#endif #define BINAURALIZATION_DELAY_REPORT /* VA: Issue 255 - Changes the way the decoder delay is reported */ -#define FIX_351_HRTF_COMMAND /* VA: Issue 354 - improve "-hrtf" command-line option */ -#define FIX_94_VERIFY_WAV_NUM_CHANNELS /* FhG: Issue 94 - Check if number of channels in input wav file matches encoder/renderer configuration */ -#define ISM_HIGHEST_BITRATE /* VA: Issue 284: Update highest bitrate limit in ISM format */ #define TUNE_360_OBJECT_WITH_NOISE /* VA: issue 360: consider objects being speech+noise for active speech coding */ #define FIX_350_MASA_DELAY_COMP /* Nokia: Issue 350: MASA audio/meta delay compensation */ +#define FIX_372_LIB_REND_VALIDATE_IO /* FhG: Issue 372: IVAS_rend segfaults with unsupported I/O configs - add validation checks of I/O config */ +#define FIX_376_SBA_ROTATE /*DLB: Fix for issue 376*/ +#define TD5 /* Eri: Contribution 17: Extended metadata for 6 DoF rendering in TD renderer */ +#define TD5_FIX_INVALID_MEMORY_ACCESS /* FhG: Resolves segfault in case IVAS_REND_InitConfig gets initialized with rendererConfigEnabled:=false && ISM are being rendered */ +#define FIX_371_DELAY_REPORT /* Issue 371: div. by zero with -no_delay_cmp */ +#define FIX_373_MASA_DELAY_COMP_MSAN /* Nokia: Issue 373: MASA audio/meta delay compensation. MSAN bugfix */ + +#ifdef FIX_I109_ORIENTATION_TRACKING +#define OTR_REFERENCE_VECTOR_TRACKING /* FhG: enables the reference position orientation tracking mode */ +#endif + +#define FIX_380_BFI_PARAMISM /* VA: issue 380 - fix metadata recovery in ParamISM BFI */ +#define FIX_MDCT_BASED_BWD /* FhG: fixes for BWD for issues with reaction to transients for MDCT-stereo and MCT */ +#define DISCRETE_ISM_DTX_CNG /* FhG/VA: contribution 15 - DTX/CNG for (discrete) ISM */ +#define NCHAN_ISM_PARAMETER /* VA: make 'nchan_ism' parameter part of st_ivas/hEncoderConfig */ + /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_com/prot.h b/lib_com/prot.h index 5ffb9d0946..c8f69fe832 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -515,36 +515,6 @@ void push_next_bits( #endif ); -#ifdef IND_LIST_DYN -int16_t get_max_num_indices( /* o : maximum number of indices */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t total_brate /* i : total bitrate */ -); - -int16_t get_max_num_indices_metadata( /* o : maximum number of indices */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t ivas_total_brate /* i : IVAS total bitrate */ -); - -ivas_error ind_list_realloc( - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - int16_t max_num_indices /* i : new maximum number of allowed indices in the list */ -); - -int16_t find_indice( /* o : index of the indice in the list, -1 if not found */ - BSTR_ENC_HANDLE hBstr, /* i : encoder bitstream handle */ - int16_t id, /* i : ID of the indice */ - uint16_t *value, /* o : value of the quantized indice */ - int16_t *nb_bits /* o : number of bits used to quantize the indice */ -); - -uint16_t delete_indice( /* o : number of deleted indices */ - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - int16_t id /* i : ID of the indice */ -); -#endif - - /*! r: value of the indice */ #ifdef DEBUG_BS_READ_WRITE #define get_next_indice( ... ) get_next_indice_( __VA_ARGS__, __LINE__, __func__ ) @@ -642,14 +612,13 @@ Decoder_State **reset_elements( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); -#ifndef IND_LIST_DYN + void indices_to_serial_generic( const Indice *ind_list, /* i : indices list */ const Word16 num_indices, /* i : number of indices to write */ UWord8 *pFrame, /* o : byte array with bit packet and byte aligned coded speech data */ Word16 *pFrame_size /* o : size of the binary encoded access unit [bits] */ ); -#endif void convertSerialToBytestream( const uint16_t *const serial, /* i : input serial bitstream with values 0 and 1 */ @@ -2255,25 +2224,19 @@ void read_next_force( ); #endif ivas_error init_encoder( - Encoder_State *st, /* i/o: state structure */ -#ifdef IND_LIST_DYN - ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : encoder configuration handle */ -#endif - const int16_t idchan, /* i : channel ID */ - const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ + Encoder_State *st, /* i/o: state structure */ + const int16_t idchan, /* i : channel ID */ + const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ const int16_t interval_SID, /* i : interval for SID update */ - const int16_t vad_only_flag /* i : flag to indicate front-VAD structure */ -#ifdef PARAM_ISM_DTX_CNG - , - const ISM_MODE ism_mode /* i : ISM mode */ -#endif + const int16_t vad_only_flag, /* i : flag to indicate front-VAD structure */ + const ISM_MODE ism_mode /* i : ISM mode */ ); void LPDmem_enc_init( LPD_state_HANDLE hLPDmem /* i/o: LP memories */ ); -void destroy_encoder( +void destroy_cldfb_encoder( Encoder_State *st /* i/o: state structure */ ); ivas_error evs_enc( @@ -3864,8 +3827,13 @@ void bw_detect( const float signal_in[], /* i : input signal */ float *spectrum, /* i : MDCT spectrum */ const float *enerBuffer /* i : energy buffer */ +#ifdef FIX_MDCT_BASED_BWD + , + const int16_t mct_on /* i : flag MCT mode */ +#endif ); + void set_bw( const int16_t element_mode, /* i : element mode */ const int32_t element_brate, /* i : element bitrate */ @@ -5157,7 +5125,7 @@ ivas_error init_decoder( const MC_MODE mc_mode /* i : MC mode */ ); -void destroy_decoder( +void destroy_cldfb_decoder( Decoder_State *st /* o : Decoder static variables structure */ ); @@ -8555,13 +8523,10 @@ void generate_comfort_noise_dec( ); void generate_comfort_noise_dec_hf( - float **bufferReal, /* o : Real part of input bands */ - float **bufferImag, /* o : Imaginary part of input bands */ - HANDLE_FD_CNG_COM hFdCngCom /* i/o: FD_CNG structure containing all buffers and variables */ -#ifdef PARAM_ISM_DTX_CNG - , - const int16_t cng_flag /*i : CNG Flag */ -#endif + float **bufferReal, /* o : Real part of input bands */ + float **bufferImag, /* o : Imaginary part of input bands */ + HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ + const int16_t cng_flag /* i : CNG Flag */ ); void generate_masking_noise( diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index 571311ed12..eb53379d66 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -512,11 +512,7 @@ ivas_error acelp_core_dec( } else { -#ifdef PARAM_ISM_DTX_CNG if ( st->core_brate == SID_2k40 && st->element_mode != IVAS_CPE_MDCT && st->read_sid_info ) -#else - if ( st->core_brate == SID_2k40 && st->element_mode != IVAS_CPE_MDCT ) -#endif { FdCng_decodeSID( st ); *sid_bw = 0; @@ -532,9 +528,8 @@ ivas_error acelp_core_dec( } ApplyFdCng( syn, NULL, realBuffer, imagBuffer, st, 0, ( st->coder_type == AUDIO && !st->GSC_noisy_speech ) ); } -#ifdef PARAM_ISM_DTX_CNG if ( !st->read_sid_info ) - // if (!st->read_sid_info && st->cng_paramISM_flag) /* read_sid_info can only be 0 in ParamISM mode */ + // if (!st->read_sid_info && st->cng_ism_flag) /* read_sid_info can only be 0 in ParamISM mode */ { float noise_lvl_highest; @@ -544,7 +539,6 @@ ivas_error acelp_core_dec( st->hFdCngDec->hFdCngCom->cngNoiseLevel[b] = noise_lvl_highest; } } -#endif generate_comfort_noise_dec( NULL, NULL, st, nchan_out ); @@ -1131,11 +1125,7 @@ ivas_error acelp_core_dec( st->lp_noise = st->hFdCngDec->lp_noise; } -#ifdef PARAM_ISM_DTX_CNG - if ( st->element_mode != IVAS_CPE_TD && !st->cng_paramISM_flag ) -#else - if ( st->element_mode != IVAS_CPE_TD ) -#endif + if ( st->element_mode != IVAS_CPE_TD && !st->cng_ism_flag ) { /*Noise estimate*/ ApplyFdCng( syn, NULL, realBuffer, imagBuffer, st, 0, ( st->coder_type == AUDIO && !st->GSC_noisy_speech ) ); @@ -1311,11 +1301,7 @@ ivas_error acelp_core_dec( /*WB/SWB-FD_CNG*/ if ( ( st->core_brate == FRAME_NO_DATA || st->core_brate == SID_2k40 ) && ( st->cng_type == FD_CNG ) && ( st->hFdCngDec->hFdCngCom->numCoreBands < st->cldfbSyn->no_channels ) ) { -#ifdef PARAM_ISM_DTX_CNG - generate_comfort_noise_dec_hf( realBuffer, imagBuffer, st->hFdCngDec->hFdCngCom, st->cng_paramISM_flag ); -#else - generate_comfort_noise_dec_hf( realBuffer, imagBuffer, st->hFdCngDec->hFdCngCom ); -#endif + generate_comfort_noise_dec_hf( realBuffer, imagBuffer, st->hFdCngDec->hFdCngCom, st->cng_ism_flag ); if ( st->hFdCngDec->hFdCngCom->regularStopBand < st->cldfbSyn->no_channels ) { diff --git a/lib_dec/fd_cng_dec.c b/lib_dec/fd_cng_dec.c index 515188369c..ab9465a93a 100644 --- a/lib_dec/fd_cng_dec.c +++ b/lib_dec/fd_cng_dec.c @@ -420,6 +420,7 @@ void ApplyFdCng( hFdCngCom->sid_frame_counter = 0; /* set noise estimation inactive during concealment, as no update with noise generated by concealment should be performed. */ /* set noise estimation inactive when we have bit errors, as no update with noise generated by corrupt frame (biterror) should be performed. */ +#ifndef DISCRETE_ISM_DTX_CNG if ( concealWholeFrame == 0 && ( timeDomainInput == NULL || ( *timeDomainInput( -FLT_MAX ) && @@ -429,6 +430,17 @@ void ApplyFdCng( !( st->cng_type == LP_CNG && hFdCngDec->flag_dtx_mode ) && ( is_music == 0 ) ) || ( st->element_mode == IVAS_CPE_TD ) ) && ( !st->BER_detect ) ) +#else + if ( concealWholeFrame == 0 && + ( timeDomainInput == NULL || + ( *timeDomainInput( -FLT_MAX ) && + *( timeDomainInput + hFdCngCom->frameSize - 1 ) < FLT_MAX && + *( timeDomainInput + hFdCngCom->frameSize - 1 ) > ( -FLT_MAX ) ) ) && + ( ( ( ( st->element_mode != IVAS_CPE_TD && st->element_mode != IVAS_CPE_DFT && hFdCngDec->flag_dtx_mode ) || !st->VAD || ( st->ini_frame < 100 && st->is_ism_format ) ) && + !( st->cng_type == LP_CNG && hFdCngDec->flag_dtx_mode ) && ( is_music == 0 ) ) || + ( st->element_mode == IVAS_CPE_TD ) ) && + ( !st->BER_detect ) ) +#endif { /* Perform noise estimation at the decoder */ perform_noise_estimation_dec( timeDomainInput, powerSpectrum, hFdCngDec, st->element_mode, st->bwidth, L_frame, last_L_frame, st->last_core_brate, st->VAD ); @@ -1091,11 +1103,7 @@ void generate_comfort_noise_dec( c2 = (float) sqrt( 1 - hFdCngCom->coherence ); seed2 = &( hFdCngCom->seed2 ); -#ifdef PARAM_ISM_DTX_CNG - if ( ( st->element_mode == IVAS_CPE_MDCT && st->idchan == 1 ) || ( st->element_mode == IVAS_SCE && st->cng_paramISM_flag ) ) -#else - if ( st->element_mode == IVAS_CPE_MDCT && st->idchan == 1 ) -#endif + if ( ( st->element_mode == IVAS_CPE_MDCT && st->idchan == 1 ) || ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) ) { seed2 = &( hFdCngCom->seed3 ); } @@ -1105,11 +1113,7 @@ void generate_comfort_noise_dec( if ( hFdCngCom->startBand == 0 ) { -#ifdef PARAM_ISM_DTX_CNG - if ( st->element_mode == IVAS_CPE_MDCT || ( st->element_mode == IVAS_SCE && st->cng_paramISM_flag ) ) -#else - if ( st->element_mode == IVAS_CPE_MDCT ) -#endif + if ( st->element_mode == IVAS_CPE_MDCT || ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) ) { rand_gauss( &tmp1, seed ); rand_gauss( &tmp2, seed2 ); @@ -1134,11 +1138,7 @@ void generate_comfort_noise_dec( for ( ; ptr_level < cngNoiseLevel + hFdCngCom->stopFFTbin - hFdCngCom->startBand; ptr_level++ ) { /* Real part in FFT bins */ -#ifdef PARAM_ISM_DTX_CNG - if ( st->element_mode == IVAS_CPE_MDCT || ( st->element_mode == IVAS_SCE && st->cng_paramISM_flag ) ) -#else - if ( st->element_mode == IVAS_CPE_MDCT ) -#endif + if ( st->element_mode == IVAS_CPE_MDCT || ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) ) { rand_gauss( &tmp1, seed ); rand_gauss( &tmp2, seed2 ); @@ -1152,11 +1152,7 @@ void generate_comfort_noise_dec( ptr_r += 2; /* Imaginary part in FFT bins */ -#ifdef PARAM_ISM_DTX_CNG - if ( st->element_mode == IVAS_CPE_MDCT || ( st->element_mode == IVAS_SCE && st->cng_paramISM_flag ) ) -#else - if ( st->element_mode == IVAS_CPE_MDCT ) -#endif + if ( st->element_mode == IVAS_CPE_MDCT || ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) ) { rand_gauss( &tmp1, seed ); rand_gauss( &tmp2, seed2 ); @@ -1234,11 +1230,7 @@ void generate_comfort_noise_dec( for ( i = 0; i < hFdCngCom->numSlots; i++ ) { /* Real part in CLDFB band */ -#ifdef PARAM_ISM_DTX_CNG - if ( st->element_mode == IVAS_CPE_MDCT || ( st->element_mode == IVAS_SCE && st->cng_paramISM_flag ) ) -#else - if ( st->element_mode == IVAS_CPE_MDCT ) -#endif + if ( st->element_mode == IVAS_CPE_MDCT || ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) ) { rand_gauss( &tmp1, seed ); rand_gauss( &tmp2, seed2 ); @@ -1251,11 +1243,7 @@ void generate_comfort_noise_dec( bufferReal[i][j] *= (float) sqrt( ( scaleCldfb * *ptr_level ) * 0.5f ); /* Imaginary part in CLDFB band */ -#ifdef PARAM_ISM_DTX_CNG - if ( st->element_mode == IVAS_CPE_MDCT || ( st->element_mode == IVAS_SCE && st->cng_paramISM_flag ) ) -#else - if ( st->element_mode == IVAS_CPE_MDCT ) -#endif + if ( st->element_mode == IVAS_CPE_MDCT || ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) ) { rand_gauss( &tmp1, seed ); rand_gauss( &tmp2, seed2 ); @@ -1352,13 +1340,10 @@ void generate_comfort_noise_dec( *-------------------------------------------------------------------*/ void generate_comfort_noise_dec_hf( - float **bufferReal, /* o : Real part of input bands */ - float **bufferImag, /* o : Imaginary part of input bands */ - HANDLE_FD_CNG_COM hFdCngCom /* i/o: FD_CNG structure containing all buffers and variables */ -#ifdef PARAM_ISM_DTX_CNG - , - const int16_t cng_coh_flag /* i : CNG Flag for coherence handling */ -#endif + float **bufferReal, /* o : Real part of input bands */ + float **bufferImag, /* o : Imaginary part of input bands */ + HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ + const int16_t cng_coh_flag /* i : CNG Flag for coherence handling */ ) { int16_t i, j; @@ -1367,7 +1352,6 @@ void generate_comfort_noise_dec_hf( int16_t *seed = &( hFdCngCom->seed ); float scale = CLDFB_SCALING / hFdCngCom->scalingFactor; -#ifdef PARAM_ISM_DTX_CNG int16_t *seed2 = &( hFdCngCom->seed ); float tmp1, tmp2, c1 = 0.f, c2 = 0.f; @@ -1375,10 +1359,9 @@ void generate_comfort_noise_dec_hf( { seed2 = &( hFdCngCom->seed3 ); - c1 = (float) sqrt( hFdCngCom->coherence ); + c1 = (float) sqrt( hFdCngCom->coherence ); // VE!!!!! all occurences of "(float) sqrt()" should be replaced by "sqrtf()" c2 = (float) sqrt( 1 - hFdCngCom->coherence ); } -#endif ptr_level = hFdCngCom->cngNoiseLevel + hFdCngCom->stopFFTbin - hFdCngCom->startBand; /* @@ -1391,7 +1374,6 @@ void generate_comfort_noise_dec_hf( { for ( i = 0; i < hFdCngCom->numSlots; i++ ) { -#ifdef PARAM_ISM_DTX_CNG if ( cng_coh_flag ) { /* Real part in CLDFB band */ @@ -1415,14 +1397,6 @@ void generate_comfort_noise_dec_hf( rand_gauss( &bufferImag[i][j], seed ); bufferImag[i][j] *= (float) sqrt( ( scale * *ptr_level ) * 0.5f ); } -#else - /* Real part in CLDFB band */ - rand_gauss( &bufferReal[i][j], seed ); - bufferReal[i][j] *= (float) sqrt( ( scale * *ptr_level ) * 0.5f ); - /* Imaginary part in CLDFB band */ - rand_gauss( &bufferImag[i][j], seed ); - bufferImag[i][j] *= (float) sqrt( ( scale * *ptr_level ) * 0.5f ); -#endif } ptr_level++; } diff --git a/lib_dec/init_dec.c b/lib_dec/init_dec.c index 402fdc78f5..34ee7a3cec 100644 --- a/lib_dec/init_dec.c +++ b/lib_dec/init_dec.c @@ -738,9 +738,10 @@ ivas_error init_decoder( st->tdm_LRTD_flag = 0; st->cna_dirac_flag = 0; st->cng_sba_flag = 0; -#ifdef PARAM_ISM_DTX_CNG - st->cng_paramISM_flag = 0; + st->cng_ism_flag = 0; st->read_sid_info = 1; /* by default read the sid info from bitstream */ +#ifdef DISCRETE_ISM_DTX_CNG + st->is_ism_format = 0; #endif @@ -772,12 +773,12 @@ void reset_preecho_dec( /*----------------------------------------------------------------------* - * destroy_decoder() + * destroy_cldfb_decoder() * * Free memory which was allocated in init_decoder() *----------------------------------------------------------------------*/ -void destroy_decoder( +void destroy_cldfb_decoder( Decoder_State *st /* o : Decoder static variables structure */ ) { diff --git a/lib_dec/ivas_agc_dec.c b/lib_dec/ivas_agc_dec.c index 1397ce1111..72ae68a57b 100644 --- a/lib_dec/ivas_agc_dec.c +++ b/lib_dec/ivas_agc_dec.c @@ -142,22 +142,24 @@ void ivas_spar_agc_dec_close( { ivas_agc_dec_state_t *hAgc; + if ( hAgcDec == NULL || *hAgcDec == NULL ) + { + return; + } + hAgc = *hAgcDec; - if ( hAgc != NULL ) - { - free( hAgc->agc_com.winFunc ); - hAgc->agc_com.winFunc = NULL; + free( hAgc->agc_com.winFunc ); + hAgc->agc_com.winFunc = NULL; - free( hAgc->gain_state ); - hAgc->gain_state = NULL; + free( hAgc->gain_state ); + hAgc->gain_state = NULL; - free( hAgc->gain_data ); - hAgc->gain_data = NULL; + free( hAgc->gain_data ); + hAgc->gain_data = NULL; - free( hAgc ); - *hAgcDec = NULL; - } + free( *hAgcDec ); + *hAgcDec = NULL; return; } diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 9fcb85ac0c..2db5602519 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -866,8 +866,6 @@ void ivas_binaural_add_LFE( if ( render_lfe ) { -#ifdef FIX_197_CREND_INTERFACE -#ifdef FIX_329_ENABLE_TD_RENDERER_REVERB_MC if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) { gain = GAIN_LFE; @@ -876,12 +874,6 @@ void ivas_binaural_add_LFE( { gain = ( ( st_ivas->hCrendWrapper != NULL ) && ( st_ivas->hCrendWrapper->hHrtfCrend != NULL ) ) ? st_ivas->hCrendWrapper->hHrtfCrend->gain_lfe : GAIN_LFE; } -#else - gain = ( ( st_ivas->hCrendWrapper != NULL ) && ( st_ivas->hCrendWrapper->hHrtfCrend != NULL ) ) ? st_ivas->hCrendWrapper->hHrtfCrend->gain_lfe : GAIN_LFE; -#endif -#else - gain = st_ivas->hHrtf != NULL ? st_ivas->hHrtf->gain_lfe : GAIN_LFE; -#endif for ( idx_lfe = 0; idx_lfe < st_ivas->hIntSetup.num_lfe; idx_lfe++ ) { v_multc( output_f[st_ivas->hIntSetup.index_lfe[idx_lfe]], gain, output_f[st_ivas->hIntSetup.index_lfe[idx_lfe]], output_frame ); @@ -1012,7 +1004,6 @@ void ivas_binRenderer( if ( hHeadTrackData->shd_rot_max_order == -1 ) { QuatToRotMat( hHeadTrackData->Quaternions[hHeadTrackData->num_quaternions++], hHeadTrackData->Rmat ); - rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hHeadTrackData->Rmat, hBinRenderer->hInputSetup->nchan_out_woLFE, 3 ); } else if ( hHeadTrackData->shd_rot_max_order > 0 ) diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 49429e0381..0811f9957a 100755 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -240,11 +240,7 @@ ivas_error ivas_core_dec( hCPE->hStereoCng->flag_cna_fade = 0; } -#ifdef FIX_347_DTX_CRASH if ( sba_dirac_stereo_flag && hSCE && sts[0]->total_brate <= SID_2k40 && sts[0]->cng_type == FD_CNG ) -#else - if ( sba_dirac_stereo_flag && sts[0]->total_brate <= SID_2k40 && sts[0]->cng_type == FD_CNG ) -#endif { save_hb_synth = hSCE->save_hb_synth; } @@ -345,11 +341,12 @@ ivas_error ivas_core_dec( if ( ( st->core == TCX_20_CORE || st->core == TCX_10_CORE ) && st->element_mode != IVAS_CPE_MDCT ) { /* TCX decoder */ -#ifdef PARAM_ISM_DTX_CNG - stereo_tcx_core_dec( st, frameMode[n], output[n], synth[n], pitch_buf[n], sba_dirac_stereo_flag, hStereoTD, last_element_mode, flag_sec_CNA, hCPE == NULL ? NULL : hCPE->hStereoCng, nchan_out, st_ivas == NULL ? 0 : st_ivas->ivas_format, st_ivas == NULL ? 0 : st_ivas->ism_mode ); -#else - stereo_tcx_core_dec( st, frameMode[n], output[n], synth[n], pitch_buf[n], sba_dirac_stereo_flag, hStereoTD, last_element_mode, flag_sec_CNA, hCPE == NULL ? NULL : hCPE->hStereoCng, nchan_out ); + stereo_tcx_core_dec( st, frameMode[n], output[n], synth[n], pitch_buf[n], sba_dirac_stereo_flag, hStereoTD, last_element_mode, flag_sec_CNA, hCPE == NULL ? NULL : hCPE->hStereoCng, nchan_out, st_ivas == NULL ? 0 : st_ivas->ivas_format +#ifndef DISCRETE_ISM_DTX_CNG + , + st_ivas == NULL ? 0 : st_ivas->ism_mode #endif + ); } if ( st->core == HQ_CORE ) @@ -461,11 +458,7 @@ ivas_error ivas_core_dec( /* for FD-CNG we need the delay compensation in the synth, so do this afterwards */ -#ifdef FIX_347_DTX_CRASH if ( sba_dirac_stereo_flag && hSCE && st->core_brate == SID_2k40 && st->cng_type == FD_CNG ) -#else - if ( sba_dirac_stereo_flag && st->core_brate == SID_2k40 && st->cng_type == FD_CNG ) -#endif { mvr2r( synth[n], hSCE->save_synth, output_frame ); } diff --git a/lib_dec/ivas_corecoder_dec_reconfig.c b/lib_dec/ivas_corecoder_dec_reconfig.c index 492339d6d6..a066164da4 100644 --- a/lib_dec/ivas_corecoder_dec_reconfig.c +++ b/lib_dec/ivas_corecoder_dec_reconfig.c @@ -453,7 +453,6 @@ ivas_error ivas_cldfb_dec_reconfig( if ( st_ivas->ivas_format == SBA_FORMAT && nchan_transport_old == 1 && numCldfbAnalyses_old == 2 && st_ivas->nchan_transport > 1 ) { deleteCldfb( &( st_ivas->cldfbAnaDec[1] ) ); - st_ivas->cldfbAnaDec[1] = NULL; numCldfbAnalyses_old--; } @@ -473,7 +472,6 @@ ivas_error ivas_cldfb_dec_reconfig( for ( i = numCldfbAnalyses; i < numCldfbAnalyses_old; i++ ) { deleteCldfb( &( st_ivas->cldfbAnaDec[i] ) ); - st_ivas->cldfbAnaDec[i] = NULL; } } else if ( numCldfbAnalyses_old < numCldfbAnalyses ) @@ -495,7 +493,6 @@ ivas_error ivas_cldfb_dec_reconfig( for ( i = numCldfbSyntheses; i < numCldfbSyntheses_old; i++ ) { deleteCldfb( &( st_ivas->cldfbSynDec[i] ) ); - st_ivas->cldfbSynDec[i] = NULL; } } else if ( numCldfbSyntheses_old < numCldfbSyntheses ) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index ca4666ae76..0983aee6cb 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -140,7 +140,6 @@ ivas_error ivas_dec( else if ( st_ivas->ivas_format == ISM_FORMAT ) { /* Metadata decoding and configuration */ -#ifdef PARAM_ISM_DTX_CNG if ( ivas_total_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) { if ( ( error = ivas_ism_dtx_dec( st_ivas, nb_bits_metadata ) ) != IVAS_ERR_OK ) @@ -148,15 +147,44 @@ ivas_error ivas_dec( return error; } } - else -#endif - if ( st_ivas->ism_mode == ISM_MODE_PARAM ) + else if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { + // VE: call ivas_ism_metadata_dec() with 'st_ivas' - TBD +#ifdef DISCRETE_ISM_DTX_CNG +#ifdef NCHAN_ISM_PARAMETER + if ( ( error = ivas_ism_metadata_dec( ivas_total_brate, st_ivas->nchan_ism, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, st_ivas->hDirAC->hParamIsm ) ) != IVAS_ERR_OK ) +#else + if ( ( error = ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, st_ivas->hDirAC->hParamIsm ) ) != IVAS_ERR_OK ) +#endif + { + return error; + } +#else +#ifdef NCHAN_ISM_PARAMETER + ivas_ism_metadata_dec( ivas_total_brate, st_ivas->nchan_ism, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm ); +#else ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm ); +#endif +#endif } else /* ISM_MODE_DISC */ { +#ifdef DISCRETE_ISM_DTX_CNG +#ifdef NCHAN_ISM_PARAMETER + if ( ( error = ivas_ism_metadata_dec( ivas_total_brate, st_ivas->nchan_ism, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, NULL ) ) != IVAS_ERR_OK ) +#else + if ( ( error = ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, NULL ) ) != IVAS_ERR_OK ) +#endif + { + return error; + } +#else +#ifdef NCHAN_ISM_PARAMETER + ivas_ism_metadata_dec( ivas_total_brate, st_ivas->nchan_ism, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, NULL ); +#else ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, NULL ); +#endif +#endif } for ( n = 0; n < st_ivas->nchan_transport; n++ ) @@ -209,7 +237,11 @@ ivas_error ivas_dec( else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) { /* Convert to Ambisonics; used also for ISM->HOA3->binaural rendering */ +#ifdef NCHAN_ISM_PARAMETER + ivas_ism2sba( output, st_ivas->hIsmRendererData, st_ivas->hIsmMetaData, st_ivas->nchan_ism, output_frame, st_ivas->hIntSetup.ambisonics_order ); +#else ivas_ism2sba( output, st_ivas->hIsmRendererData, st_ivas->hIsmMetaData, st_ivas->nchan_transport, output_frame, st_ivas->hIntSetup.ambisonics_order ); +#endif } /* Binaural rendering */ @@ -222,14 +254,10 @@ ivas_error ivas_dec( } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { -#ifdef FIX_197_CREND_INTERFACE if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM, NULL, NULL, NULL, NULL, output, output_Fs ) ) != IVAS_ERR_OK ) { return error; } -#else - ivas_crend_process( st_ivas, output ); -#endif ivas_binaural_add_LFE( st_ivas, output_frame, output ); } #ifdef DEBUGGING @@ -433,14 +461,10 @@ ivas_error ivas_dec( /* Rendering */ if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { -#ifdef FIX_197_CREND_INTERFACE if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hHeadTrackData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, output, output_Fs ) ) != IVAS_ERR_OK ) { return error; } -#else - ivas_crend_process( st_ivas, output ); -#endif ivas_binaural_add_LFE( st_ivas, output_frame, output ); } diff --git a/lib_dec/ivas_decision_matrix_dec.c b/lib_dec/ivas_decision_matrix_dec.c index 2a99953d23..e5be65ae24 100644 --- a/lib_dec/ivas_decision_matrix_dec.c +++ b/lib_dec/ivas_decision_matrix_dec.c @@ -134,7 +134,7 @@ void ivas_decision_matrix_dec( } else if ( st->element_mode == IVAS_SCE && st->low_rate_mode ) { - /* ISm Low-rate mode -> always WB, ACELP core, IC coder_type */ + /* ISM Low-rate mode -> always WB, ACELP core, IC coder_type */ st->core = ACELP_CORE; } else if ( st->element_mode == IVAS_CPE_MDCT ) @@ -167,7 +167,7 @@ void ivas_decision_matrix_dec( { if ( st->element_mode == IVAS_SCE && st->low_rate_mode ) { - /* ISm Low-rate mode */ + /* ISM Low-rate mode */ st->bwidth = WB; st->coder_type = INACTIVE; *sharpFlag = 0; diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 649cd43b5c..4d3d1adb3c 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -593,10 +593,11 @@ ivas_error ivas_dirac_dec_config( if ( hDirAC->panningConf == DIRAC_PANNING_VBAP ) { - if ( flag_config == DIRAC_RECONFIGURE && st_ivas->hVBAPdata ) + if ( flag_config == DIRAC_RECONFIGURE && st_ivas->hVBAPdata != NULL ) { vbap_free_data( &( st_ivas->hVBAPdata ) ); } + if ( ( error = vbap_init_data( &( st_ivas->hVBAPdata ), ls_azimuth, ls_elevation, nchan_out_woLFE ) ) != IVAS_ERR_OK ) { return error; @@ -604,13 +605,13 @@ ivas_error ivas_dirac_dec_config( } else if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_MONO ) { - if ( flag_config == DIRAC_RECONFIGURE && st_ivas->hVBAPdata ) + if ( flag_config == DIRAC_RECONFIGURE && st_ivas->hVBAPdata != NULL ) { vbap_free_data( &( st_ivas->hVBAPdata ) ); } hDirAC->hoa_decoder = NULL; } - else if ( flag_config == DIRAC_RECONFIGURE && st_ivas->hVBAPdata ) + else if ( flag_config == DIRAC_RECONFIGURE && st_ivas->hVBAPdata != NULL ) { vbap_free_data( &( st_ivas->hVBAPdata ) ); } @@ -1002,10 +1003,18 @@ ivas_error ivas_dirac_dec_config( *------------------------------------------------------------------------*/ void ivas_dirac_dec_close( - DIRAC_DEC_HANDLE hDirAC /* i/o: decoder DirAC handle */ + DIRAC_DEC_HANDLE *hDirAC_out /* i/o: decoder DirAC handle */ ) { int16_t i, j; + DIRAC_DEC_HANDLE hDirAC; + + if ( hDirAC_out == NULL || *hDirAC_out == NULL ) + { + return; + } + + hDirAC = *hDirAC_out; /* Config & CLDFB */ if ( hDirAC->hConfig != NULL ) @@ -1225,7 +1234,8 @@ void ivas_dirac_dec_close( ivas_dirac_free_mem( &( hDirAC->stack_mem ) ); - free( hDirAC ); + free( *hDirAC_out ); + *hDirAC_out = NULL; return; } @@ -2096,6 +2106,7 @@ void ivas_dirac_dec( float *reference_power, *reference_power_smooth; float *onset_filter, *onset_filter_subframe, *p_onset_filter = NULL; uint16_t coherence_flag; + push_wmops( "ivas_dirac_dec" ); /* Initialize aux buffers */ diff --git a/lib_dec/ivas_dirac_output_synthesis_cov.c b/lib_dec/ivas_dirac_output_synthesis_cov.c index 6a79d4563a..a2fc9ee821 100644 --- a/lib_dec/ivas_dirac_output_synthesis_cov.c +++ b/lib_dec/ivas_dirac_output_synthesis_cov.c @@ -190,7 +190,6 @@ void ivas_dirac_dec_output_synthesis_cov_close( DIRAC_OUTPUT_SYNTHESIS_COV_STATE *h_dirac_output_synthesis_state /* i/o: handle for the covariance synthesis state */ ) { - int16_t idx; /*-----------------------------------------------------------------* diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 25813f34b2..bc0a69ae56 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -66,7 +66,7 @@ ivas_error ivas_dec_setup( ) { int16_t k, idx, num_bits_read; - int16_t num_obj, element_mode_flag; + int16_t nchan_ism, element_mode_flag; Decoder_State *st; int32_t ivas_total_brate; ivas_error error; @@ -102,15 +102,34 @@ ivas_error ivas_dec_setup( { /* read the number of objects */ st_ivas->nchan_transport = 1; - num_obj = 1; + nchan_ism = 1; k = (int16_t) ( ( ivas_total_brate / FRAMES_PER_SEC ) - 1 ); - while ( st_ivas->bit_stream[k] && num_obj < MAX_NUM_OBJECTS ) + while ( st_ivas->bit_stream[k] && nchan_ism < MAX_NUM_OBJECTS ) { - num_obj++; + nchan_ism++; k--; } - ivas_ism_dec_config( st_ivas, num_obj ); +#ifdef NCHAN_ISM_PARAMETER + st_ivas->nchan_ism = nchan_ism; +#endif + +#ifdef DISCRETE_ISM_DTX_CNG +#ifdef NCHAN_ISM_PARAMETER + if ( ( error = ivas_ism_dec_config( st_ivas, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) +#else + if ( ( error = ivas_ism_dec_config( st_ivas, st_ivas->ism_mode, nchan_ism ) ) != IVAS_ERR_OK ) +#endif + { + return error; + } +#else +#ifdef NCHAN_ISM_PARAMETER + ivas_ism_dec_config( st_ivas ); +#else + ivas_ism_dec_config( st_ivas, nchan_ism ); +#endif +#endif } else if ( st_ivas->ivas_format == SBA_FORMAT ) { @@ -223,6 +242,11 @@ ivas_error ivas_dec_setup( case SID_MDCT_STEREO: st_ivas->element_mode_init = IVAS_CPE_MDCT; break; +#ifdef DISCRETE_ISM_DTX_CNG + case SID_ISM: + st_ivas->element_mode_init = IVAS_SCE; + break; +#endif case SID_MASA_1TC: st_ivas->element_mode_init = IVAS_SCE; st_ivas->nchan_transport = 1; @@ -402,19 +426,26 @@ static ivas_error ivas_read_format( break; case SID_ISM: st_ivas->ivas_format = ISM_FORMAT; -#ifdef PARAM_ISM_DTX_CNG - +#ifndef DISCRETE_ISM_DTX_CNG if ( st_ivas->ism_mode == ISM_MODE_DISC ) { - ivas_ism_dec_config( st_ivas, 1 ); /* currently DTX supported for 1 ISM when ISM Mode is DISC_ISM */ + ivas_ism_dec_config( st_ivas +#ifndef NCHAN_ISM_PARAMETER + , + 1 +#endif + ); /* currently DTX supported for 1 ISM when ISM Mode is DISC_ISM */ } if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { - ivas_ism_dec_config( st_ivas, st_ivas->nSCE ); /* for Param-ISM, we need to generate 2 TCs */ + ivas_ism_dec_config( st_ivas +#ifndef NCHAN_ISM_PARAMETER + , + st_ivas->nSCE +#endif + ); /* for Param-ISM, we need to generate 2 TCs */ } -#else - ivas_ism_dec_config( st_ivas, 1 ); /* currently DTX supported for 1ISM only */ #endif break; case SID_MULTICHANNEL: @@ -756,6 +787,57 @@ ivas_error ivas_init_decoder( } } +#ifdef FIX_I109_ORIENTATION_TRACKING + /*-----------------------------------------------------------------* + * Set head/orientation tracking + *-----------------------------------------------------------------*/ + + if ( st_ivas->hDecoderConfig->Opt_Headrotation ) + { + if ( st_ivas->hDecoderConfig->orientation_tracking == IVAS_ORIENT_TRK_NONE ) + { + if ( ( error = ivas_orient_trk_SetTrackingType( st_ivas->hHeadTrackData->OrientationTracker, OTR_TRACKING_NONE ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else if ( st_ivas->hDecoderConfig->orientation_tracking == IVAS_ORIENT_TRK_AVG ) + { + if ( ( error = ivas_orient_trk_SetTrackingType( st_ivas->hHeadTrackData->OrientationTracker, OTR_TRACKING_AVG_ORIENT ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else if ( st_ivas->hDecoderConfig->orientation_tracking == IVAS_ORIENT_TRK_REF ) + { + if ( ( error = ivas_orient_trk_SetTrackingType( st_ivas->hHeadTrackData->OrientationTracker, OTR_TRACKING_REF_ORIENT ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#ifdef OTR_REFERENCE_VECTOR_TRACKING + else if ( st_ivas->hDecoderConfig->orientation_tracking == IVAS_ORIENT_TRK_REF_VEC ) + { + if ( ( error = ivas_orient_trk_SetTrackingType( st_ivas->hHeadTrackData->OrientationTracker, OTR_TRACKING_REF_VEC ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else if ( st_ivas->hDecoderConfig->orientation_tracking == IVAS_ORIENT_TRK_REF_VEC_LEV ) + { + if ( ( error = ivas_orient_trk_SetTrackingType( st_ivas->hHeadTrackData->OrientationTracker, OTR_TRACKING_REF_VEC_LEV ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else + { + return IVAS_ERR_WRONG_MODE; + } +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ + } +#endif + /*-----------------------------------------------------------------* * Allocate and initialize SCE/CPE and other handles *-----------------------------------------------------------------*/ @@ -813,8 +895,8 @@ ivas_error ivas_init_decoder( if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { - st_ivas->nchan_transport = 2; - st_ivas->nSCE = 2; + st_ivas->nchan_transport = MAX_PARAM_ISM_WAVE; + st_ivas->nSCE = MAX_PARAM_ISM_WAVE; if ( ( error = ivas_param_ism_dec_open( st_ivas ) ) != IVAS_ERR_OK ) { @@ -835,14 +917,16 @@ ivas_error ivas_init_decoder( } reset_indices_dec( st_ivas->hSCE[sce_id]->hCoreCoder[0] ); + +#ifdef DISCRETE_ISM_DTX_CNG + st_ivas->hSCE[sce_id]->hCoreCoder[0]->is_ism_format = 1; +#endif } -#ifdef PARAM_ISM_DTX_CNG if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { st_ivas->hSCE[1]->hCoreCoder[0]->hFdCngDec->hFdCngCom->seed3 = st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->seed2; } -#endif } else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) { @@ -863,11 +947,7 @@ ivas_error ivas_init_decoder( { if ( st_ivas->sba_mode == SBA_MODE_SPAR ) { -#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_spar_dec_open( st_ivas, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_spar_dec_open( st_ivas ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1226,29 +1306,10 @@ ivas_error ivas_init_decoder( if ( st_ivas->hRenderConfig->roomAcoustics.late_reverb_on ) { -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hDecoderConfig->output_config, NULL, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { return error; } -#else -#ifdef FIX_197_CREND_INTERFACE -#ifdef FIX_329_ENABLE_TD_RENDERER_REVERB_MC - if ( ( error = ivas_rend_initCrendWrapper( &st_ivas->hCrendWrapper ) ) != IVAS_ERR_OK ) -#else - if ( ( st_ivas->hCrendWrapper = (CREND_WRAPPER_HANDLE) malloc( sizeof( CREND_WRAPPER ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend Wrapper\n" ); - } - if ( ( st_ivas->hCrendWrapper->hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL ) -#endif -#else - if ( ( st_ivas->hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL ) -#endif - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend\n" ); - } -#endif } } else if ( st_ivas->renderer_type == RENDERER_MC ) @@ -1267,7 +1328,6 @@ ivas_error ivas_init_decoder( } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { -#ifdef FIX_197_CREND_INTERFACE if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM && st_ivas->ivas_format == MC_FORMAT && st_ivas->hDecoderConfig->Opt_Headrotation ) { if ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth, st_ivas->hIntSetup.ls_elevation, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK ) @@ -1276,19 +1336,18 @@ ivas_error ivas_init_decoder( } } +#ifdef FIX_I109_ORIENTATION_TRACKING + if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, + st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->Opt_Headrotation, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) +#endif { return error; } st_ivas->binaural_latency_ns = st_ivas->hCrendWrapper->binaural_latency_ns; -#else - if ( ivas_crend_open( st_ivas ) != IVAS_ERR_OK ) - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "ivas_crend_open failed" ); - } -#endif } if ( st_ivas->ivas_format == ISM_FORMAT && @@ -1400,7 +1459,7 @@ void destroy_core_dec( DEC_CORE_HANDLE hCoreCoder /* i/o: core decoder structure */ ) { - destroy_decoder( hCoreCoder ); + destroy_cldfb_decoder( hCoreCoder ); if ( hCoreCoder->hGSCDec != NULL ) { @@ -1594,15 +1653,8 @@ void ivas_initialize_handles_dec( st_ivas->hIsmRendererData = NULL; st_ivas->hBinRendererTd = NULL; st_ivas->hMonoDmxRenderer = NULL; -#ifdef FIX_197_CREND_INTERFACE st_ivas->hCrendWrapper = NULL; -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND st_ivas->hReverb = NULL; -#endif -#else - st_ivas->hCrend = NULL; - st_ivas->hHrtf = NULL; -#endif st_ivas->hSetOfHRTF = NULL; st_ivas->hHrtfFastConv = NULL; st_ivas->hHrtfParambin = NULL; @@ -1627,7 +1679,7 @@ void ivas_destroy_dec( Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ ) { - int16_t i, n; + int16_t i; /* CLDFB handles */ for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) @@ -1635,7 +1687,6 @@ void ivas_destroy_dec( if ( st_ivas->cldfbAnaDec[i] != NULL ) { deleteCldfb( &( st_ivas->cldfbAnaDec[i] ) ); - st_ivas->cldfbAnaDec[i] = NULL; } } @@ -1644,7 +1695,6 @@ void ivas_destroy_dec( if ( st_ivas->cldfbSynDec[i] != NULL ) { deleteCldfb( &( st_ivas->cldfbSynDec[i] ) ); - st_ivas->cldfbSynDec[i] = NULL; } } @@ -1674,13 +1724,6 @@ void ivas_destroy_dec( } } - /* LFE handle */ - if ( st_ivas->hLFE != NULL ) - { - ivas_lfe_dec_close( st_ivas->hLFE ); - st_ivas->hLFE = NULL; - } - /* HP20 filter handles */ if ( st_ivas->mem_hp20_out != NULL ) { @@ -1694,16 +1737,9 @@ void ivas_destroy_dec( } /* ISM metadata handles */ - for ( n = 0; n < MAX_NUM_OBJECTS; n++ ) - { - if ( st_ivas->hIsmMetaData[n] != NULL ) - { - free( st_ivas->hIsmMetaData[n] ); - st_ivas->hIsmMetaData[n] = NULL; - } - } + ivas_ism_metadata_close( st_ivas->hIsmMetaData ); - /* ISm renderer handle */ + /* ISM renderer handle */ if ( st_ivas->hIsmRendererData != NULL ) { free( st_ivas->hIsmRendererData ); @@ -1711,30 +1747,18 @@ void ivas_destroy_dec( } /* DirAC handle */ - if ( st_ivas->hDirAC != NULL ) + if ( st_ivas->ivas_format == ISM_FORMAT ) { - if ( st_ivas->ivas_format == ISM_FORMAT ) - { - ivas_param_ism_dec_close( st_ivas->hDirAC, st_ivas->hDecoderConfig->output_config ); - } - else - { - ivas_dirac_dec_close( st_ivas->hDirAC ); - } - st_ivas->hDirAC = NULL; + ivas_param_ism_dec_close( &( st_ivas->hDirAC ), st_ivas->hDecoderConfig->output_config ); } - - /* Spar handle */ - if ( st_ivas->hSpar != NULL ) + else { -#ifdef SBA_BR_SWITCHING_CLEAN_UP - ivas_spar_dec_close( st_ivas->hSpar, st_ivas->hDecoderConfig->output_Fs, 0 ); -#else - ivas_spar_dec_close( st_ivas->hSpar, st_ivas->hDecoderConfig->output_Fs ); -#endif - st_ivas->hSpar = NULL; + ivas_dirac_dec_close( &( st_ivas->hDirAC ) ); } + /* SPAR handle */ + ivas_spar_dec_close( &( st_ivas->hSpar ), st_ivas->hDecoderConfig->output_Fs, 0 ); + /* HOA decoder matrix */ if ( st_ivas->hoa_dec_mtx != NULL ) { @@ -1742,12 +1766,18 @@ void ivas_destroy_dec( st_ivas->hoa_dec_mtx = NULL; } + /* MASA decoder structure */ + ivas_masa_dec_close( &( st_ivas->hMasa ) ); + /* Qmetadata handle */ ivas_qmetadata_close( &st_ivas->hQMetaData ); /* MCT handle */ ivas_mct_dec_close( &st_ivas->hMCT ); + /* LFE handle */ + ivas_lfe_dec_close( &( st_ivas->hLFE ) ); + /* Parametric MC handle */ ivas_param_mc_dec_close( &st_ivas->hParamMC ); @@ -1764,15 +1794,10 @@ void ivas_destroy_dec( ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); /* Crend handle */ -#ifdef FIX_197_CREND_INTERFACE ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) ); -#else - ivas_crend_close( st_ivas ); -#endif -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND + /* Reverb handle */ ivas_reverb_close( &st_ivas->hReverb ); -#endif /* LS config converter handle */ ivas_ls_setup_conversion_close( &st_ivas->hLsSetUpConversion ); @@ -1784,13 +1809,6 @@ void ivas_destroy_dec( st_ivas->hLsSetupCustom = NULL; } - /* MASA decoder structure */ - if ( st_ivas->hMasa != NULL ) - { - ivas_masa_dec_close( st_ivas->hMasa ); - st_ivas->hMasa = NULL; - } - /* Downmix structure */ if ( st_ivas->hMonoDmxRenderer != NULL ) { @@ -1799,11 +1817,15 @@ void ivas_destroy_dec( } /* Head track data handle */ +#ifdef FIX_I109_ORIENTATION_TRACKING + ivas_headTrack_close( &st_ivas->hHeadTrackData ); +#else if ( st_ivas->hHeadTrackData != NULL ) { free( st_ivas->hHeadTrackData ); st_ivas->hHeadTrackData = NULL; } +#endif /* Time Domain binaural renderer handle */ if ( st_ivas->hBinRendererTd != NULL ) @@ -1818,22 +1840,13 @@ void ivas_destroy_dec( } /* CRend binaural renderer handle */ - if ( st_ivas->hSetOfHRTF != NULL ) - { - ivas_HRTF_CRend_binary_close( &st_ivas->hSetOfHRTF ); - } + ivas_HRTF_CRend_binary_close( &st_ivas->hSetOfHRTF ); /* Fastconv HRTF filters */ - if ( st_ivas->hHrtfFastConv != NULL ) - { - ivas_HRTF_fastconv_binary_close( &st_ivas->hHrtfFastConv ); - } + ivas_HRTF_fastconv_binary_close( &st_ivas->hHrtfFastConv ); /* Parametric binauralizer HRTF filters */ - if ( st_ivas->hHrtfParambin != NULL ) - { - ivas_HRTF_parambin_binary_close( &st_ivas->hHrtfParambin ); - } + ivas_HRTF_parambin_binary_close( &st_ivas->hHrtfParambin ); /* Config. Renderer */ ivas_render_config_close( &( st_ivas->hRenderConfig ) ); @@ -2064,7 +2077,7 @@ static ivas_error doSanityChecks_IVAS( /* Verify ISM output configuration */ if ( output_config == AUDIO_CONFIG_INVALID ) { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for ISm" ); + return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for ISM" ); } } else if ( st_ivas->ivas_format == SBA_FORMAT ) @@ -2100,20 +2113,6 @@ static ivas_error doSanityChecks_IVAS( } #ifdef DEBUGGING -#ifndef REMOVE_FORCE_SUBFRAME_BIN - if ( st_ivas->hDecoderConfig->forceSubframeBinauralization ) - { - /* Note about resolution of Binaural Renderers: * - * - Parametric Binaural Renderer: 20 ms by default, can be forced to subframe (5 ms) resolution * - * - FastConv Binaural Renderer: 5 ms by default * - * - TD objects Binaural Renderer: 20 ms by default */ - - if ( !( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM ) || !( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MC_FORMAT || st_ivas->ivas_format == ISM_FORMAT ) ) - { - return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Wrong set-up: Forced subframe resolution parametric binauralization activated for non-binaural output." ); - } - } -#endif if ( ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || output_config != AUDIO_CONFIG_BINAURAL || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode != MC_MODE_MCT ) ) ) { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration: Time Domain object renderer not supported in this configuration" ); diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 0bda9f5ae0..5e0b475e3e 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -49,8 +49,11 @@ static ivas_error ivas_ism_bitrate_switching( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const int16_t nchan_transport_old, /* i : last number of transport channels */ - const ISM_MODE last_ism_mode, /* i : last ISM mode */ - const int16_t num_obj /* i : number of objects in the bitstream */ + const ISM_MODE last_ism_mode /* i : last ISM mode */ +#ifndef NCHAN_ISM_PARAMETER + , + const int16_t num_obj /* i : number of objects in the bitstream */ +#endif ) { ivas_error error; @@ -62,7 +65,11 @@ static ivas_error ivas_ism_bitrate_switching( nCPE_old = st_ivas->nCPE; nSCE_old = st_ivas->nSCE; +#ifdef NCHAN_ISM_PARAMETER + if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->nchan_ism, NULL, NULL, NULL, element_brate_tmp, NULL, NULL ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, num_obj, NULL, NULL, NULL, element_brate_tmp, NULL, NULL ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -113,11 +120,7 @@ static ivas_error ivas_ism_bitrate_switching( if ( st_ivas->ism_mode == ISM_MODE_DISC && last_ism_mode == ISM_MODE_PARAM ) { /* Deallocate the ParamISM struct */ - if ( st_ivas->hDirAC != NULL ) - { - ivas_param_ism_dec_close( st_ivas->hDirAC, st_ivas->hDecoderConfig->output_config ); - st_ivas->hDirAC = NULL; - } + ivas_param_ism_dec_close( &( st_ivas->hDirAC ), st_ivas->hDecoderConfig->output_config ); if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL ) { @@ -151,12 +154,13 @@ static ivas_error ivas_ism_bitrate_switching( ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); /* Open Crend Binaural renderer */ -#ifdef FIX_197_CREND_INTERFACE if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, +#ifndef FIX_I109_ORIENTATION_TRACKING st_ivas->hDecoderConfig->Opt_Headrotation, +#endif st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { @@ -164,9 +168,6 @@ static ivas_error ivas_ism_bitrate_switching( } st_ivas->binaural_latency_ns = st_ivas->hCrendWrapper->binaural_latency_ns; -#else - ivas_crend_open( st_ivas ); -#endif } } @@ -227,16 +228,7 @@ static ivas_error ivas_ism_bitrate_switching( } /* close the crend binaural renderer */ -#ifdef FIX_197_CREND_INTERFACE ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) ); -#else - ivas_crend_close( st_ivas ); - - if ( st_ivas->hHrtf != NULL ) - { - st_ivas->hHrtf = NULL; - } -#endif } } @@ -251,14 +243,22 @@ static ivas_error ivas_ism_bitrate_switching( * - reconfigure the ISM format decoder *-------------------------------------------------------------------------*/ -/*! r : ISM format mode */ ivas_error ivas_ism_dec_config( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const int16_t num_obj /* i : number of objects in the bitstream */ + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ +#ifdef DISCRETE_ISM_DTX_CNG + , + const ISM_MODE last_ism_mode /* i/o: last ISM mode */ +#endif +#ifndef NCHAN_ISM_PARAMETER + , + const int16_t num_obj /* i : number of objects in the bitstream */ +#endif ) { int32_t ivas_total_brate; +#ifndef DISCRETE_ISM_DTX_CNG ISM_MODE last_ism_mode; +#endif ivas_error error; int16_t nchan_transport_old; @@ -266,11 +266,17 @@ ivas_error ivas_ism_dec_config( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; +#ifndef DISCRETE_ISM_DTX_CNG /* store last frame ISM mode */ last_ism_mode = st_ivas->ism_mode; +#endif /* Assumes that num of input objects are constant */ +#ifdef NCHAN_ISM_PARAMETER + nchan_transport_old = st_ivas->nchan_ism; +#else nchan_transport_old = num_obj; +#endif if ( last_ism_mode == ISM_MODE_PARAM ) { @@ -280,45 +286,103 @@ ivas_error ivas_ism_dec_config( if ( !st_ivas->bfi && ivas_total_brate != IVAS_SID_5k2 && ivas_total_brate != FRAME_NO_DATA ) { /* select ISM format mode */ +#ifdef NCHAN_ISM_PARAMETER + st_ivas->ism_mode = ivas_ism_mode_select( st_ivas->nchan_ism, ivas_total_brate ); + + st_ivas->nchan_transport = st_ivas->nchan_ism; +#else st_ivas->ism_mode = ivas_ism_mode_select( num_obj, ivas_total_brate ); st_ivas->nchan_transport = num_obj; +#endif if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { - st_ivas->nchan_transport = 2; + st_ivas->nchan_transport = MAX_PARAM_ISM_WAVE; if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) { +#ifdef NCHAN_ISM_PARAMETER + st_ivas->hDecoderConfig->nchan_out = st_ivas->nchan_ism; +#else st_ivas->hDecoderConfig->nchan_out = num_obj; +#endif } } if ( st_ivas->ini_active_frame != 0 ) { /* ISM bit-rate switching */ +#ifndef DISCRETE_ISM_DTX_CNG if ( st_ivas->hDecoderConfig->last_ivas_total_brate != IVAS_SID_5k2 && st_ivas->hDecoderConfig->last_ivas_total_brate != FRAME_NO_DATA ) +#endif { if ( ( st_ivas->ism_mode != last_ism_mode ) || ( st_ivas->hDecoderConfig->ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate ) ) { - ivas_ism_bitrate_switching( st_ivas, nchan_transport_old, last_ism_mode, num_obj ); +#ifdef NCHAN_ISM_PARAMETER + if ( ( error = ivas_ism_bitrate_switching( st_ivas, nchan_transport_old, last_ism_mode ) ) != IVAS_ERR_OK ) +#else + if ( ( error = ivas_ism_bitrate_switching( st_ivas, nchan_transport_old, last_ism_mode, num_obj ) ) != IVAS_ERR_OK ) +#endif + { + return error; + } } } } } else if ( !st_ivas->bfi && ivas_total_brate == IVAS_SID_5k2 ) { -#ifdef PARAM_ISM_DTX_CNG +#ifdef DISCRETE_ISM_DTX_CNG +#ifdef NCHAN_ISM_PARAMETER + st_ivas->nchan_transport = st_ivas->nchan_ism; +#else + st_ivas->nchan_transport = num_obj; +#endif + if ( st_ivas->ism_mode == ISM_MODE_PARAM ) + { + st_ivas->nchan_transport = MAX_PARAM_ISM_WAVE; + if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) + { +#ifdef NCHAN_ISM_PARAMETER + st_ivas->hDecoderConfig->nchan_out = st_ivas->nchan_ism; +#else + st_ivas->hDecoderConfig->nchan_out = num_obj; +#endif + } + } + + /* ISM mode switching */ + if ( st_ivas->ism_mode != last_ism_mode ) + { +#ifdef NCHAN_ISM_PARAMETER + if ( ( error = ivas_ism_bitrate_switching( st_ivas, nchan_transport_old, last_ism_mode ) ) != IVAS_ERR_OK ) +#else + if ( ( error = ivas_ism_bitrate_switching( st_ivas, nchan_transport_old, last_ism_mode, num_obj ) ) != IVAS_ERR_OK ) +#endif + { + return error; + } + } +#else if ( last_ism_mode == ISM_MODE_PARAM ) { nchan_transport_old = MAX_PARAM_ISM_WAVE; } else -#endif { +#ifdef NCHAN_ISM_PARAMETER + st_ivas->nchan_transport = st_ivas->nchan_ism; +#else st_ivas->nchan_transport = num_obj; +#endif } +#endif } +#ifdef NCHAN_ISM_PARAMETER + switch ( st_ivas->nchan_ism ) +#else switch ( num_obj ) +#endif { case 1: st_ivas->transport_config = AUDIO_CONFIG_ISM1; diff --git a/lib_dec/ivas_ism_dtx_dec.c b/lib_dec/ivas_ism_dtx_dec.c index bd15569f9e..ef52c082b7 100644 --- a/lib_dec/ivas_ism_dtx_dec.c +++ b/lib_dec/ivas_ism_dtx_dec.c @@ -40,7 +40,6 @@ #include "wmc_auto.h" -#ifdef PARAM_ISM_DTX_CNG /*-------------------------------------------------------------------* * ivas_ism_preprocessing() * @@ -52,19 +51,24 @@ static void ivas_ism_preprocessing( const int16_t sce_id /* i : SCE # identifier */ ) { +#ifndef DISCRETE_ISM_DTX_CNG int32_t ivas_total_brate; - SCE_DEC_HANDLE hSCE; +#endif Decoder_State *st; - hSCE = st_ivas->hSCE[sce_id]; - st = hSCE->hCoreCoder[0]; + st = st_ivas->hSCE[sce_id]->hCoreCoder[0]; +#ifndef DISCRETE_ISM_DTX_CNG ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; if ( ( ivas_total_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) ) +#endif { - /* reset the bitstream to atleast read the cng type and bandwidth for non transmitted SCE */ + /* reset the bitstream to at least read the cng type and bandwidth for non transmitted SCE */ st->bit_stream = st_ivas->hSCE[0]->hCoreCoder[0]->bit_stream; +#ifdef DISCRETE_ISM_DTX_CNG + st->next_bit_pos = 0; /* note: needed in paramISM -> discISM switching */ +#endif if ( sce_id == st_ivas->hISMDTX.sce_id_dtx ) { @@ -75,12 +79,14 @@ static void ivas_ism_preprocessing( st->read_sid_info = 0; /* do not read the sid info from bitstream but use the estimated noise */ } - st->cng_paramISM_flag = 1; + st->cng_ism_flag = 1; } +#ifndef DISCRETE_ISM_DTX_CNG else { - st->cng_paramISM_flag = 0; + st->cng_ism_flag = 0; } +#endif return; } @@ -97,77 +103,168 @@ ivas_error ivas_ism_dtx_dec( int16_t *nb_bits_metadata /* o : number of metadata bits */ ) { - int16_t ch, pos, num_obj, num_obj_prev; + int16_t ch, pos, nchan_ism, nchan_ism_prev; int32_t ivas_total_brate; +#ifdef DISCRETE_ISM_DTX_CNG + int16_t md_diff_flag[MAX_NUM_OBJECTS]; + int16_t idx, flag_noisy_speech, sce_id_dtx; + ISM_MODE last_ism_mode, ism_mode_bstr; + ivas_error error; +#endif ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; +#ifndef DISCRETE_ISM_DTX_CNG if ( st_ivas->nchan_transport == 1 ) { nb_bits_metadata[0] = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC; return IVAS_ERR_OK; } +#endif +#ifdef NCHAN_ISM_PARAMETER + nchan_ism_prev = st_ivas->nchan_ism; +#else if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { - num_obj_prev = st_ivas->hDirAC->hParamIsm->num_obj; + nchan_ism_prev = st_ivas->hDirAC->hParamIsm->num_obj; } else /* ism_mode == ISM_MODE_DISC */ { - num_obj_prev = st_ivas->nchan_transport; + nchan_ism_prev = st_ivas->nchan_transport; } +#endif - /* read number of objects */ if ( !st_ivas->bfi && ivas_total_brate == IVAS_SID_5k2 ) { - num_obj = 1; + /* read number of objects */ + nchan_ism = 1; pos = (int16_t) ( ( ivas_total_brate / FRAMES_PER_SEC ) - 1 - SID_FORMAT_NBITS ); - while ( get_indice( st_ivas->hSCE[0]->hCoreCoder[0], pos, 1 ) == 1 && num_obj < MAX_NUM_OBJECTS ) + while ( get_indice( st_ivas->hSCE[0]->hCoreCoder[0], pos, 1 ) == 1 && nchan_ism < MAX_NUM_OBJECTS ) { - ( num_obj )++; + ( nchan_ism )++; pos--; } +#ifdef NCHAN_ISM_PARAMETER + st_ivas->nchan_ism = nchan_ism; +#endif +#ifdef DISCRETE_ISM_DTX_CNG + pos--; +#endif - if ( num_obj != num_obj_prev ) + if ( nchan_ism != nchan_ism_prev ) { /* IVAS_fmToDo: more work needed when the number of transported objects is not constant */ return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong number of objects signalled!" ); } - ivas_ism_dec_config( st_ivas, num_obj ); +#ifdef DISCRETE_ISM_DTX_CNG + last_ism_mode = st_ivas->ism_mode; + + /* read ism_mode */ + if ( nchan_ism > 2 ) + { + pos -= nchan_ism; /* SID metadata flags */ + + idx = get_indice( st_ivas->hSCE[0]->hCoreCoder[0], pos, 1 ); + ism_mode_bstr = (ISM_MODE) ( idx + 1 ); + st_ivas->ism_mode = ism_mode_bstr; + } + +#ifdef NCHAN_ISM_PARAMETER + if ( ( error = ivas_ism_dec_config( st_ivas, last_ism_mode ) ) != IVAS_ERR_OK ) +#else + if ( ( error = ivas_ism_dec_config( st_ivas, last_ism_mode, nchan_ism ) ) != IVAS_ERR_OK ) +#endif + { + return error; + } +#else +#ifdef NCHAN_ISM_PARAMETER + ivas_ism_dec_config( st_ivas ); +#else + ivas_ism_dec_config( st_ivas, nchan_ism ); +#endif if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { - st_ivas->hDirAC->hParamIsm->num_obj = num_obj; +#ifdef NCHAN_ISM_PARAMETER + st_ivas->nchan_transport = 2; +#else + st_ivas->hDirAC->hParamIsm->num_obj = nchan_ism; +#endif } else /* ism_mode == ISM_MODE_DISC */ { - st_ivas->nchan_transport = num_obj; + st_ivas->nchan_transport = nchan_ism; } +#endif } else { - num_obj = num_obj_prev; + nchan_ism = nchan_ism_prev; } /* Metadata decoding and dequantization */ +#ifdef DISCRETE_ISM_DTX_CNG + ivas_ism_metadata_sid_dec( st_ivas->hSCE, ivas_total_brate, st_ivas->bfi, nchan_ism, st_ivas->nchan_transport, st_ivas->ism_mode, + &flag_noisy_speech, &sce_id_dtx, st_ivas->hIsmMetaData, nb_bits_metadata ); + + if ( ivas_total_brate == IVAS_SID_5k2 && !st_ivas->bfi ) + { + if ( st_ivas->hDirAC != NULL ) + { + st_ivas->hDirAC->hParamIsm->flag_noisy_speech = flag_noisy_speech; + } + + st_ivas->hISMDTX.sce_id_dtx = sce_id_dtx; + } +#else ivas_param_ism_metadata_dtx_dec( st_ivas ); +#endif + +#ifdef DISCRETE_ISM_DTX_CNG + set_s( md_diff_flag, 1, nchan_ism ); - for ( ch = 0; ch < st_ivas->nchan_transport; ch++ ) + if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { - nb_bits_metadata[ch] = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC; + for ( ch = 0; ch < nchan_ism; ch++ ) + { + st_ivas->hDirAC->azimuth_values[ch] = st_ivas->hIsmMetaData[ch]->azimuth; + st_ivas->hDirAC->elevation_values[ch] = st_ivas->hIsmMetaData[ch]->elevation; + } } + update_last_metadata( nchan_ism, st_ivas->hIsmMetaData, md_diff_flag ); + + st_ivas->hISMDTX.ism_dtx_hangover_cnt = 0; +#endif + + if ( ivas_total_brate == IVAS_SID_5k2 && !st_ivas->bfi ) + { + for ( ch = 0; ch < st_ivas->nchan_transport; ch++ ) + { +#ifdef DISCRETE_ISM_DTX_CNG + nb_bits_metadata[ch] = nb_bits_metadata[sce_id_dtx]; +#else + nb_bits_metadata[ch] = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC; +#endif + } + } + +#ifdef DISCRETE_ISM_DTX_CNG + if ( !st_ivas->bfi ) +#else if ( st_ivas->ism_mode == ISM_MODE_PARAM ) +#endif { for ( ch = 0; ch < st_ivas->nchan_transport; ch++ ) { - ivas_ism_preprocessing( st_ivas, ch ); + ivas_ism_preprocessing( st_ivas, ch ); // VE: after the acceptance of switches, replace the function call by its content } } return IVAS_ERR_OK; } -#endif diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 53c1e9d2e9..99f94fa536 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -37,47 +37,165 @@ #include "ivas_rom_com.h" #include "prot.h" #include "ivas_stat_enc.h" +#ifdef DISCRETE_ISM_DTX_CNG +#include +#endif #ifdef DEBUGGING #include "debug.h" #endif #include "wmc_auto.h" +#ifdef TD5 +/*-----------------------------------------------------------------------* + * Local functions + *-----------------------------------------------------------------------*/ + +static void decode_angle_indices( DEC_CORE_HANDLE st0, ISM_METADATA_ANGLE_HANDLE angle, int16_t *flag_abs_azimuth ); + +static int16_t decode_radius( DEC_CORE_HANDLE st0, int16_t *last_radius_idx, int16_t *flag_abs_radius ); +#endif + +#ifdef DISCRETE_ISM_DTX_CNG +/*-------------------------------------------------------------------------* + * Local constants + *-------------------------------------------------------------------------*/ + +#define IVAS_ISM_DTX_HO_MAX 5 + +#define CNG_MD_MAX_DIFF_AZIMUTH 5 +#define CNG_MD_MAX_DIFF_ELEVATION 5 + + +/*-------------------------------------------------------------------* + * ism_metadata_smooth() + * + * Smooth the metadata evolution + *-------------------------------------------------------------------*/ + +static void ism_metadata_smooth( + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + const int32_t ism_total_brate, /* i : ISms total bitrate */ + const int16_t nchan_ism /* i : number of objects */ +) +{ + ISM_METADATA_HANDLE hIsmMetaData; + int16_t ch; + float diff; + + for ( ch = 0; ch < nchan_ism; ch++ ) + { + hIsmMetaData = hIsmMeta[ch]; + + /* smooth azimuth */ + diff = hIsmMetaData->last_true_azimuth - hIsmMetaData->last_azimuth; + + if ( diff > ISM_AZIMUTH_MAX ) + { + diff -= ( ISM_AZIMUTH_MAX - ISM_AZIMUTH_MIN ); + hIsmMetaData->last_azimuth += ( ISM_AZIMUTH_MAX - ISM_AZIMUTH_MIN ); + } + else if ( diff < ISM_AZIMUTH_MIN ) + { + diff += ( ISM_AZIMUTH_MAX - ISM_AZIMUTH_MIN ); + } + + if ( ism_total_brate > IVAS_SID_5k2 && fabsf( diff ) > IVAS_ISM_DTX_HO_MAX * CNG_MD_MAX_DIFF_AZIMUTH ) + { + /* skip the smoothing */ + } + else if ( fabsf( diff ) > CNG_MD_MAX_DIFF_AZIMUTH ) + { + hIsmMetaData->azimuth = hIsmMetaData->last_azimuth + sign( diff ) * CNG_MD_MAX_DIFF_AZIMUTH; + } + else if ( diff != 0 ) + { + hIsmMetaData->azimuth = hIsmMetaData->last_true_azimuth; + } + + if ( hIsmMetaData->azimuth > ISM_AZIMUTH_MAX ) + { + hIsmMetaData->azimuth -= ( ISM_AZIMUTH_MAX - ISM_AZIMUTH_MIN ); + } + + /* smooth elevation */ + diff = hIsmMetaData->last_true_elevation - hIsmMetaData->last_elevation; + + if ( ism_total_brate > IVAS_SID_5k2 && diff > IVAS_ISM_DTX_HO_MAX * CNG_MD_MAX_DIFF_ELEVATION ) + { + /* skip the smoothing */ + } + else if ( fabsf( diff ) > CNG_MD_MAX_DIFF_ELEVATION ) + { + hIsmMetaData->elevation = hIsmMetaData->last_elevation + sign( diff ) * CNG_MD_MAX_DIFF_ELEVATION; + } + } + + return; +} +#endif + + /*-------------------------------------------------------------------------* * ivas_ism_metadata_dec() * - * decode and dequantize ISm metadata + * decode and dequantize ISM metadata *-------------------------------------------------------------------------*/ ivas_error ivas_ism_metadata_dec( - const int32_t ism_total_brate, /* i : ISms total bitrate */ - int16_t *nchan_transport, /* o : number of transport channels */ - ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ - SCE_DEC_HANDLE hSCE[], /* i/o: SCE decoder handles */ - const int16_t bfi, /* i : bfi flag */ - int16_t nb_bits_metadata[], /* o : number of metadata bits */ - ISM_MODE ism_mode, /* i : ISM mode */ + const int32_t ism_total_brate, /* i : ISM total bitrate */ +#ifdef NCHAN_ISM_PARAMETER + const int16_t nchan_ism, /* i : number of ISM channels */ +#endif + int16_t *nchan_transport, /* o : number of transport channels */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + SCE_DEC_HANDLE hSCE[], /* i/o: SCE decoder handles */ + const int16_t bfi, /* i : bfi flag */ + int16_t nb_bits_metadata[], /* o : number of metadata bits */ + ISM_MODE ism_mode, /* i : ISM mode */ +#ifdef DISCRETE_ISM_DTX_CNG + ISM_DTX_DATA_DEC hISMDTX, /* i/o: ISM DTX structure */ +#endif const PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Config Handle */ ) { +#ifdef TD5 + int16_t ch, nb_bits_start = 0, last_bit_pos; + int16_t idx_radius; +#else int16_t ch, nb_bits_start = 0, last_bit_pos, sgn, diff; +#endif int32_t element_brate[MAX_NUM_OBJECTS], total_brate[MAX_NUM_OBJECTS]; DEC_CORE_HANDLE st0; +#ifdef TD5 + int16_t ism_extended_metadata_flag; + int16_t flag_abs_radius; + int16_t flag_abs_orientation; + int16_t idx_azimuth, flag_abs_azimuth; + int16_t idx_elevation; +#else int16_t idx_azimuth, nbits_diff_azimuth, flag_abs_azimuth; int16_t idx_elevation, nbits_diff_elevation; +#endif int16_t next_bit_pos_orig; uint16_t i, bstr_meta[MAX_BITS_METADATA], *bstr_orig; ISM_METADATA_HANDLE hIsmMetaData; int16_t nchan_transport_prev, ism_metadata_flag_global; int16_t localVAD[MAX_NUM_OBJECTS]; int16_t ism_imp[MAX_NUM_OBJECTS]; - int16_t num_obj = 0, nbands, nblocks; +#ifdef NCHAN_ISM_PARAMETER + int16_t nbands, nblocks; +#else + int16_t nchan_ism = 0, nbands, nblocks; +#endif +#ifdef DISCRETE_ISM_DTX_CNG + int16_t md_diff_flag[MAX_NUM_OBJECTS]; +#endif ivas_error error; - error = IVAS_ERR_OK; - push_wmops( "ism_meta_dec" ); +#ifndef DISCRETE_ISM_DTX_CNG if ( ism_total_brate == IVAS_SID_5k2 || ism_total_brate == FRAME_NO_DATA ) { /* no metadata decoding in CNG */ @@ -98,8 +216,9 @@ ivas_error ivas_ism_metadata_dec( #endif pop_wmops(); - return error; + return IVAS_ERR_OK; } +#endif /* initialization */ st0 = hSCE[0]->hCoreCoder[0]; @@ -110,6 +229,9 @@ ivas_error ivas_ism_metadata_dec( bstr_orig = st0->bit_stream; next_bit_pos_orig = st0->next_bit_pos; st0->next_bit_pos = 0; +#ifdef TD5 + ism_extended_metadata_flag = 0; +#endif /* reverse the bitstream for easier reading of indices */ for ( i = 0; i < min( MAX_BITS_METADATA, last_bit_pos ); i++ ) @@ -122,25 +244,34 @@ ivas_error ivas_ism_metadata_dec( if ( !bfi ) { /*----------------------------------------------------------------* - * Read ISm common signaling + * Read ISM common signaling *----------------------------------------------------------------*/ +#ifdef NCHAN_ISM_PARAMETER + /* number of objects was read in ivas_dec_setup() */ + st0->next_bit_pos += nchan_ism; +#else /* read number of objects */ - num_obj = 1; - while ( get_next_indice( st0, 1 ) == 1 && num_obj < MAX_NUM_OBJECTS ) + nchan_ism = 1; + while ( get_next_indice( st0, 1 ) == 1 && nchan_ism < MAX_NUM_OBJECTS ) { - ( num_obj )++; + ( nchan_ism )++; } +#endif - ism_mode = ivas_ism_mode_select( num_obj, ism_total_brate ); + ism_mode = ivas_ism_mode_select( nchan_ism, ism_total_brate ); if ( ism_mode == ISM_MODE_PARAM ) { - hParamIsm->num_obj = num_obj; +#ifdef NCHAN_ISM_PARAMETER + *nchan_transport = MAX_PARAM_ISM_WAVE; +#else + hParamIsm->num_obj = nchan_ism; +#endif } else if ( ism_mode == ISM_MODE_DISC ) { - *nchan_transport = num_obj; + *nchan_transport = nchan_ism; } if ( *nchan_transport != nchan_transport_prev ) @@ -149,7 +280,15 @@ ivas_error ivas_ism_metadata_dec( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong number of objects signalled!" ); } - /* Read ISm present flags (one per object) */ +#ifdef TD5 + /* read extended metadata presence flag */ + if ( ism_total_brate >= ISM_EXTENDED_METADATA_BRATE ) + { + ism_extended_metadata_flag = get_next_indice( st0, ISM_EXTENDED_METADATA_BITS ); + } +#endif + + /* Read ISM present flags (one per object) */ for ( ch = 0; ch < *nchan_transport; ch++ ) { ism_imp[ch] = get_next_indice( st0, ISM_METADATA_FLAG_BITS ); @@ -166,7 +305,7 @@ ivas_error ivas_ism_metadata_dec( ism_metadata_flag_global |= hIsmMeta[ch]->ism_metadata_flag; } - for ( ; ch < num_obj; ch++ ) + for ( ; ch < nchan_ism; ch++ ) { hIsmMeta[ch]->ism_metadata_flag = 1; ism_metadata_flag_global |= hIsmMeta[ch]->ism_metadata_flag; @@ -199,7 +338,7 @@ ivas_error ivas_ism_metadata_dec( nb_bits_start = st0->next_bit_pos; } - for ( ch = 0; ch < num_obj; ch++ ) + for ( ch = 0; ch < nchan_ism; ch++ ) { hIsmMetaData = hIsmMeta[ch]; if ( ism_mode == ISM_MODE_DISC ) @@ -208,9 +347,48 @@ ivas_error ivas_ism_metadata_dec( } flag_abs_azimuth = 0; +#ifdef TD5 + flag_abs_orientation = 0; + flag_abs_radius = 0; +#endif if ( hIsmMeta[ch]->ism_metadata_flag ) { +#ifdef TD5 + decode_angle_indices( st0, &( hIsmMetaData->angle[0] ), &flag_abs_azimuth ); + idx_azimuth = hIsmMetaData->angle[0].last_azimuth_idx; + idx_elevation = hIsmMetaData->angle[0].last_elevation_idx; + + /* Azimuth/Elevation dequantization */ + if ( ism_mode == ISM_MODE_PARAM ) + { + hParamIsm->azi_index[ch] = idx_azimuth; + hParamIsm->ele_index[ch] = idx_elevation; + } + else /* ISM_MODE_DISC */ + { + hIsmMetaData->azimuth = ism_dequant_meta( idx_azimuth, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ); + hIsmMetaData->elevation = ism_dequant_meta( idx_elevation, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ); + + /* radius/raw/pitch dequantization */ + if ( ism_extended_metadata_flag ) + { + decode_angle_indices( st0, &( hIsmMetaData->angle[1] ), &flag_abs_orientation ); + idx_azimuth = hIsmMetaData->angle[1].last_azimuth_idx; + idx_elevation = hIsmMetaData->angle[1].last_elevation_idx; + + hIsmMetaData->yaw = ism_dequant_meta( idx_azimuth, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ); + hIsmMetaData->pitch = ism_dequant_meta( idx_elevation, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ); + + idx_radius = decode_radius( st0, &hIsmMetaData->last_radius_idx, &flag_abs_radius ); + hIsmMetaData->radius = usdequant( idx_radius, ISM_RADIUS_MIN, ISM_RADIUS_DELTA ); + } + else + { + hIsmMetaData->radius = 1.0f; + } + } +#else /*----------------------------------------------------------------* * Azimuth decoding and dequantization *----------------------------------------------------------------*/ @@ -287,7 +465,7 @@ ivas_error ivas_ism_metadata_dec( } else /* ISM_MODE_DISC */ { - hIsmMetaData->azimuth = ism_dequant_meta( idx_azimuth, ism_azimuth_borders, 1 << ISM_AZIMUTH_NBITS ); + hIsmMetaData->azimuth = ism_dequant_meta( idx_azimuth, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ); } /*----------------------------------------------------------------* @@ -349,7 +527,7 @@ ivas_error ivas_ism_metadata_dec( } else /* ISM_MODE_DISC */ { - hIsmMetaData->elevation = ism_dequant_meta( idx_elevation, ism_elevation_borders, 1 << ISM_ELEVATION_NBITS ); + hIsmMetaData->elevation = ism_dequant_meta( idx_elevation, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ); } /*----------------------------------------------------------------* @@ -359,6 +537,12 @@ ivas_error ivas_ism_metadata_dec( /* updates */ hIsmMetaData->last_azimuth_idx = idx_azimuth; hIsmMetaData->last_elevation_idx = idx_elevation; +#endif +#ifdef DISCRETE_ISM_DTX_CNG + /* save for smoothing metadata evolution */ + hIsmMetaData->last_true_azimuth = hIsmMetaData->azimuth; + hIsmMetaData->last_true_elevation = hIsmMetaData->elevation; +#endif } /* save number of metadata bits read */ @@ -421,12 +605,27 @@ ivas_error ivas_ism_metadata_dec( } else /* BFI */ { +#ifdef FIX_380_BFI_PARAMISM +#ifndef NCHAN_ISM_PARAMETER + /* "nchan_ism", "hIsmMeta->azimuth" and "hIsmMeta->elevation" are recycled from the last frame */ + if ( ism_mode == ISM_MODE_PARAM ) + { + nchan_ism = hParamIsm->num_obj; + } + else if ( ism_mode == ISM_MODE_DISC ) + { + nchan_ism = *nchan_transport; + } +#endif + for ( ch = 0; ch < nchan_ism; ch++ ) +#else /* "*nISms", "hIsmMeta->azimuth" and "hIsmMeta->elevation" are recycled from the last frame */ for ( ch = 0; ch < *nchan_transport; ch++ ) { hIsmMeta[ch]->ism_metadata_flag = hIsmMeta[ch]->last_ism_metadata_flag; } - for ( ; ch < num_obj; ch++ ) + for ( ; ch < nchan_ism; ch++ ) +#endif { hIsmMeta[ch]->last_ism_metadata_flag = hIsmMeta[ch]->ism_metadata_flag; } @@ -435,27 +634,45 @@ ivas_error ivas_ism_metadata_dec( if ( ism_mode == ISM_MODE_PARAM ) { - for ( ch = 0; ch < num_obj; ch++ ) + for ( ch = 0; ch < nchan_ism; ch++ ) { +#ifdef FIX_380_BFI_PARAMISM + hParamIsm->azi_index[ch] = hParamIsm->azi_index[ch] + hParamIsm->last_az_sgn[ch] * hParamIsm->last_az_diff[ch]; + hParamIsm->ele_index[ch] = hParamIsm->ele_index[ch] + hParamIsm->last_el_sgn[ch] * hParamIsm->last_el_diff[ch]; +#else hParamIsm->azi_index[ch] = hParamIsm->azi_index[ch] + hParamIsm->last_az_sgn[ch] * hParamIsm->last_az_diff[ch]; /*hParamIsm->azi_index[ch] = hParamIsm->azi_index[ch] % hParamIsm->az_alpha[ch];*/ hParamIsm->azi_index[ch] = hParamIsm->azi_index[ch]; hParamIsm->ele_index[ch] = hParamIsm->ele_index[ch] + hParamIsm->last_el_sgn[ch] * hParamIsm->last_el_diff[ch]; /*hParamIsm->ele_index[ch] = hParamIsm->ele_index[ch] % hParamIsm->ele_alpha;*/ hParamIsm->ele_index[ch] = hParamIsm->ele_index[ch]; +#endif +#ifdef TD5 + hIsmMeta[ch]->angle[0].last_azimuth_idx = hParamIsm->azi_index[ch]; + hIsmMeta[ch]->angle[0].last_elevation_idx = hParamIsm->ele_index[ch]; +#else hIsmMeta[ch]->last_azimuth_idx = hParamIsm->azi_index[ch]; hIsmMeta[ch]->last_elevation_idx = hParamIsm->ele_index[ch]; +#endif } } } +#ifdef DISCRETE_ISM_DTX_CNG + if ( hISMDTX.ism_dtx_hangover_cnt < IVAS_ISM_DTX_HO_MAX ) + { + ism_metadata_smooth( hIsmMeta, ism_total_brate, nchan_ism ); + hISMDTX.ism_dtx_hangover_cnt += 1; + } +#endif + /*----------------------------------------------------------------* * Configuration and decision about bitrates per channel *----------------------------------------------------------------*/ if ( !bfi ) { - if ( ( error = ivas_ism_config( ism_total_brate, *nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_config( ism_total_brate, *nchan_transport, nchan_ism, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata ) ) != IVAS_ERR_OK ) { return error; } @@ -477,7 +694,7 @@ ivas_error ivas_ism_metadata_dec( hSCE[ch]->hCoreCoder[0]->total_brate = total_brate[ch]; } - for ( ; ch < num_obj; ch++ ) + for ( ; ch < nchan_ism; ch++ ) { hIsmMeta[ch]->last_ism_metadata_flag = hIsmMeta[ch]->ism_metadata_flag; } @@ -486,32 +703,43 @@ ivas_error ivas_ism_metadata_dec( { for ( ch = 0; ch < *nchan_transport; ch++ ) { - hSCE[ch]->element_brate = hSCE[ch]->last_element_brate; hSCE[ch]->hCoreCoder[0]->total_brate = hSCE[ch]->hCoreCoder[0]->last_total_brate; } } + /*----------------------------------------------------------------* + * Set bitsream pointers + *----------------------------------------------------------------*/ + /* set the bitstream pointer to its original position */ st0->bit_stream = bstr_orig; st0->next_bit_pos = next_bit_pos_orig; - /* set bitstream pointers for each ISm */ + /* set bitstream pointers for each ISM */ for ( ch = 1; ch < *nchan_transport; ch++ ) { hSCE[ch]->hCoreCoder[0]->bit_stream = hSCE[ch - 1]->hCoreCoder[0]->bit_stream + ( hSCE[ch - 1]->hCoreCoder[0]->total_brate / FRAMES_PER_SEC ); } -#ifdef PARAM_ISM_DTX_CNG +#ifdef DISCRETE_ISM_DTX_CNG + /*----------------------------------------------------------------* + * Updates + *----------------------------------------------------------------*/ + + set_s( md_diff_flag, 1, nchan_ism ); + + update_last_metadata( nchan_ism, hIsmMeta, md_diff_flag ); +#endif + for ( ch = 0; ch < *nchan_transport; ch++ ) { - hSCE[ch]->hCoreCoder[0]->cng_paramISM_flag = 0; + hSCE[ch]->hCoreCoder[0]->cng_ism_flag = 0; } -#endif pop_wmops(); - return error; + return IVAS_ERR_OK; } @@ -530,17 +758,30 @@ ivas_error ivas_ism_metadata_dec_create( int16_t ch; ivas_error error; - /* allocate ISm metadata handles */ + /* allocate ISM metadata handles */ for ( ch = 0; ch < MAX_NUM_OBJECTS; ch++ ) { if ( ( st_ivas->hIsmMetaData[ch] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISm MetaData\n" ) ); + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISM MetaData\n" ) ); } st_ivas->hIsmMetaData[ch]->last_ism_metadata_flag = 0; +#ifdef TD5 + st_ivas->hIsmMetaData[ch]->angle[0].last_azimuth_idx = 0; + st_ivas->hIsmMetaData[ch]->angle[0].last_elevation_idx = 1 << ( ISM_ELEVATION_NBITS - 1 ); + st_ivas->hIsmMetaData[ch]->angle[1].last_azimuth_idx = 0; + st_ivas->hIsmMetaData[ch]->angle[1].last_elevation_idx = 1 << ( ISM_ELEVATION_NBITS - 1 ); + st_ivas->hIsmMetaData[ch]->last_radius_idx = 8; /* Init to radius 1.0 */ +#else st_ivas->hIsmMetaData[ch]->last_azimuth_idx = 0; st_ivas->hIsmMetaData[ch]->last_elevation_idx = 1 << ( ISM_ELEVATION_NBITS - 1 ); +#endif + +#ifdef DISCRETE_ISM_DTX_CNG + st_ivas->hIsmMetaData[ch]->last_true_azimuth = 0; + st_ivas->hIsmMetaData[ch]->last_true_elevation = 0; +#endif ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); } @@ -550,5 +791,414 @@ ivas_error ivas_ism_metadata_dec_create( return error; } +#ifdef DISCRETE_ISM_DTX_CNG + st_ivas->hISMDTX.ism_dtx_hangover_cnt = IVAS_ISM_DTX_HO_MAX; +#endif + return IVAS_ERR_OK; } + + +#ifdef TD5 +/*------------------------------------------------------------------------- + * decode_angle_indices() + * + * Decoding of an angle + *-------------------------------------------------------------------------*/ + +static void decode_angle_indices( + DEC_CORE_HANDLE st0, /* i/o: bitstream handle */ + ISM_METADATA_ANGLE_HANDLE angle, /* i/o: angle handle */ + int16_t *flag_abs_azimuth /* o : Azimuth encoding mode */ +) +{ + int16_t idx_azimuth, nbits_diff_azimuth, diff, sgn; + int16_t idx_elevation, nbits_diff_elevation; + + /*----------------------------------------------------------------* + * Azimuth decoding and dequantization + *----------------------------------------------------------------*/ + + /* Decode azimuth index */ + if ( get_next_indice( st0, 1 ) == 1 ) /* azimuth_abs_flag */ + { + idx_azimuth = get_next_indice( st0, ISM_AZIMUTH_NBITS ); + *flag_abs_azimuth = 1; + } + else + { + diff = 0; + sgn = 1; + + if ( get_next_indice( st0, 1 ) == 0 ) + { + nbits_diff_azimuth = 1; + } + else + { + nbits_diff_azimuth = 1; + + if ( get_next_indice( st0, 1 ) == 1 ) /* negative sign */ + { + sgn = -1; + } + + nbits_diff_azimuth++; + + /* read until the stop bit */ + while ( ( nbits_diff_azimuth < ISM_AZIMUTH_NBITS - 1 ) && ( get_next_indice( st0, 1 ) == 1 ) ) + { + diff++; + nbits_diff_azimuth++; + } + + if ( nbits_diff_azimuth < ISM_AZIMUTH_NBITS - 1 ) + { + /* count stop bit */ + nbits_diff_azimuth++; + } + } + idx_azimuth = angle->last_azimuth_idx + sgn * diff; + } + + /* azimuth is on a circle - check for diff coding for -180° -> 180° and vice versa changes */ + if ( idx_azimuth > ( 1 << ISM_AZIMUTH_NBITS ) - 1 ) + { + idx_azimuth -= ( 1 << ISM_AZIMUTH_NBITS ) - 1; /* +180° -> -180° */ + } + else if ( idx_azimuth < 0 ) + { + idx_azimuth += ( 1 << ISM_AZIMUTH_NBITS ) - 1; /* -180° -> +180° */ + } + + /* +180° == -180° */ + if ( idx_azimuth == ( 1 << ISM_AZIMUTH_NBITS ) - 1 ) + { + idx_azimuth = 0; + } + + /* sanity check in case of FER or BER */ + if ( idx_azimuth < 0 || idx_azimuth > ( 1 << ISM_AZIMUTH_NBITS ) - 1 ) + { + idx_azimuth = angle->last_azimuth_idx; + } + + /*----------------------------------------------------------------* + * Elevation decoding and dequantization + *----------------------------------------------------------------*/ + + /* Decode elevation index */ + if ( *flag_abs_azimuth == 0 && get_next_indice( st0, 1 ) == 1 ) /* elevation_abs_flag */ + { + idx_elevation = get_next_indice( st0, ISM_ELEVATION_NBITS ); + } + else + { + diff = 0; + sgn = 1; + + if ( get_next_indice( st0, 1 ) == 0 ) + { + nbits_diff_elevation = 1; + } + else + { + nbits_diff_elevation = 1; + + if ( get_next_indice( st0, 1 ) == 1 ) /* negative sign */ + { + sgn = -1; + } + + nbits_diff_elevation++; + + /* read until the stop bit */ + while ( ( nbits_diff_elevation < ISM_ELEVATION_NBITS ) && ( get_next_indice( st0, 1 ) == 1 ) ) + { + diff++; + nbits_diff_elevation++; + } + + if ( nbits_diff_elevation < ISM_ELEVATION_NBITS ) + { + /* count stop bit */ + nbits_diff_elevation++; + } + } + + idx_elevation = angle->last_elevation_idx + sgn * diff; + } + + /* sanity check in case of FER or BER */ + if ( idx_elevation < 0 || idx_elevation > ( 1 << ISM_ELEVATION_NBITS ) - 1 ) + { + idx_elevation = angle->last_elevation_idx; + } + + /*----------------------------------------------------------------* + * Final updates + *----------------------------------------------------------------*/ + + angle->last_azimuth_idx = idx_azimuth; + angle->last_elevation_idx = idx_elevation; + + return; +} + + +/*------------------------------------------------------------------------- + * decode_radius() + * + * Radius decoding and dequantization + *-------------------------------------------------------------------------*/ + +static int16_t decode_radius( + DEC_CORE_HANDLE st0, /* i/o: bitstream handle */ + int16_t *last_radius_idx, /* i/o: last radius index */ + int16_t *flag_abs_radius /* o : Radius encoding mode */ +) +{ + int16_t idx_radius, nbits_diff_radius, diff, sgn; + + /* Decode radius index */ + if ( get_next_indice( st0, 1 ) == 1 ) /* elevation_abs_flag */ + { + *flag_abs_radius = 1; + idx_radius = get_next_indice( st0, ISM_RADIUS_NBITS ); + } + else + { + diff = 0; + sgn = 1; + + if ( get_next_indice( st0, 1 ) == 0 ) + { + nbits_diff_radius = 1; + } + else + { + nbits_diff_radius = 1; + + if ( get_next_indice( st0, 1 ) == 1 ) /* negative sign */ + { + sgn = -1; + } + + nbits_diff_radius++; + + /* read until the stop bit */ + while ( ( nbits_diff_radius < ISM_RADIUS_NBITS ) && ( get_next_indice( st0, 1 ) == 1 ) ) + { + diff++; + nbits_diff_radius++; + } + + if ( nbits_diff_radius < ISM_RADIUS_NBITS ) + { + /* count stop bit */ + nbits_diff_radius++; + } + } + idx_radius = *last_radius_idx + sgn * diff; + } + + /* sanity check in case of FER or BER */ + if ( idx_radius < 0 || idx_radius > ( 1 << ISM_RADIUS_NBITS ) - 1 ) + { + idx_radius = *last_radius_idx; + } + + /* Final updates */ + *last_radius_idx = idx_radius; + + return idx_radius; +} +#endif + + +#ifdef DISCRETE_ISM_DTX_CNG +/*-------------------------------------------------------------------* + * ivas_ism_metadata_sid_dec() + * + * Decode ISM metadata in SID frame + *-------------------------------------------------------------------*/ + +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 */ + 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*/ + const ISM_MODE ism_mode, /* i : ISM mode */ + int16_t *flag_noisy_speech, /* o : noisy speech flag */ + int16_t *sce_id_dtx, /* o : SCE DTX ID */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + int16_t nb_bits_metadata[] /* o : number of metadata bits */ +) +{ + int16_t i, ch, last_bit_pos; + float q_step, q_step_border; + int16_t idx, idx_azimuth, idx_elevation; + int16_t nBits_azimuth, nBits_elevation, nBits_coh, nBits_sce_id; + int16_t md_diff_flag[MAX_NUM_OBJECTS]; + ISM_MODE ism_mode_bstr; + DEC_CORE_HANDLE st0; + ISM_METADATA_HANDLE hIsmMetaData; + int16_t next_bit_pos_orig; + uint16_t bstr_meta[IVAS_SID_5k2 / FRAMES_PER_SEC], *bstr_orig; + + if ( ism_total_brate == FRAME_NO_DATA ) + { + ism_metadata_smooth( hIsmMeta, ism_total_brate, nchan_ism ); + + return; + } + + /* initialization */ + st0 = hSCE[0]->hCoreCoder[0]; + + last_bit_pos = (int16_t) ( ( ism_total_brate / FRAMES_PER_SEC ) - 1 - SID_FORMAT_NBITS ); + bstr_orig = st0->bit_stream; + next_bit_pos_orig = st0->next_bit_pos; + st0->next_bit_pos = 0; + + /* reverse the bitstream for easier reading of indices */ + for ( i = 0; i < min( MAX_BITS_METADATA, last_bit_pos ); i++ ) + { + bstr_meta[i] = st0->bit_stream[last_bit_pos - i]; + } + st0->bit_stream = bstr_meta; + st0->total_brate = ism_total_brate; /* needed for BER detection in get_next_indice() */ + + if ( !bfi ) + { + /*----------------------------------------------------------------* + * ISm common signaling + *----------------------------------------------------------------*/ + + /* number of objects was already read in ivas_ism_get_dtx_dec() */ + /* update the position in the bitstream */ + st0->next_bit_pos += nchan_ism; + + /* read SID metadata flag( one per object ) */ + for ( ch = 0; ch < nchan_ism; ch++ ) + { + md_diff_flag[ch] = get_next_indice( st0, 1 ); + } + + /*----------------------------------------------------------------* + * Set quantization bits based on the number of coded objects + *----------------------------------------------------------------*/ + + ivas_get_ism_sid_quan_bitbudget( nchan_ism, &nBits_azimuth, &nBits_elevation, &q_step, &q_step_border, &nBits_coh, &nBits_sce_id ); + + /*----------------------------------------------------------------* + * Spatial parameters, loop over TCs - 1 + *----------------------------------------------------------------*/ + + *flag_noisy_speech = 0; + *sce_id_dtx = 0; + + /* write ISM mode flag to explicitly signal number of spatial parameters */ + if ( nchan_ism > 2 ) + { + idx = get_next_indice( st0, 1 ); + ism_mode_bstr = (ISM_MODE) ( idx + 1 ); + /* note: ISM mode was already read and used for configuration in in ivas_ism_dtx_dec() */ + + if ( ism_mode_bstr == ISM_MODE_PARAM ) + { + /* read noisy speech flag */ + *flag_noisy_speech = get_next_indice( st0, 1 ); + nBits_sce_id = 1; + } + } + + if ( nchan_transport > 1 ) + { + /* read sce id */ + *sce_id_dtx = get_next_indice( st0, nBits_sce_id ); + + /* decode the coherence */ + for ( ch = 0; ch < nchan_transport; ch++ ) + { + if ( ch == *sce_id_dtx ) + { + hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence = 1.0f; + continue; + } + + idx = get_next_indice( st0, nBits_coh ); + hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence = (float) ( idx ) / (float) ( ( 1 << nBits_coh ) - 1 ); + } + } + else + { + *sce_id_dtx = 0; + } + + if ( ism_mode == ISM_MODE_PARAM ) + { + hSCE[*sce_id_dtx]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence = hSCE[!*sce_id_dtx]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence; + } + + /*----------------------------------------------------------------* + * Metadata decoding and dequantization, loop over all objects + *----------------------------------------------------------------*/ + + for ( ch = 0; ch < nchan_ism; ch++ ) + { + hIsmMetaData = hIsmMeta[ch]; + + if ( md_diff_flag[ch] == 1 ) + { + /* Azimuth decoding */ + idx_azimuth = get_next_indice( st0, nBits_azimuth ); + hIsmMetaData->azimuth = ism_dequant_meta( idx_azimuth, ism_azimuth_borders, q_step, q_step_border, 1 << nBits_azimuth ); + + /* Elevation decoding */ + idx_elevation = get_next_indice( st0, nBits_elevation ); + hIsmMetaData->elevation = ism_dequant_meta( idx_elevation, ism_elevation_borders, q_step, q_step_border, 1 << nBits_elevation ); + + /* update last indexes to correspond to active frames coding */ + if ( nBits_azimuth > ISM_AZIMUTH_NBITS ) + { +#ifdef TD5 + hIsmMetaData->angle[0].last_azimuth_idx = idx_azimuth >> ( nBits_azimuth - ISM_AZIMUTH_NBITS ); + hIsmMetaData->angle[0].last_elevation_idx = idx_elevation >> ( nBits_elevation - ISM_ELEVATION_NBITS ); +#else + hIsmMetaData->last_azimuth_idx = idx_azimuth >> ( nBits_azimuth - ISM_AZIMUTH_NBITS ); + hIsmMetaData->last_elevation_idx = idx_elevation >> ( nBits_elevation - ISM_ELEVATION_NBITS ); +#endif + } + else + { +#ifdef TD5 + hIsmMetaData->angle[0].last_azimuth_idx = idx_azimuth << ( ISM_AZIMUTH_NBITS - nBits_azimuth ); + hIsmMetaData->angle[0].last_elevation_idx = idx_elevation << ( ISM_ELEVATION_NBITS - nBits_elevation ); +#else + hIsmMetaData->last_azimuth_idx = idx_azimuth << ( ISM_AZIMUTH_NBITS - nBits_azimuth ); + hIsmMetaData->last_elevation_idx = idx_elevation << ( ISM_ELEVATION_NBITS - nBits_elevation ); +#endif + } + + /* save for smoothing metadata evolution */ + hIsmMetaData->last_true_azimuth = hIsmMetaData->azimuth; + hIsmMetaData->last_true_elevation = hIsmMetaData->elevation; + } + } + + /* take into account padding bits as metadata bits to keep later bitrate checks valid */ + nb_bits_metadata[*sce_id_dtx] = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC; + + /* set the bitstream pointer to its original position */ + st0->bit_stream = bstr_orig; + st0->next_bit_pos = next_bit_pos_orig; + } + + /* smooth the metadata evolution */ + ism_metadata_smooth( hIsmMeta, ism_total_brate, nchan_ism ); + + return; +} +#endif diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 81a4744726..f66323d8a4 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -51,6 +51,10 @@ static void ivas_param_ism_dec_dequant_DOA( DIRAC_DEC_HANDLE hDirAC /* i/o: decoder DirAC handle */ +#ifdef NCHAN_ISM_PARAMETER + , + const int16_t nchan_ism /* i : number of ISM channels */ +#endif ) { int16_t i; @@ -58,13 +62,21 @@ static void ivas_param_ism_dec_dequant_DOA( hParamIsm = hDirAC->hParamIsm; +#ifdef NCHAN_ISM_PARAMETER + assert( nchan_ism <= MAX_NUM_OBJECTS ); +#else assert( hParamIsm->num_obj <= MAX_NUM_OBJECTS ); +#endif /* Get the azimuth and elevation values */ +#ifdef NCHAN_ISM_PARAMETER + for ( i = 0; i < nchan_ism; i++ ) +#else for ( i = 0; i < hParamIsm->num_obj; i++ ) +#endif { - hDirAC->azimuth_values[i] = ism_dequant_meta( hParamIsm->azi_index[i], ism_azimuth_borders, 1 << ISM_AZIMUTH_NBITS ); - hDirAC->elevation_values[i] = ism_dequant_meta( hParamIsm->ele_index[i], ism_elevation_borders, 1 << ISM_ELEVATION_NBITS ); + hDirAC->azimuth_values[i] = ism_dequant_meta( hParamIsm->azi_index[i], ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ); + hDirAC->elevation_values[i] = ism_dequant_meta( hParamIsm->ele_index[i], ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ); } return; @@ -157,10 +169,11 @@ static void ivas_ism_get_proto_matrix( static void ivas_param_ism_compute_mixing_matrix( - DIRAC_DEC_HANDLE hDirAC, /* i/o: decoder DirAC handle */ -#ifdef PARAM_ISM_DTX_CNG - ISM_DTX_DATA_DEC hISMDTX, /* i : ISM DTX handle */ +#ifdef NCHAN_ISM_PARAMETER + const int16_t nchan_ism, /* i : number of ISM channels */ #endif + DIRAC_DEC_HANDLE hDirAC, /* i/o: decoder DirAC handle */ + ISM_DTX_DATA_DEC hISMDTX, /* i : ISM DTX handle */ float Cldfb_RealBuffer_in[PARAM_ISM_MAX_DMX][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer_in[PARAM_ISM_MAX_DMX][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float direct_response[MAX_NUM_OBJECTS][PARAM_ISM_MAX_CHAN], @@ -185,16 +198,20 @@ static void ivas_param_ism_compute_mixing_matrix( proto_matrix = hDirAC->hParamIsmRendering->proto_matrix; +#ifdef NCHAN_ISM_PARAMETER + assert( ( nchan_ism == 3 ) || ( nchan_ism == 4 ) ); +#else assert( ( hDirAC->hParamIsm->num_obj == 3 ) || ( hDirAC->hParamIsm->num_obj == 4 ) ); +#endif assert( nchan_transport == 2 ); -#ifdef PARAM_ISM_DTX_CNG if ( hDirAC->hParamIsm->flag_noisy_speech || hISMDTX.dtx_flag ) -#else - if ( hDirAC->hParamIsm->flag_noisy_speech ) -#endif { +#ifdef NCHAN_ISM_PARAMETER + num_wave = nchan_ism; +#else num_wave = hDirAC->hParamIsm->num_obj; +#endif } else { @@ -214,11 +231,7 @@ static void ivas_param_ism_compute_mixing_matrix( { set_zero( cy_diag_tmp[w], nchan_out_woLFE ); -#ifdef PARAM_ISM_DTX_CNG if ( hDirAC->hParamIsm->flag_noisy_speech || hISMDTX.dtx_flag ) -#else - if ( hDirAC->hParamIsm->flag_noisy_speech ) -#endif { dir_res_ptr = direct_response[w]; } @@ -257,13 +270,13 @@ static void ivas_param_ism_compute_mixing_matrix( set_zero( cy_diag, nchan_out_woLFE ); for ( w = 0; w < num_wave; w++ ) { -#ifdef PARAM_ISM_DTX_CNG if ( hDirAC->hParamIsm->flag_noisy_speech || hISMDTX.dtx_flag ) -#else - if ( hDirAC->hParamIsm->flag_noisy_speech ) -#endif { +#ifdef NCHAN_ISM_PARAMETER + direct_power[w] = ( 1.0f / nchan_ism ) * ref_power; +#else direct_power[w] = ( 1.0f / hDirAC->hParamIsm->num_obj ) * ref_power; +#endif } else { @@ -409,7 +422,9 @@ ivas_error ivas_param_ism_dec_open( IVAS_OUTPUT_SETUP hOutSetup; AUDIO_CONFIG output_config; int32_t output_Fs; +#ifndef NCHAN_ISM_PARAMETER int16_t nchan_out; +#endif ivas_error error; error = IVAS_ERR_OK; @@ -438,6 +453,10 @@ ivas_error ivas_param_ism_dec_open( output_Fs = st_ivas->hDecoderConfig->output_Fs; output_config = st_ivas->hDecoderConfig->output_config; +#ifdef NCHAN_ISM_PARAMETER + + ivas_param_ism_config( hDirAC->hParamIsm, st_ivas->nchan_ism ); +#else nchan_out = st_ivas->hDecoderConfig->nchan_out; if ( output_config == AUDIO_CONFIG_EXTERNAL ) @@ -449,6 +468,7 @@ ivas_error ivas_param_ism_dec_open( hDirAC->hParamIsm->num_obj = MAX_NUM_OBJECTS; } ivas_param_ism_config( hDirAC->hParamIsm ); +#endif /*-----------------------------------------------------------------* * set input parameters @@ -480,7 +500,11 @@ ivas_error ivas_param_ism_dec_open( if ( output_config == AUDIO_CONFIG_EXTERNAL ) { /* nchan_out is essential for memory initialization for CLDFB Synthesis */ +#ifdef NCHAN_ISM_PARAMETER + st_ivas->hIntSetup.nchan_out_woLFE = st_ivas->nchan_ism; +#else st_ivas->hIntSetup.nchan_out_woLFE = hDirAC->hParamIsm->num_obj; +#endif st_ivas->hIntSetup.is_loudspeaker_setup = 1; } @@ -619,9 +643,7 @@ ivas_error ivas_param_ism_dec_open( } } -#ifdef PARAM_ISM_DTX_CNG st_ivas->hISMDTX.dtx_flag = 0; -#endif st_ivas->hDirAC = hDirAC; @@ -637,11 +659,19 @@ ivas_error ivas_param_ism_dec_open( *-------------------------------------------------------------------------*/ void ivas_param_ism_dec_close( - DIRAC_DEC_HANDLE hDirAC, /* i/o: decoder DirAC handle */ - AUDIO_CONFIG output_config /* i : output audio configuration */ + DIRAC_DEC_HANDLE *hDirAC_out, /* i/o: decoder DirAC handle */ + AUDIO_CONFIG output_config /* i : output audio configuration */ ) { int16_t i; + DIRAC_DEC_HANDLE hDirAC; + + if ( hDirAC_out == NULL || *hDirAC_out == NULL ) + { + return; + } + + hDirAC = *hDirAC_out; /* Config & CLDFB */ if ( hDirAC->hParamIsm != NULL ) @@ -798,7 +828,8 @@ void ivas_param_ism_dec_close( hDirAC->hParamIsmRendering = NULL; } - free( hDirAC ); + free( *hDirAC_out ); + *hDirAC_out = NULL; return; } @@ -817,9 +848,7 @@ void ivas_param_ism_dec( { int16_t ch, nchan_transport, nchan_out, nchan_out_woLFE, i; int16_t subframe_idx, slot_idx, index_slot, bin_idx; -#ifdef PARAM_ISM_DTX_CNG int32_t ivas_total_brate; -#endif /* CLDFB Input Buffers */ float Cldfb_RealBuffer_in[PARAM_ISM_MAX_DMX][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; @@ -846,7 +875,11 @@ void ivas_param_ism_dec( nchan_transport = st_ivas->nchan_transport; if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) { +#ifdef NCHAN_ISM_PARAMETER + nchan_out = st_ivas->nchan_ism; +#else nchan_out = st_ivas->hDirAC->hParamIsm->num_obj; +#endif nchan_out_woLFE = nchan_out; st_ivas->hDecoderConfig->nchan_out = nchan_out; } @@ -856,9 +889,7 @@ void ivas_param_ism_dec( nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; } -#ifdef PARAM_ISM_DTX_CNG ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; -#endif hSetup = st_ivas->hIntSetup; @@ -866,10 +897,13 @@ void ivas_param_ism_dec( /* Frame-level Processing */ /* De-quantization */ -#ifdef PARAM_ISM_DTX_CNG if ( !( ivas_total_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) ) { +#ifdef NCHAN_ISM_PARAMETER + ivas_param_ism_dec_dequant_DOA( hDirAC, st_ivas->nchan_ism ); +#else ivas_param_ism_dec_dequant_DOA( hDirAC ); +#endif ivas_param_ism_dec_dequant_powrat( hDirAC ); st_ivas->hISMDTX.dtx_flag = 0; } @@ -877,15 +911,15 @@ void ivas_param_ism_dec( { st_ivas->hISMDTX.dtx_flag = 1; } -#else - ivas_param_ism_dec_dequant_DOA( hDirAC ); - ivas_param_ism_dec_dequant_powrat( hDirAC ); -#endif /* obtain the direct response using EFAP */ if ( !( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) ) { +#ifdef NCHAN_ISM_PARAMETER + for ( i = 0; i < st_ivas->nchan_ism; i++ ) +#else for ( i = 0; i < hDirAC->hParamIsm->num_obj; i++ ) +#endif { efap_determine_gains( st_ivas->hEFAPdata, direct_response[i], hDirAC->azimuth_values[i], hDirAC->elevation_values[i], EFAP_MODE_EFAP ); } @@ -894,7 +928,11 @@ void ivas_param_ism_dec( { int16_t j; +#ifdef NCHAN_ISM_PARAMETER + for ( i = 0; i < st_ivas->nchan_ism; i++ ) +#else for ( i = 0; i < hDirAC->hParamIsm->num_obj; i++ ) +#endif { for ( j = 0; j < nchan_out_woLFE; j++ ) { @@ -943,10 +981,10 @@ void ivas_param_ism_dec( } /* Compute mixing matrix */ -#ifdef PARAM_ISM_DTX_CNG - ivas_param_ism_compute_mixing_matrix( hDirAC, st_ivas->hISMDTX, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, direct_response, nchan_transport, nchan_out_woLFE, 0, CLDFB_NO_COL_MAX, mixing_matrix ); +#ifdef NCHAN_ISM_PARAMETER + ivas_param_ism_compute_mixing_matrix( st_ivas->nchan_ism, hDirAC, st_ivas->hISMDTX, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, direct_response, nchan_transport, nchan_out_woLFE, 0, CLDFB_NO_COL_MAX, mixing_matrix ); #else - ivas_param_ism_compute_mixing_matrix( hDirAC, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, direct_response, nchan_transport, nchan_out_woLFE, 0, CLDFB_NO_COL_MAX, mixing_matrix ); + ivas_param_ism_compute_mixing_matrix( hDirAC, st_ivas->hISMDTX, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, direct_response, nchan_transport, nchan_out_woLFE, 0, CLDFB_NO_COL_MAX, mixing_matrix ); #endif /* subframe loop for synthesis*/ @@ -1016,7 +1054,11 @@ void ivas_param_ism_dec( ivas_param_ism_update_mixing_matrix( hDirAC, mixing_matrix, nchan_transport, nchan_out_woLFE ); /* store MetaData parameters */ +#ifdef NCHAN_ISM_PARAMETER + for ( ch = 0; ch < st_ivas->nchan_ism; ch++ ) +#else for ( ch = 0; ch < hDirAC->hParamIsm->num_obj; ch++ ) +#endif { if ( st_ivas->hDirAC->azimuth_values[ch] > 180.0f ) { @@ -1053,19 +1095,20 @@ void ivas_param_ism_params_to_masa_param_mapping( int16_t azimuth[2]; int16_t elevation[2]; float power_ratio[2]; -#ifdef PARAM_ISM_DTX_CNG int32_t ivas_total_brate; -#endif hDirAC = st_ivas->hDirAC; nBins = hDirAC->num_freq_bands; -#ifdef PARAM_ISM_DTX_CNG ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; if ( !( ivas_total_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) ) { +#ifdef NCHAN_ISM_PARAMETER + ivas_param_ism_dec_dequant_DOA( hDirAC, st_ivas->nchan_ism ); +#else ivas_param_ism_dec_dequant_DOA( hDirAC ); +#endif ivas_param_ism_dec_dequant_powrat( hDirAC ); st_ivas->hISMDTX.dtx_flag = 0; } @@ -1073,14 +1116,13 @@ void ivas_param_ism_params_to_masa_param_mapping( { st_ivas->hISMDTX.dtx_flag = 1; } -#else - ivas_param_ism_dec_dequant_DOA( hDirAC ); - ivas_param_ism_dec_dequant_powrat( hDirAC ); -#endif +#ifdef NCHAN_ISM_PARAMETER + if ( st_ivas->nchan_ism > 1 ) +#else if ( hDirAC->hParamIsm->num_obj > 1 ) +#endif { -#ifdef PARAM_ISM_DTX_CNG if ( st_ivas->hISMDTX.dtx_flag ) { float energy_ratio; @@ -1142,44 +1184,6 @@ void ivas_param_ism_params_to_masa_param_mapping( } } } -#else - hDirAC->numSimultaneousDirections = 2; - for ( band_idx = 0; band_idx < hDirAC->hParamIsm->nbands; band_idx++ ) - { - brange[0] = hDirAC->hParamIsm->band_grouping[band_idx]; - brange[1] = hDirAC->hParamIsm->band_grouping[band_idx + 1]; - - azimuth[0] = (int16_t) roundf( hDirAC->azimuth_values[hDirAC->hParamIsm->obj_indices[band_idx][0][0]] ); - elevation[0] = (int16_t) roundf( hDirAC->elevation_values[hDirAC->hParamIsm->obj_indices[band_idx][0][0]] ); - power_ratio[0] = hDirAC->power_ratios[band_idx][0][0]; - - azimuth[1] = (int16_t) roundf( hDirAC->azimuth_values[hDirAC->hParamIsm->obj_indices[band_idx][0][1]] ); - elevation[1] = (int16_t) roundf( hDirAC->elevation_values[hDirAC->hParamIsm->obj_indices[band_idx][0][1]] ); - power_ratio[1] = hDirAC->power_ratios[band_idx][0][1]; - - for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) - { - for ( bin_idx = brange[0]; bin_idx < brange[1]; bin_idx++ ) - { - hDirAC->azimuth[sf_idx][bin_idx] = azimuth[0]; - hDirAC->elevation[sf_idx][bin_idx] = elevation[0]; - hDirAC->energy_ratio1[sf_idx][bin_idx] = power_ratio[0]; - hDirAC->azimuth2[sf_idx][bin_idx] = azimuth[1]; - hDirAC->elevation2[sf_idx][bin_idx] = elevation[1]; - hDirAC->energy_ratio2[sf_idx][bin_idx] = power_ratio[1]; - } - } - } - for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) - { - for ( bin_idx = 0; bin_idx < nBins; bin_idx++ ) - { - hDirAC->spreadCoherence[sf_idx][bin_idx] = 0.0f; - hDirAC->spreadCoherence2[sf_idx][bin_idx] = 0.0f; - hDirAC->surroundingCoherence[sf_idx][bin_idx] = 0.0; - } - } -#endif } else { @@ -1202,8 +1206,7 @@ void ivas_param_ism_params_to_masa_param_mapping( return; } - -#ifdef PARAM_ISM_DTX_CNG +#ifndef DISCRETE_ISM_DTX_CNG static void ivas_param_ism_dec_dequantize_DOA_dtx( int16_t azi_bits, int16_t ele_bits, @@ -1301,7 +1304,11 @@ void ivas_param_ism_metadata_dtx_dec( /* number of objects was already read in ivas_ism_get_dtx_dec() */ /* update the position in the bitstream */ +#ifdef NCHAN_ISM_PARAMETER + st0->next_bit_pos += st_ivas->nchan_ism; +#else st0->next_bit_pos += hParamIsm->num_obj; +#endif /* read sce id */ st_ivas->hISMDTX.sce_id_dtx = get_next_indice( st0, 1 ); @@ -1315,7 +1322,11 @@ void ivas_param_ism_metadata_dtx_dec( st_ivas->hSCE[1]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence = st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence; /* get the DOA'S */ +#ifdef NCHAN_ISM_PARAMETER + for ( i = 0; i < st_ivas->nchan_ism; i++ ) +#else for ( i = 0; i < hParamIsm->num_obj; i++ ) +#endif { /* read from bitstream and dequantize */ azi_idx = get_next_indice( st0, PARAM_ISM_DTX_AZI_BITS ); diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index a965a0ffed..a5bdcc4100 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -107,11 +107,15 @@ void ivas_ism_render( float tmp_output_f[MAX_OUTPUT_CHANNELS][L_FRAME48k]; float gains[MAX_NUM_OBJECTS][MAX_OUTPUT_CHANNELS]; float g1, g2; - int16_t num_objects, nchan_out_woLFE, lfe_index; + int16_t nchan_ism, nchan_out_woLFE, lfe_index; int16_t azimuth, elevation; float Rmat[3][3]; - num_objects = st_ivas->nchan_transport; +#ifdef NCHAN_ISM_PARAMETER + nchan_ism = st_ivas->nchan_ism; +#else + nchan_ism = st_ivas->nchan_transport; +#endif nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; lfe_index = 0; @@ -121,7 +125,7 @@ void ivas_ism_render( set_f( tmp_output_f[j], 0.0f, output_frame ); } - for ( i = 0; i < num_objects; i++ ) + for ( i = 0; i < nchan_ism; i++ ) { mvr2r( output_f[i], input_f[i], output_frame ); } @@ -137,7 +141,7 @@ void ivas_ism_render( QuatToRotMat( st_ivas->hHeadTrackData->Quaternions[st_ivas->hHeadTrackData->num_quaternions++], Rmat ); } - for ( i = 0; i < num_objects; i++ ) + for ( i = 0; i < nchan_ism; i++ ) { if ( st_ivas->intern_config == AUDIO_CONFIG_STEREO ) { diff --git a/lib_dec/ivas_lfe_dec.c b/lib_dec/ivas_lfe_dec.c index 55a68d892b..5c250286ee 100644 --- a/lib_dec/ivas_lfe_dec.c +++ b/lib_dec/ivas_lfe_dec.c @@ -477,19 +477,25 @@ ivas_error ivas_create_lfe_dec( *-------------------------------------------------------------------------*/ void ivas_lfe_dec_close( - LFE_DEC_HANDLE hLFE /* i/o: LFE decoder handle */ + LFE_DEC_HANDLE *hLFE /* i/o: LFE decoder handle */ ) { - free( hLFE->pWindow_state ); - hLFE->pWindow_state = NULL; + if ( hLFE == NULL || *hLFE == NULL ) + { + return; + } - if ( hLFE->lfe_delay_buf != NULL ) + free( ( *hLFE )->pWindow_state ); + ( *hLFE )->pWindow_state = NULL; + + if ( ( *hLFE )->lfe_delay_buf != NULL ) { - free( hLFE->lfe_delay_buf ); - hLFE->lfe_delay_buf = NULL; + free( ( *hLFE )->lfe_delay_buf ); + ( *hLFE )->lfe_delay_buf = NULL; } - free( hLFE ); + free( ( *hLFE ) ); + ( *hLFE ) = NULL; return; } diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index b8b7b74ffc..5b0223a9be 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -392,9 +392,18 @@ ivas_error ivas_masa_dec_open( *-----------------------------------------------------------------------*/ void ivas_masa_dec_close( - MASA_DECODER_HANDLE hMasa /* i/o: MASA metadata structure */ + MASA_DECODER_HANDLE *hMasa_out /* i/o: MASA metadata structure */ ) { + MASA_DECODER_HANDLE hMasa; + + if ( hMasa_out == NULL || *hMasa_out == NULL ) + { + return; + } + + hMasa = *hMasa_out; + /* Free spherical grid memory if in use */ if ( hMasa->data.sph_grid16 != NULL ) { @@ -436,8 +445,8 @@ void ivas_masa_dec_close( hMasa->hMasaLfeSynth = NULL; } - free( hMasa ); - hMasa = NULL; + free( *hMasa_out ); + *hMasa_out = NULL; return; } @@ -492,7 +501,19 @@ static ivas_error ivas_masa_dec_config( ivas_set_qmetadata_maxbit_req( st_ivas->hQMetaData, st_ivas->ivas_format ); +#ifdef FIX_373_MASA_DELAY_COMP_MSAN + if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) + { + /* need to apply the sampling rate correction also for the EXT output MASA meta buffer */ + masa_sample_rate_band_correction( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hQMetaData, st_ivas->hDecoderConfig->output_Fs, hMasa->data.extOutMeta ); + } + else + { + masa_sample_rate_band_correction( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hQMetaData, st_ivas->hDecoderConfig->output_Fs, NULL ); + } +#else masa_sample_rate_band_correction( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hQMetaData, st_ivas->hDecoderConfig->output_Fs ); +#endif return error; } diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 6bfddc78e6..a6637ed1f2 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1124,8 +1124,8 @@ void ivas_param_mc_dec_close( hParamMC->hoa_encoder = NULL; } - free( hParamMC ); - hParamMC = NULL; + free( *hParamMC_out ); + *hParamMC_out = NULL; return; } diff --git a/lib_dec/ivas_mcmasa_dec.c b/lib_dec/ivas_mcmasa_dec.c index f6d159083b..3ef12f3094 100644 --- a/lib_dec/ivas_mcmasa_dec.c +++ b/lib_dec/ivas_mcmasa_dec.c @@ -58,10 +58,7 @@ ivas_error ivas_mcmasa_dec_reconfig( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; /* close the old MASA instance */ - if ( st_ivas->hMasa != NULL ) - { - ivas_masa_dec_close( st_ivas->hMasa ); - } + ivas_masa_dec_close( &( st_ivas->hMasa ) ); /* get new McMASA settings */ ivas_mcmasa_setNumTransportChannels( &( st_ivas->nchan_transport ), &( st_ivas->element_mode_init ), ivas_total_brate ); diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 332455974c..553cdf2a1b 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -166,7 +166,6 @@ ivas_error ivas_mct_dec( /* MCT core decoder */ ivas_mct_core_dec( hMCT, st_ivas->hCPE, nCPE, output ); -#ifdef DISABLE_RES_CHANNELS_MCT /* for sba to stereo output disable any further processing for TCs > 2 as it is not needed*/ if ( st_ivas->sba_dirac_stereo_flag ) { @@ -178,7 +177,6 @@ ivas_error ivas_mct_dec( } } } -#endif /* MCT reconstruction and CoreCoder updates */ for ( cpe_id = 0; cpe_id < nCPE; cpe_id++ ) @@ -730,24 +728,14 @@ static ivas_error ivas_mc_dec_reconfig( if ( st_ivas->hParamMC != NULL ) { ivas_param_mc_dec_close( &st_ivas->hParamMC ); - st_ivas->hParamMC = NULL; /* remove ls conversion if it was allocated by ParamMC */ ivas_ls_setup_conversion_close( &st_ivas->hLsSetUpConversion ); } /* De-allocate McMasa-related handles */ - if ( st_ivas->hMasa != NULL ) - { - ivas_masa_dec_close( st_ivas->hMasa ); - st_ivas->hMasa = NULL; - } - - if ( st_ivas->hQMetaData != NULL ) - { - ivas_qmetadata_close( &st_ivas->hQMetaData ); - st_ivas->hQMetaData = NULL; - } + ivas_masa_dec_close( &( st_ivas->hMasa ) ); + ivas_qmetadata_close( &st_ivas->hQMetaData ); /* init LS conversion if the renderer type asks for it */ if ( st_ivas->renderer_type == RENDERER_MC && st_ivas->hLsSetUpConversion == NULL ) @@ -783,32 +771,18 @@ static ivas_error ivas_mc_dec_reconfig( } /* De-allocate McMasa-related handles */ - if ( st_ivas->hMasa != NULL ) - { - ivas_masa_dec_close( st_ivas->hMasa ); - st_ivas->hMasa = NULL; - } - - if ( st_ivas->hQMetaData != NULL ) - { - ivas_qmetadata_close( &st_ivas->hQMetaData ); - st_ivas->hQMetaData = NULL; - } + ivas_masa_dec_close( &( st_ivas->hMasa ) ); + ivas_qmetadata_close( &st_ivas->hQMetaData ); if ( last_mc_mode == MC_MODE_MCT ) { if ( st_ivas->hMCT != NULL && st_ivas->nchan_transport <= CPE_CHANNELS ) { ivas_mct_dec_close( &st_ivas->hMCT ); - st_ivas->hMCT = NULL; } /* LFE handle */ - if ( st_ivas->hLFE != NULL ) - { - ivas_lfe_dec_close( st_ivas->hLFE ); - st_ivas->hLFE = NULL; - } + ivas_lfe_dec_close( &( st_ivas->hLFE ) ); } } else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) @@ -842,18 +816,10 @@ static ivas_error ivas_mc_dec_reconfig( if ( last_mc_mode == MC_MODE_MCT ) { - if ( st_ivas->hMCT != NULL ) - { - ivas_mct_dec_close( &st_ivas->hMCT ); - st_ivas->hMCT = NULL; - } + ivas_mct_dec_close( &st_ivas->hMCT ); /* LFE handle */ - if ( st_ivas->hLFE != NULL ) - { - ivas_lfe_dec_close( st_ivas->hLFE ); - st_ivas->hLFE = NULL; - } + ivas_lfe_dec_close( &( st_ivas->hLFE ) ); } } @@ -1048,10 +1014,9 @@ static ivas_error ivas_mc_dec_reconfig( } } } - else if ( ( st_ivas->renderer_type == RENDERER_DISABLE ) && ( st_ivas->hDirAC != NULL ) ) + else if ( st_ivas->renderer_type == RENDERER_DISABLE && st_ivas->hDirAC != NULL ) { - ivas_dirac_dec_close( st_ivas->hDirAC ); - st_ivas->hDirAC = NULL; + ivas_dirac_dec_close( &( st_ivas->hDirAC ) ); } } @@ -1070,17 +1035,9 @@ static ivas_error ivas_mc_dec_reconfig( ivas_binRenderer_close( &st_ivas->hBinRenderer ); } -#ifdef FIX_197_CREND_INTERFACE if ( ( st_ivas->hCrendWrapper != NULL ) && ( st_ivas->hCrendWrapper->hCrend != NULL ) && ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV && st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM && ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD || st_ivas->hRenderConfig->roomAcoustics.late_reverb_on == 0 ) ) ) -#else - if ( st_ivas->hCrend != NULL && ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV && st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM && ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD || st_ivas->hRenderConfig->roomAcoustics.late_reverb_on == 0 ) ) ) -#endif { -#ifdef FIX_197_CREND_INTERFACE ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) ); -#else - ivas_crend_close( st_ivas ); -#endif } if ( st_ivas->hBinRendererTd != NULL && ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD ) ) @@ -1136,43 +1093,29 @@ static ivas_error ivas_mc_dec_reconfig( return error; } -#ifdef FIX_197_CREND_INTERFACE if ( st_ivas->hRenderConfig->roomAcoustics.late_reverb_on ) { -#ifdef FIX_329_ENABLE_TD_RENDERER_REVERB_MC if ( ( error = ivas_rend_initCrendWrapper( &st_ivas->hCrendWrapper ) ) != IVAS_ERR_OK ) -#else - if ( ( st_ivas->hCrendWrapper = (CREND_WRAPPER_HANDLE) malloc( sizeof( CREND_WRAPPER ) ) ) == NULL ) -#endif { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend Wrapper\n" ); } -#ifdef FIX_329_ENABLE_TD_RENDERER_REVERB_MC st_ivas->hCrendWrapper->hCrend = NULL; st_ivas->hCrendWrapper->hHrtfCrend = NULL; -#endif if ( ( st_ivas->hCrendWrapper->hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend\n" ); } } -#else - if ( st_ivas->hCrend == NULL && st_ivas->hRenderConfig->roomAcoustics.late_reverb_on ) - { - if ( ( st_ivas->hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend\n" ); - } - } -#endif } -#ifdef FIX_197_CREND_INTERFACE else if ( st_ivas->hCrendWrapper == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) { if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, - st_ivas->hRenderConfig, st_ivas->hDecoderConfig->Opt_Headrotation, + st_ivas->hRenderConfig, +#ifndef FIX_I109_ORIENTATION_TRACKING + st_ivas->hDecoderConfig->Opt_Headrotation, +#endif st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { @@ -1180,15 +1123,6 @@ static ivas_error ivas_mc_dec_reconfig( } st_ivas->binaural_latency_ns = st_ivas->hCrendWrapper->binaural_latency_ns; } -#else - else if ( st_ivas->hCrend == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) - { - if ( ivas_crend_open( st_ivas ) != IVAS_ERR_OK ) - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "ivas_crend_open failed" ); - } - } -#endif } /* mono/stereo */ else if ( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 8780b4ea98..d06a2b8f5b 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -53,8 +53,13 @@ ivas_error ivas_td_binaural_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ) { +#ifdef TD5 + return ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, st_ivas->nchan_transport, st_ivas->ivas_format, + st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ); +#else return ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, st_ivas->nchan_transport, st_ivas->ivas_format, st_ivas->transport_config, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ); +#endif } @@ -72,20 +77,13 @@ ivas_error ivas_td_binaural_renderer( ) { return ivas_td_binaural_renderer_unwrap( -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND st_ivas->hReverb, -#else - st_ivas->hRenderConfig, st_ivas->ini_frame, -#ifdef FIX_197_CREND_INTERFACE - st_ivas->hCrendWrapper, -#else - st_ivas->hCrend, -#endif -#endif st_ivas->transport_config, -#ifndef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - st_ivas->hDecoderConfig->output_Fs, -#endif st_ivas->hBinRendererTd, st_ivas->nchan_transport, LFE_CHANNEL, st_ivas->ivas_format, +#ifdef TD5 + st_ivas->hIsmMetaData, st_ivas->hDecoderConfig->Opt_Headrotation, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Quaternions : NULL, + ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Pos : NULL, output, output_frame ); +#else st_ivas->hIsmMetaData, st_ivas->hDecoderConfig->Opt_Headrotation, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Quaternions : NULL, output, output_frame ); +#endif } diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 525e775eb9..745ea1b9ba 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -47,7 +47,7 @@ #include "wmc_auto.h" /*-------------------------------------------------------------------* - * ivas_sba_dec_decoder() + * ivas_sba_dec_reconfigure() * * Reconfigure IVAS SBA decoder *-------------------------------------------------------------------*/ @@ -65,9 +65,7 @@ ivas_error ivas_sba_dec_reconfigure( RENDERER_TYPE old_renderer_type; DECODER_CONFIG_HANDLE hDecoderConfig; ivas_error error; -#ifdef SBA_BR_SWITCHING_CLEAN_UP int16_t band_grouping[IVAS_MAX_NUM_BANDS + 1]; -#endif error = IVAS_ERR_OK; @@ -112,12 +110,7 @@ ivas_error ivas_sba_dec_reconfigure( if ( st_ivas->sba_mode != SBA_MODE_SPAR ) { -#ifndef SBA_BR_SWITCHING_CLEAN_UP - ivas_spar_dec_close( st_ivas->hSpar, hDecoderConfig->output_Fs ); -#else - ivas_spar_dec_close( st_ivas->hSpar, hDecoderConfig->output_Fs, 0 ); -#endif - st_ivas->hSpar = NULL; + ivas_spar_dec_close( &( st_ivas->hSpar ), hDecoderConfig->output_Fs, 0 ); if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_mode, -1 ) ) != IVAS_ERR_OK ) { @@ -128,78 +121,11 @@ ivas_error ivas_sba_dec_reconfigure( } else { -#ifdef SBA_BR_SWITCHING_CLEAN_UP int16_t sba_order_internal; -#else - int16_t i, sba_order_internal, nchan_internal; - DIRAC_DEC_HANDLE hDirAC = st_ivas->hDirAC; -#endif SPAR_DEC_HANDLE hSpar = st_ivas->hSpar; sba_order_internal = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ); -#ifndef SBA_BR_SWITCHING_CLEAN_UP - nchan_internal = ivas_sba_get_nchan_metadata( sba_order_internal ); - if ( hSpar != NULL && nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) ) - { - // VE: dirty patch -> reconfiguration of SPAR modules should be used instead !! - IVAS_FB_CFG *fb_cfg; - int16_t active_w_mixing; - - /* MD handle */ - ivas_spar_md_dec_close( &hSpar->hMdDec ); - - if ( ( error = ivas_spar_md_dec_open( &hSpar->hMdDec, st_ivas->hDecoderConfig, nchan_internal, sba_order_internal, st_ivas->sid_format ) ) != IVAS_ERR_OK ) - { - return error; - } - hSpar->hMdDec->td_decorr_flag = 1; - hSpar->hMdDec->table_idx = -1; - - /* TD decorr. */ - ivas_td_decorr_dec_close( &hSpar->hTdDecorr ); - - if ( ( error = ivas_td_decorr_dec_open( &hSpar->hTdDecorr, hDecoderConfig->output_Fs, nchan_internal, 1 ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* FB mixer handle */ - ivas_FB_mixer_close( &hSpar->hFbMixer, hDecoderConfig->output_Fs ); - - /* set FB config. */ - active_w_mixing = -1; - if ( ( error = ivas_fb_set_cfg( &fb_cfg, SBA_FORMAT, SBA_MODE_SPAR, nchan_internal, nchan_internal, active_w_mixing, hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) - { - return error; - } - fb_cfg->pcm_offset = NS2SA( hDecoderConfig->output_Fs, DELAY_FB_1_NS + IVAS_ENC_DELAY_NS + IVAS_DEC_DELAY_NS ); - fb_cfg->remix_order = remix_order_set[hSpar->hMdDec->spar_md_cfg.remix_unmix_order]; - - /* FB mixer handle */ - if ( ( error = ivas_FB_mixer_open( &hSpar->hFbMixer, hDecoderConfig->output_Fs, fb_cfg ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* mixer_mat intitialization */ - for ( i = 0; i < nchan_internal; i++ ) - { - for ( int16_t j = 0; j < nchan_internal; j++ ) - { - for ( int16_t b = 0; b < IVAS_MAX_NUM_BANDS; b++ ) - { - hSpar->hMdDec->mixer_mat[i][j][b] = 0.0f; - for ( int16_t i_ts = 0; i_ts < ( MAX_PARAM_SPATIAL_SUBFRAMES + 1 ); i_ts++ ) - { - hSpar->hMdDec->mixer_mat_prev[i_ts][i][j][b] = 0.0f; - } - } - } - } - hSpar->i_subframe = 0; - } -#else if ( hSpar != NULL ) { if ( ( hSpar->hPCA != NULL ) && ( ( hDecoderConfig->ivas_total_brate != PCA_BRATE ) || ( sba_order_internal != 1 ) ) ) @@ -211,13 +137,14 @@ ivas_error ivas_sba_dec_reconfigure( if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) ) { - ivas_spar_dec_close( st_ivas->hSpar, hDecoderConfig->output_Fs, 1 ); + ivas_spar_dec_close( &( st_ivas->hSpar ), hDecoderConfig->output_Fs, 1 ); if ( ( error = ivas_spar_dec_open( st_ivas, 1 ) ) != IVAS_ERR_OK ) { return error; } } + ivas_spar_config( ivas_total_brate, sba_order_internal, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &hSpar->core_nominal_brate, st_ivas->sid_format ); } else @@ -230,61 +157,6 @@ ivas_error ivas_sba_dec_reconfigure( hSpar = st_ivas->hSpar; st_ivas->sba_dirac_stereo_flag = 0; -#endif -#ifndef SBA_BR_SWITCHING_CLEAN_UP - /* PCA handle */ - if ( hSpar != NULL ) - { - if ( hDecoderConfig->ivas_total_brate == PCA_BRATE && sba_order_internal == 1 ) - { - if ( ( hSpar->hPCA = (PCA_DEC_STATE *) malloc( sizeof( PCA_DEC_STATE ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for PCA decoder" ); - } - - ivas_pca_dec_init( hSpar->hPCA ); - } - else if ( hSpar->hPCA != NULL ) - { - free( st_ivas->hSpar->hPCA ); - hSpar->hPCA = NULL; - } - } - - if ( hSpar == NULL && st_ivas->sba_mode == SBA_MODE_SPAR ) - { - if ( ( error = ivas_spar_dec_open( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - - hSpar = st_ivas->hSpar; - } - st_ivas->sba_dirac_stereo_flag = 0; - - sba_order_internal = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ); - ivas_spar_config( ivas_total_brate, sba_order_internal, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &hSpar->core_nominal_brate, st_ivas->sid_format ); - - if ( hDirAC == NULL && st_ivas->sba_mode == SBA_MODE_DIRAC ) - { - if ( ( error = ivas_dirac_dec_open( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - - hDirAC = st_ivas->hDirAC; - } - - if ( hDirAC != NULL && sba_mode_old == st_ivas->sba_mode ) - { - ivas_dirac_dec_config( st_ivas, DIRAC_RECONFIGURE_MODE ); - } - - if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_mode, IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } if ( st_ivas->nchan_transport == 1 ) @@ -351,7 +223,6 @@ ivas_error ivas_sba_dec_reconfigure( ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); } -#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( sba_mode_old != st_ivas->sba_mode ) || ( ( st_ivas->sba_mode == SBA_MODE_SPAR ) && ( ( hDecoderConfig->output_config != AUDIO_CONFIG_FOA ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO ) ) ) ) { DIRAC_CONFIG_FLAG flag_config; @@ -382,51 +253,19 @@ ivas_error ivas_sba_dec_reconfigure( if ( ( ( hDecoderConfig->output_config == AUDIO_CONFIG_FOA ) || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO ) || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO ) ) && ( ( sba_mode_old != st_ivas->sba_mode ) && ( st_ivas->sba_mode == SBA_MODE_SPAR ) ) ) { - if ( st_ivas->hDirAC != NULL ) - { - ivas_dirac_dec_close( st_ivas->hDirAC ); - st_ivas->hDirAC = NULL; - } + ivas_dirac_dec_close( &( st_ivas->hDirAC ) ); st_ivas->hSpar->enc_param_start_band = min( IVAS_MAX_NUM_BANDS, SPAR_DIRAC_SPLIT_START_BAND ); ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 ); } -#else - if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( sba_mode_old != st_ivas->sba_mode ) ) - { - DIRAC_CONFIG_FLAG flag_config; - - flag_config = DIRAC_OPEN; - if ( st_ivas->hDirAC != NULL ) - { - flag_config = DIRAC_RECONFIGURE; - if ( sba_mode_old != st_ivas->sba_mode && st_ivas->sba_mode != SBA_MODE_SPAR ) - { - flag_config = DIRAC_RECONFIGURE_MODE; - } - } - - if ( ( error = ivas_dirac_dec_config( st_ivas, flag_config ) ) != IVAS_ERR_OK ) - { - return error; - } - } -#endif else if ( st_ivas->renderer_type == RENDERER_DISABLE || ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC && st_ivas->sba_mode != SBA_MODE_SPAR ) ) { - if ( st_ivas->hDirAC != NULL ) - { - ivas_dirac_dec_close( st_ivas->hDirAC ); - st_ivas->hDirAC = NULL; - } + ivas_dirac_dec_close( &( st_ivas->hDirAC ) ); - if ( st_ivas->hVBAPdata != NULL ) - { - vbap_free_data( &( st_ivas->hVBAPdata ) ); - } + vbap_free_data( &( st_ivas->hVBAPdata ) ); } if ( st_ivas->hDirAC != NULL && st_ivas->sba_mode == SBA_MODE_SPAR ) diff --git a/lib_dec/ivas_sba_rendering_internal.c b/lib_dec/ivas_sba_rendering_internal.c index bd799f9d5f..a80986b39e 100644 --- a/lib_dec/ivas_sba_rendering_internal.c +++ b/lib_dec/ivas_sba_rendering_internal.c @@ -282,7 +282,7 @@ void ivas_ism2sba( float buffer_td[][L_FRAME48k], /* i/o: TD signal buffers */ ISM_RENDERER_HANDLE hIsmRendererData, /* i/o: renderer data */ const ISM_METADATA_HANDLE hIsmMetaData[], /* i : object metadata */ - const int16_t num_objects, /* i : number of objects */ + const int16_t nchan_ism, /* i : number of objects */ const int16_t output_frame, /* i : output frame length per channel */ const int16_t sba_order /* i : Ambisonic (SBA) order */ ) @@ -304,7 +304,7 @@ void ivas_ism2sba( set_zero( buffer_tmp[j], output_frame ); } - for ( i = 0; i < num_objects; i++ ) + for ( i = 0; i < nchan_ism; i++ ) { // TODO tmu review when #215 is resolved azimuth = (int16_t) floorf( hIsmMetaData[i]->azimuth + 0.5f ); diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index ac948a59c4..5c06b4b49d 100644 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -77,12 +77,14 @@ ivas_error ivas_sce_dec( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; -#ifdef PARAM_ISM_DTX_CNG +#ifdef DISCRETE_ISM_DTX_CNG + if ( st_ivas->ivas_format == ISM_FORMAT ) +#else if ( st_ivas->ism_mode == ISM_MODE_PARAM ) +#endif { - st->cng_type = FD_CNG; /* TODO: move to init if possible */ + st->cng_type = FD_CNG; } -#endif /*------------------------------------------------------------------* * Read audio bandwidth info @@ -98,18 +100,21 @@ ivas_error ivas_sce_dec( { st->total_brate = ivas_total_brate; } +#ifdef DISCRETE_ISM_DTX_CNG + else if ( !st_ivas->bfi && st_ivas->ivas_format != ISM_FORMAT && last_ivas_total_brate <= IVAS_SID_5k2 ) + { + st->total_brate = hSCE->element_brate - nb_bits_metadata * FRAMES_PER_SEC; + } +#else else if ( !st_ivas->bfi && ( last_ivas_total_brate <= SID_2k40 || last_ivas_total_brate == IVAS_SID_5k2 ) ) { -#ifdef PARAM_ISM_DTX_CNG /* check if this is indeed needed? */ if ( st_ivas->ivas_format != ISM_FORMAT ) { st->total_brate = hSCE->element_brate - nb_bits_metadata * FRAMES_PER_SEC; } -#else - st->total_brate = hSCE->element_brate - nb_bits_metadata * FRAMES_PER_SEC; -#endif } +#endif /* read the bandwidth */ if ( st_ivas->bfi || st->total_brate <= SID_2k40 ) @@ -120,7 +125,7 @@ ivas_error ivas_sce_dec( { if ( st->low_rate_mode ) { - /* ISm Low-rate mode -> always WB */ + /* ISM Low-rate mode -> always WB */ st->bwidth = WB; } else if ( hSCE->element_brate < MIN_BRATE_SWB_SCE ) @@ -229,11 +234,7 @@ ivas_error ivas_sce_dec( * Decoder *----------------------------------------------------------------*/ -#ifdef PARAM_ISM_DTX_CNG if ( ( error = ivas_core_dec( st_ivas, hSCE, NULL, NULL, 1, output, outputHB, NULL, st_ivas->sba_dirac_stereo_flag ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_core_dec( NULL, hSCE, NULL, NULL, 1, output, outputHB, NULL, st_ivas->sba_dirac_stereo_flag ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 7515300681..01e4db2ed4 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -61,11 +61,8 @@ static void ivas_spar_dec_MD( Decoder_Struct *st_ivas, Decoder_State *st0 ); *------------------------------------------------------------------------*/ ivas_error ivas_spar_dec_open( - Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP - , + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ -#endif ) { SPAR_DEC_HANDLE hSpar; @@ -78,20 +75,16 @@ ivas_error ivas_spar_dec_open( error = IVAS_ERR_OK; sba_order_internal = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ); num_channels_internal = ivas_sba_get_nchan_metadata( sba_order_internal ); -#ifdef SBA_BR_SWITCHING_CLEAN_UP hSpar = st_ivas->hSpar; if ( !spar_reconfig_flag ) { -#endif /* SPAR decoder handle */ if ( ( hSpar = (SPAR_DEC_HANDLE) malloc( sizeof( SPAR_DEC_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR decoder" ); } -#ifdef SBA_BR_SWITCHING_CLEAN_UP } -#endif output_Fs = st_ivas->hDecoderConfig->output_Fs; @@ -119,11 +112,7 @@ ivas_error ivas_spar_dec_open( fb_cfg->remix_order = remix_order_set[hSpar->hMdDec->spar_md_cfg.remix_unmix_order]; /* FB mixer handle */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &hSpar->hFbMixer, output_Fs, fb_cfg, spar_reconfig_flag ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_FB_mixer_open( &hSpar->hFbMixer, output_Fs, fb_cfg ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -197,48 +186,39 @@ ivas_error ivas_spar_dec_open( *------------------------------------------------------------------------*/ void ivas_spar_dec_close( - SPAR_DEC_HANDLE hSpar, /* i/o: SPAR decoder handle */ - const int32_t output_Fs /* i : output sampling rate */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP - , + SPAR_DEC_HANDLE *hSpar, /* i/o: SPAR decoder handle */ + const int32_t output_Fs, /* i : output sampling rate */ const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ -#endif ) { - if ( hSpar != NULL ) + if ( *hSpar == NULL || hSpar == NULL ) { - /* MD handle */ - ivas_spar_md_dec_close( &hSpar->hMdDec ); + return; + } - /* TD decorrelator handle */ - ivas_td_decorr_dec_close( &hSpar->hTdDecorr ); + /* MD handle */ + ivas_spar_md_dec_close( &( *hSpar )->hMdDec ); - /* FB mixer handle */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP - ivas_FB_mixer_close( &hSpar->hFbMixer, output_Fs, spar_reconfig_flag ); -#else - ivas_FB_mixer_close( &hSpar->hFbMixer, output_Fs ); -#endif + /* TD decorrelator handle */ + ivas_td_decorr_dec_close( &( *hSpar )->hTdDecorr ); - /* AGC */ - ivas_spar_agc_dec_close( &hSpar->hAgcDec ); + /* FB mixer handle */ + ivas_FB_mixer_close( &( *hSpar )->hFbMixer, output_Fs, spar_reconfig_flag ); - /* PCA */ - if ( hSpar->hPCA != NULL ) - { - free( hSpar->hPCA ); - hSpar->hPCA = NULL; - } + /* AGC */ + ivas_spar_agc_dec_close( &( *hSpar )->hAgcDec ); -#ifdef SBA_BR_SWITCHING_CLEAN_UP - if ( !spar_reconfig_flag ) - { -#endif - free( hSpar ); - hSpar = NULL; -#ifdef SBA_BR_SWITCHING_CLEAN_UP - } -#endif + /* PCA */ + if ( ( *hSpar )->hPCA != NULL ) + { + free( ( *hSpar )->hPCA ); + ( *hSpar )->hPCA = NULL; + } + + if ( !spar_reconfig_flag ) + { + free( ( *hSpar ) ); + ( *hSpar ) = NULL; } return; @@ -826,57 +806,38 @@ void ivas_spar_get_parameters( weight = ivas_spar_get_cldfb_slot_gain( hSpar, hDecoderConfig, ts, &ts0, &ts1, &weight_20ms ); -#ifdef COV_SMOOTH_TUNING split_band = SPAR_DIRAC_SPLIT_START_BAND; -#else - split_band = hSpar->hMdDec->spar_md.num_bands; -#endif for ( spar_band = 0; spar_band < num_spar_bands; spar_band++ ) { for ( out_ch = 0; out_ch < num_ch_out; out_ch++ ) { -#ifndef COV_SMOOTH_TUNING - for ( in_ch = 0; in_ch < num_ch_in; in_ch++ ) + if ( split_band < IVAS_MAX_NUM_BANDS + /* 20ms cross-fade for Transport channels in all frequency bands */ + && ( 0 == ivas_is_res_channel( out_ch, hSpar->hMdDec->spar_md_cfg.nchan_transport ) ) /* sub-frame processing for missing channels in all frequency bands*/ + ) { -#endif - if ( split_band < IVAS_MAX_NUM_BANDS - /* 20ms cross-fade for Transport channels in all frequency bands */ - && ( 0 == ivas_is_res_channel( out_ch, hSpar->hMdDec->spar_md_cfg.nchan_transport ) ) /* sub-frame processing for missing channels in all frequency bands*/ - ) + for ( in_ch = 0; in_ch < num_ch_in; in_ch++ ) { -#ifdef COV_SMOOTH_TUNING - for ( in_ch = 0; in_ch < num_ch_in; in_ch++ ) + if ( hSpar->i_subframe > 3 ) { -#endif - if ( hSpar->i_subframe > 3 ) - { - par_mat[out_ch][in_ch][spar_band] = ( 1.0f - weight ) * hSpar->hMdDec->mixer_mat_prev[ts0][out_ch][in_ch][spar_band] + - weight * hSpar->hMdDec->mixer_mat_prev[ts1][out_ch][in_ch][spar_band]; - } - else - { - par_mat[out_ch][in_ch][spar_band] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][spar_band]; - } -#ifdef COV_SMOOTH_TUNING + par_mat[out_ch][in_ch][spar_band] = ( 1.0f - weight ) * hSpar->hMdDec->mixer_mat_prev[ts0][out_ch][in_ch][spar_band] + + weight * hSpar->hMdDec->mixer_mat_prev[ts1][out_ch][in_ch][spar_band]; } -#endif - } - else - { -#ifdef COV_SMOOTH_TUNING - for ( in_ch = 0; in_ch < num_ch_in; in_ch++ ) + else { -#endif - /* 20ms Transport channel reconstruction with matching encoder/decoder processing */ - int16_t prev_idx = SPAR_DIRAC_SPLIT_START_BAND < IVAS_MAX_NUM_BANDS ? 1 : 0; /* if SPAR_DIRAC_SPLIT_START_BAND == IVAS_MAX_NUM_BANDS, then the sub-frame mixer_mat delay line is not active */ - par_mat[out_ch][in_ch][spar_band] = ( 1.0f - weight_20ms ) * hSpar->hMdDec->mixer_mat_prev[prev_idx][out_ch][in_ch][spar_band] + weight_20ms * hSpar->hMdDec->mixer_mat[out_ch][in_ch][spar_band]; -#ifdef COV_SMOOTH_TUNING + par_mat[out_ch][in_ch][spar_band] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][spar_band]; } -#endif } -#ifndef COV_SMOOTH_TUNING } -#endif + else + { + for ( in_ch = 0; in_ch < num_ch_in; in_ch++ ) + { + /* 20ms Transport channel reconstruction with matching encoder/decoder processing */ + int16_t prev_idx = SPAR_DIRAC_SPLIT_START_BAND < IVAS_MAX_NUM_BANDS ? 1 : 0; /* if SPAR_DIRAC_SPLIT_START_BAND == IVAS_MAX_NUM_BANDS, then the sub-frame mixer_mat delay line is not active */ + par_mat[out_ch][in_ch][spar_band] = ( 1.0f - weight_20ms ) * hSpar->hMdDec->mixer_mat_prev[prev_idx][out_ch][in_ch][spar_band] + weight_20ms * hSpar->hMdDec->mixer_mat[out_ch][in_ch][spar_band]; + } + } } } diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index ff6f858d31..3b47d6500e 100644 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -305,6 +305,7 @@ static void ivas_spar_md_dec_matrix_close( free( hMdDecoder->spar_md.band_coeffs ); hMdDecoder->spar_md.band_coeffs = NULL; } + if ( hMdDecoder->mixer_mat != NULL ) { for ( i = 0; i < num_channels; i++ ) @@ -418,11 +419,8 @@ void ivas_spar_md_dec_close( ivas_spar_md_dec_matrix_close( hMdDecoder, num_channels ); - if ( *hMdDec != NULL ) - { - free( *hMdDec ); - *hMdDec = NULL; - } + free( *hMdDec ); + *hMdDec = NULL; return; } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 4157438f80..ab95c31b5e 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -382,7 +382,6 @@ typedef struct stereo_icbwe_dec_data_structure } STEREO_ICBWE_DEC_DATA, *STEREO_ICBWE_DEC_HANDLE; -#ifdef PARAM_ISM_DTX_CNG /*----------------------------------------------------------------------------------* * ISM DTX structure *----------------------------------------------------------------------------------*/ @@ -392,9 +391,12 @@ typedef struct int16_t dtx_flag; int16_t sce_id_dtx; -} ISM_DTX_DATA_DEC; +#ifdef DISCRETE_ISM_DTX_CNG + int16_t ism_dtx_hangover_cnt; /* hangover counter for ISM DTX decoder */ #endif +} ISM_DTX_DATA_DEC; + /*----------------------------------------------------------------------------------* * DirAC decoder structure *----------------------------------------------------------------------------------*/ @@ -807,6 +809,7 @@ typedef struct ivas_spar_md_dec_state_t int16_t table_idx; int16_t dtx_vad; int16_t spar_hoa_md_flag; + } ivas_spar_md_dec_state_t; @@ -1052,7 +1055,7 @@ typedef struct ivas_binaural_rendering_struct /* Convolution module structure */ BINRENDERER_CONV_MODULE_HANDLE hBinRenConvModule; - /* Variables related to reverb module */ + /* Variables related to reverberator module */ float earlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX]; REVERB_STRUCT_HANDLE hReverb; @@ -1145,18 +1148,13 @@ typedef struct decoder_config_structure int16_t Opt_LsCustom; /* indicates whether loudspeaker custom setup is used */ int16_t Opt_HRTF_binary; /* indicates whether HRTF binary file is used */ int16_t Opt_Headrotation; /* indicates whether head-rotation is used */ -#ifdef FIX_351_HRTF_COMMAND - int16_t Opt_RendConfigCustom; /* indicates whether Renderer configuration custom setup is used */ -#endif - int16_t orientation_tracking; /* indicates orientation tracking type */ + int16_t Opt_RendConfigCustom; /* indicates whether Renderer configuration custom setup is used */ + int16_t orientation_tracking; /* indicates orientation tracking type */ float no_diegetic_pan; int16_t Opt_AMR_WB; /* flag indicating AMR-WB IO mode */ /* temp. development parameters */ #ifdef DEBUGGING -#ifndef REMOVE_FORCE_SUBFRAME_BIN - int16_t forceSubframeBinauralization; /* Flag for forcing Parametric binauralizer to subframe mode */ -#endif int16_t force_rend; /* forced TD/CLDFB binaural renderer (for ISM and MC) */ #endif @@ -1206,9 +1204,7 @@ typedef struct Decoder_Struct /* multichannel modules */ ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS]; /* ISM metadata handles (storage for one frame of read ISM metadata) */ -#ifdef PARAM_ISM_DTX_CNG ISM_DTX_DATA_DEC hISMDTX; /* ISM DTX structure */ -#endif ISM_RENDERER_HANDLE hIsmRendererData; /* ISM renderer handle */ DIRAC_DEC_HANDLE hDirAC; /* DirAC handle */ SPAR_DEC_HANDLE hSpar; /* SPAR handle */ @@ -1219,6 +1215,9 @@ typedef struct Decoder_Struct LFE_DEC_HANDLE hLFE; /* LFE handle */ ISM_MODE ism_mode; /* ISM format mode */ +#ifdef NCHAN_ISM_PARAMETER + int16_t nchan_ism; /* number of ISM channels */ +#endif SBA_MODE sba_mode; /* SBA format mode */ MC_MODE mc_mode; /* MC format mode */ int16_t sba_order; /* Ambisonic (SBA) order */ @@ -1238,15 +1237,8 @@ typedef struct Decoder_Struct EFAP_HANDLE hEFAPdata; /* EFAP structure */ VBAP_HANDLE hVBAPdata; /* VBAP structure */ MONO_DOWNMIX_RENDERER_HANDLE hMonoDmxRenderer; /* Mono downmix structure */ -#ifdef FIX_197_CREND_INTERFACE CREND_WRAPPER_HANDLE hCrendWrapper; -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND REVERB_HANDLE hReverb; /* Reverb handle */ -#endif -#else - CREND_HANDLE hCrend; /* Convolution mixer renderer structure */ - HRTFS_HANDLE hHrtf; /* HRTFs handle */ -#endif HRTFS_CREND_HANDLE hSetOfHRTF; /* Set of HRTFs handle (CRend) */ HRTFS_FASTCONV_HANDLE hHrtfFastConv; /* FASTCONV HRTF tables for binaural rendering */ HRTFS_PARAMBIN_HANDLE hHrtfParambin; /* HRTF tables for parametric binauralizer */ diff --git a/lib_dec/ivas_tcx_core_dec.c b/lib_dec/ivas_tcx_core_dec.c index 378ddec9aa..56059bd29d 100644 --- a/lib_dec/ivas_tcx_core_dec.c +++ b/lib_dec/ivas_tcx_core_dec.c @@ -160,11 +160,11 @@ void stereo_tcx_core_dec( const int16_t last_element_mode, /* i : last element mode */ const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ STEREO_CNG_DEC_HANDLE hStereoCng, /* i : Stereo CNG handle */ - const int16_t nchan_out /* i : number of output channels */ -#ifdef PARAM_ISM_DTX_CNG + const int16_t nchan_out, /* i : number of output channels */ + const IVAS_FORMAT ivas_format /* i : IVAS format */ +#ifndef DISCRETE_ISM_DTX_CNG , - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const ISM_MODE ism_mode /* i : ISM mode (only needed if format is ISM) */ + const ISM_MODE ism_mode /* i : ISM mode (only needed if format is ISM)*/ #endif ) { @@ -729,8 +729,11 @@ void stereo_tcx_core_dec( if ( st->element_mode != IVAS_CPE_TD ) { -#ifdef PARAM_ISM_DTX_CNG +#ifndef DISCRETE_ISM_DTX_CNG if ( ivas_format == ISM_FORMAT && ism_mode == ISM_MODE_PARAM ) +#else + if ( ivas_format == ISM_FORMAT ) +#endif { float buffer[L_FRAME16k]; lerp( signal_outFB, buffer, st->L_frame, hTcxDec->L_frameTCX ); @@ -740,9 +743,6 @@ void stereo_tcx_core_dec( { ApplyFdCng( signal_out, NULL, NULL, NULL, st, st->bfi, 0 ); } -#else - ApplyFdCng( signal_out, NULL, NULL, NULL, st, st->bfi, 0 ); -#endif } /* Generate additional comfort noise to mask potential coding artefacts */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 95f7dca8a7..61c9494e30 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -223,14 +223,7 @@ static void init_decoder_config( hDecoderConfig->Opt_LsCustom = 0; hDecoderConfig->Opt_HRTF_binary = 0; hDecoderConfig->Opt_Headrotation = 0; -#ifdef FIX_351_HRTF_COMMAND hDecoderConfig->Opt_RendConfigCustom = 0; -#endif -#ifndef REMOVE_FORCE_SUBFRAME_BIN -#ifdef DEBUGGING - hDecoderConfig->forceSubframeBinauralization = 0; -#endif -#endif hDecoderConfig->orientation_tracking = orientation_tracking; hDecoderConfig->no_diegetic_pan = no_diegetic_pan; @@ -394,17 +387,8 @@ ivas_error IVAS_DEC_Configure( const IVAS_DEC_AUDIO_CONFIG outputFormat, /* i : output format */ const int16_t customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ - const int16_t enableHeadRotation /* i : enable head rotation for binaural output */ -#ifdef FIX_351_HRTF_COMMAND - , - const int16_t renderConfigEnabled /* i : enable Renderer config. file for binaural output */ -#endif -#ifndef REMOVE_FORCE_SUBFRAME_BIN -#ifdef DEBUGGING - , - const int16_t forceSubframeBinauralization /* i : enable subframe binauralization */ -#endif -#endif + const int16_t enableHeadRotation, /* i : enable head rotation for binaural output */ + const int16_t renderConfigEnabled /* i : enable Renderer config. file for binaural output */ ) { Decoder_Struct *st_ivas; @@ -450,17 +434,10 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->nchan_out = audioCfg2channels( hDecoderConfig->output_config ); } -#ifndef REMOVE_FORCE_SUBFRAME_BIN -#ifdef DEBUGGING - hDecoderConfig->forceSubframeBinauralization = forceSubframeBinauralization; -#endif -#endif hDecoderConfig->Opt_LsCustom = customLsOutputEnabled; hDecoderConfig->Opt_Headrotation = enableHeadRotation; hDecoderConfig->Opt_HRTF_binary = hrtfReaderEnabled; -#ifdef FIX_351_HRTF_COMMAND hDecoderConfig->Opt_RendConfigCustom = renderConfigEnabled; -#endif /* Set decoder parameters to initial values */ if ( ( error = ivas_init_decoder_front( st_ivas ) ) != IVAS_ERR_OK ) @@ -856,7 +833,13 @@ ivas_error IVAS_DEC_GetObjectMetadata( { metadata->azimuth = hIsmMeta->azimuth; metadata->elevation = hIsmMeta->elevation; +#ifdef TD5 + metadata->radius = hIsmMeta->radius; + metadata->yaw = hIsmMeta->yaw; + metadata->pitch = hIsmMeta->pitch; +#else metadata->radius = 0.f; +#endif metadata->spread = 0.f; metadata->gainFactor = 1.f; } @@ -906,14 +889,23 @@ ivas_error IVAS_DEC_GetMasaMetadata( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_FeedHeadTrackData( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_QUATERNION *orientation /* i : head-tracking data */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ +#ifdef TD5 + IVAS_QUATERNION *orientation, /* i : head-tracking data, listener orientation */ + IVAS_POSITION *Pos /* i : listener position */ +#else + IVAS_QUATERNION *orientation /* i : head-tracking data, listener orientation */ +#endif ) { HEAD_TRACK_DATA_HANDLE hHeadTrackData; int16_t i; +#ifdef FIX_I109_ORIENTATION_TRACKING + if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || orientation == NULL ) +#else if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) +#endif { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } @@ -928,10 +920,25 @@ ivas_error IVAS_DEC_FeedHeadTrackData( /* Move head-tracking data to the decoder handle */ for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { +#ifdef FIX_I109_ORIENTATION_TRACKING + /* check for Euler angle signaling */ + if ( orientation[i].w == -3.0f ) + { + Euler2Quat( deg2rad( orientation[i].x ), deg2rad( orientation[i].y ), deg2rad( orientation[i].z ), &orientation[i] ); + } + + ivas_orient_trk_Process( hHeadTrackData->OrientationTracker, orientation[i], FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES, &hHeadTrackData->Quaternions[i] ); +#else hHeadTrackData->Quaternions[i].w = orientation[i].w; hHeadTrackData->Quaternions[i].x = orientation[i].x; hHeadTrackData->Quaternions[i].y = orientation[i].y; hHeadTrackData->Quaternions[i].z = orientation[i].z; +#endif +#ifdef TD5 + hHeadTrackData->Pos[i].x = Pos[i].x; + hHeadTrackData->Pos[i].y = Pos[i].y; + hHeadTrackData->Pos[i].z = Pos[i].z; +#endif } hIvasDec->st_ivas->hHeadTrackData->num_quaternions = 0; @@ -939,6 +946,62 @@ ivas_error IVAS_DEC_FeedHeadTrackData( return IVAS_ERR_OK; } +#ifdef FIX_I109_ORIENTATION_TRACKING +/*---------------------------------------------------------------------* + * IVAS_DEC_FeedRefRotData( ) + * + * Feed the decoder with the reference rotation + *---------------------------------------------------------------------*/ + +ivas_error IVAS_DEC_FeedRefRotData( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_QUATERNION rotation /* i : reference rotation data */ +) +{ + ivas_orient_trk_state_t *pOtr; + + if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHeadTrackData == NULL || hIvasDec->st_ivas->hHeadTrackData->OrientationTracker == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + pOtr = hIvasDec->st_ivas->hHeadTrackData->OrientationTracker; + + pOtr->refRot.w = rotation.w; + pOtr->refRot.x = rotation.x; + pOtr->refRot.z = rotation.z; + pOtr->refRot.y = rotation.y; + + return IVAS_ERR_OK; +} + +#ifdef OTR_REFERENCE_VECTOR_TRACKING +/*---------------------------------------------------------------------* + * IVAS_DEC_FeedRefVectorData( ) + * + * Feed the decoder with a reference vector spanning from listenerPos + * to refPos. Only available in OTR_TRACKING_REF_POS and + * OTR_TRACKING_REF_POS_LEV modes. + *---------------------------------------------------------------------*/ + +ivas_error IVAS_DEC_FeedRefVectorData( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const IVAS_VECTOR3 listenerPos, /* i : Listener position */ + const IVAS_VECTOR3 refPos /* i : Reference position */ +) +{ + ivas_orient_trk_state_t *pOtr; + + if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHeadTrackData == NULL || hIvasDec->st_ivas->hHeadTrackData->OrientationTracker == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + pOtr = hIvasDec->st_ivas->hHeadTrackData->OrientationTracker; + return ivas_orient_trk_SetReferenceVector( pOtr, listenerPos, refPos ); +} +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ +#endif /*---------------------------------------------------------------------* * IVAS_DEC_FeedCustomLsData( ) @@ -1122,6 +1185,9 @@ ivas_error IVAS_DEC_GetRenderConfig( mvr2r( hRCin->roomAcoustics.pFc_input, hRCout->room_acoustics.pFc_input, CLDFB_NO_CHANNELS_MAX ); mvr2r( hRCin->roomAcoustics.pAcoustic_rt60, hRCout->room_acoustics.pAcoustic_rt60, CLDFB_NO_CHANNELS_MAX ); mvr2r( hRCin->roomAcoustics.pAcoustic_dsr, hRCout->room_acoustics.pAcoustic_dsr, CLDFB_NO_CHANNELS_MAX ); +#ifdef TD5 + mvr2r( hRCin->directivity, hRCout->directivity, 3 ); +#endif return IVAS_ERR_OK; } @@ -1166,6 +1232,9 @@ ivas_error IVAS_DEC_FeedRenderConfig( mvr2r( renderConfig.room_acoustics.pFc_input, hRenderConfig->roomAcoustics.pFc_input, CLDFB_NO_CHANNELS_MAX ); mvr2r( renderConfig.room_acoustics.pAcoustic_rt60, hRenderConfig->roomAcoustics.pAcoustic_rt60, CLDFB_NO_CHANNELS_MAX ); mvr2r( renderConfig.room_acoustics.pAcoustic_dsr, hRenderConfig->roomAcoustics.pAcoustic_dsr, CLDFB_NO_CHANNELS_MAX ); +#ifdef TD5 + mvr2r( renderConfig.directivity, hRenderConfig->directivity, 3 ); +#endif return IVAS_ERR_OK; } @@ -1940,7 +2009,6 @@ static ivas_error printConfigInfo_dec( get_channel_config( st_ivas->hDecoderConfig->output_config, &config_str[0] ); fprintf( stdout, "Output configuration: %s\n", config_str ); -#ifdef FIX_351_HRTF_COMMAND if ( st_ivas->hDecoderConfig->Opt_HRTF_binary ) { fprintf( stdout, "HRIR/BRIR file: ON\n" ); @@ -1950,7 +2018,6 @@ static ivas_error printConfigInfo_dec( { fprintf( stdout, "Renderer config. file: ON\n" ); } -#endif if ( st_ivas->hDecoderConfig->Opt_Headrotation ) { diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 36dab5c1f9..a717e0002e 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -129,17 +129,8 @@ ivas_error IVAS_DEC_Configure( const IVAS_DEC_AUDIO_CONFIG outputFormat, /* i : output format */ const int16_t customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ - const int16_t enableHeadRotation /* i : enable head rotation for binaural output */ -#ifdef FIX_351_HRTF_COMMAND - ,const int16_t renderConfigEnabled /* i : enable Renderer config. file for binaural output */ -#endif - -#ifndef REMOVE_FORCE_SUBFRAME_BIN -#ifdef DEBUGGING - , - const int16_t forceSubframeBinauralization /* i : enable subframe binauralization */ -#endif -#endif + const int16_t enableHeadRotation, /* i : enable head rotation for binaural output */ + const int16_t renderConfigEnabled /* i : enable Renderer config. file for binaural output */ ); void IVAS_DEC_Close( @@ -185,9 +176,30 @@ ivas_error IVAS_DEC_GetMasaMetadata( /*! r: error code */ ivas_error IVAS_DEC_FeedHeadTrackData( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ +#ifdef TD5 + IVAS_QUATERNION *orientation, /* i : head-tracking data */ + IVAS_POSITION *Pos /* i : listener position */ +#else IVAS_QUATERNION *orientation /* i : head-tracking data */ +#endif ); +#ifdef FIX_I109_ORIENTATION_TRACKING +/*! r: error code */ +ivas_error IVAS_DEC_FeedRefRotData( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_QUATERNION rotation /* i : reference rotation data */ +); +#ifdef OTR_REFERENCE_VECTOR_TRACKING +/*! r: error code */ +ivas_error IVAS_DEC_FeedRefVectorData( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const IVAS_VECTOR3 listenerPos, /* i : Listener position */ + const IVAS_VECTOR3 refPos /* i : Reference position */ +); +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ +#endif + /*! r: error code */ ivas_error IVAS_DEC_VoIP_FeedFrame( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ @@ -202,7 +214,7 @@ ivas_error IVAS_DEC_VoIP_FeedFrame( /*! r: error code */ ivas_error IVAS_DEC_VoIP_GetSamples( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - uint16_t nSamplesPerChannel, /* i : number of samples per channel requested to be written to output buffer */ + uint16_t nSamplesPerChannel, /* i : number of samples per channel requested to be written to output buffer */ int16_t *pcmBuf, /* i/o: buffer for decoded PCM output. The memory must already be allocated and be able to hold the expected number of output samples, based on frame size and number of output channels */ const uint32_t systemTimestamp_ms /* i : current system timestamp */ #ifdef SUPPORT_JBM_TRACEFILE diff --git a/lib_dec/stat_dec.h b/lib_dec/stat_dec.h index 0950b529f6..1a82d45587 100644 --- a/lib_dec/stat_dec.h +++ b/lib_dec/stat_dec.h @@ -1345,9 +1345,10 @@ typedef struct Decoder_State /* MCT Channel mode indication: LFE, ignore channel? */ MCT_CHAN_MODE mct_chan_mode; -#ifdef PARAM_ISM_DTX_CNG - int16_t cng_paramISM_flag; /* CNG in Param-ISM flag */ - int16_t read_sid_info; /* For ParamISM, use the transmitted noise */ + int16_t cng_ism_flag; /* CNG in Param-ISM flag */ + int16_t read_sid_info; /* For ParamISM, use the transmitted noise */ +#ifdef DISCRETE_ISM_DTX_CNG + int16_t is_ism_format; /* Indication whether the codec operates in ISM format */ #endif } Decoder_State, *DEC_CORE_HANDLE; diff --git a/lib_enc/acelp_core_enc.c b/lib_enc/acelp_core_enc.c index 272d36fb9c..48cdb5c536 100644 --- a/lib_enc/acelp_core_enc.c +++ b/lib_enc/acelp_core_enc.c @@ -314,17 +314,13 @@ ivas_error acelp_core_enc( if ( st->core_brate == SID_2k40 ) { -#ifdef PARAM_ISM_DTX_CNG if ( st->hTdCngEnc != NULL ) { -#endif tmpF = cng_energy( st->element_mode, st->bwidth, st->hDtxEnc->CNG_mode, st->hTdCngEnc->CNG_att, exc, st->L_frame ); i = (int16_t) ( ( tmpF + 2.0f ) * STEP_SID ); i = min( max( i, 0 ), 127 ); st->hTdCngEnc->old_enr_index = i; -#ifdef PARAM_ISM_DTX_CNG } -#endif } } diff --git a/lib_enc/acelp_core_switch_enc.c b/lib_enc/acelp_core_switch_enc.c index 1a3488d92d..291c2128a1 100644 --- a/lib_enc/acelp_core_switch_enc.c +++ b/lib_enc/acelp_core_switch_enc.c @@ -73,10 +73,6 @@ void acelp_core_switch_enc( const float *inp; int32_t cbrate; float Aq[2 * ( M + 1 )]; -#ifdef IND_LIST_DYN - uint16_t value; - int16_t nb_bits; -#endif BSTR_ENC_HANDLE hBstr = st->hBstr; /* initializations */ @@ -163,25 +159,12 @@ void acelp_core_switch_enc( * Manipulate ACELP subframe indices (move them to their proper place) *----------------------------------------------------------------*/ -#ifdef IND_LIST_DYN - i = find_indice( hBstr, TAG_ACELP_SUBFR_LOOP_START, &value, &nb_bits ); -#ifdef DEBUGGING - assert( i >= 0 && "Internal error in ACELP core switching - unable to find ACELP subframe indices!" ); -#endif - while ( hBstr->ind_list[i].id == TAG_ACELP_SUBFR_LOOP_START ) - { - push_indice( hBstr, IND_CORE_SWITCHING_CELP_SUBFRAME, hBstr->ind_list[i].value, hBstr->ind_list[i].nb_bits ); - i++; - } - delete_indice( hBstr, TAG_ACELP_SUBFR_LOOP_START ); -#else for ( i = 0; i < 20; i++ ) { hBstr->ind_list[IND_CORE_SWITCHING_CELP_SUBFRAME + i].value = hBstr->ind_list[TAG_ACELP_SUBFR_LOOP_START + i].value; hBstr->ind_list[IND_CORE_SWITCHING_CELP_SUBFRAME + i].nb_bits = hBstr->ind_list[TAG_ACELP_SUBFR_LOOP_START + i].nb_bits; hBstr->ind_list[TAG_ACELP_SUBFR_LOOP_START + i].nb_bits = -1; } -#endif /*----------------------------------------------------------------* * BWE encoding diff --git a/lib_enc/amr_wb_enc.c b/lib_enc/amr_wb_enc.c index 80520d4c38..88b3faa5d6 100644 --- a/lib_enc/amr_wb_enc.c +++ b/lib_enc/amr_wb_enc.c @@ -342,7 +342,12 @@ void amr_wb_enc( * WB, SWB and FB bandwidth detector *----------------------------------------------------------------*/ - bw_detect( st, st->input, NULL, NULL ); + bw_detect( st, st->input, NULL, NULL +#ifdef FIX_MDCT_BASED_BWD + , + 0 +#endif + ); /* in AMR_WB IO, limit the maximum band-width to WB */ if ( st->bwidth > WB ) diff --git a/lib_enc/bw_detect.c b/lib_enc/bw_detect.c index 5f46910c57..8ca63d28f2 100644 --- a/lib_enc/bw_detect.c +++ b/lib_enc/bw_detect.c @@ -57,6 +57,9 @@ #define BWD_COUNT_MAX 100 #define BWD_COUNT_WIDER_BW 10 +#ifdef FIX_MDCT_BASED_BWD +#define BWD_COUNT_WIDER_BW_MDCT 0 +#endif #define CLDFB_ENER_OFFSET 1.6f @@ -71,6 +74,10 @@ void bw_detect( const float signal_in[], /* i : input signal */ float *spectrum, /* i : MDCT spectrum */ const float *enerBuffer /* i : energy buffer */ +#ifdef FIX_MDCT_BASED_BWD + , + const int16_t mct_on /* i : flag MCT mode */ +#endif ) { int16_t i, j, k, bw_max, bin_width, n_bins; @@ -80,6 +87,15 @@ void bw_detect( const float *pt, *pt1; float max_NB, max_WB, max_SWB, max_FB, mean_NB, mean_WB, mean_SWB, mean_FB; int16_t cldfb_bin_width = 4; +#ifdef FIX_MDCT_BASED_BWD + int16_t bwd_count_wider_bw, l_frame; + + bwd_count_wider_bw = BWD_COUNT_WIDER_BW; + if ( st->element_mode == IVAS_CPE_MDCT && ( st->element_brate > IVAS_64k || mct_on ) ) + { + bwd_count_wider_bw = BWD_COUNT_WIDER_BW_MDCT; + } +#endif if ( st->input_Fs > 8000 ) { @@ -173,8 +189,19 @@ void bw_detect( } else { +#ifndef FIX_MDCT_BASED_BWD bin_width *= (int16_t) ( ( st->input_Fs / FRAMES_PER_SEC ) / BWD_TOTAL_WIDTH ); mvr2r( spectrum, spect, (int16_t) ( st->input_Fs / FRAMES_PER_SEC ) ); +#else + l_frame = (int16_t) ( st->input_Fs / FRAMES_PER_SEC ); + if ( st->core == TCX_10_CORE ) + { + l_frame /= 2; + } + + bin_width *= ( l_frame / BWD_TOTAL_WIDTH ); + mvr2r( spectrum, spect, l_frame ); +#endif } /*---------------------------------------------------------------------* * compute energy per spectral bins @@ -392,17 +419,29 @@ void bw_detect( /* switching to a higher BW */ if ( st->last_input_bwidth == NB ) { +#ifdef FIX_MDCT_BASED_BWD + if ( st->count_WB > bwd_count_wider_bw ) +#else if ( st->count_WB > BWD_COUNT_WIDER_BW ) +#endif { st->input_bwidth = WB; st->count_WB = BWD_COUNT_MAX; +#ifdef FIX_MDCT_BASED_BWD + if ( st->count_SWB > bwd_count_wider_bw ) +#else if ( st->count_SWB > BWD_COUNT_WIDER_BW ) +#endif { st->input_bwidth = SWB; st->count_SWB = BWD_COUNT_MAX; +#ifdef FIX_MDCT_BASED_BWD + if ( st->count_FB > bwd_count_wider_bw ) +#else if ( st->count_FB > BWD_COUNT_WIDER_BW ) +#endif { st->input_bwidth = FB; st->count_FB = BWD_COUNT_MAX; @@ -413,12 +452,20 @@ void bw_detect( if ( st->last_input_bwidth == WB && st->input_Fs > 16000 ) { +#ifdef FIX_MDCT_BASED_BWD + if ( st->count_SWB > bwd_count_wider_bw ) +#else if ( st->count_SWB > BWD_COUNT_WIDER_BW ) +#endif { st->input_bwidth = SWB; st->count_SWB = BWD_COUNT_MAX; +#ifdef FIX_MDCT_BASED_BWD + if ( st->count_FB > bwd_count_wider_bw ) +#else if ( st->count_FB > BWD_COUNT_WIDER_BW ) +#endif { st->input_bwidth = FB; st->count_FB = BWD_COUNT_MAX; @@ -428,7 +475,11 @@ void bw_detect( if ( st->last_input_bwidth == SWB && st->input_Fs > 32000 ) { +#ifdef FIX_MDCT_BASED_BWD + if ( st->count_FB > bwd_count_wider_bw ) +#else if ( st->count_FB > BWD_COUNT_WIDER_BW ) +#endif { st->input_bwidth = FB; st->count_FB = BWD_COUNT_MAX; diff --git a/lib_enc/cng_enc.c b/lib_enc/cng_enc.c index 0f17b82923..04d9e41166 100644 --- a/lib_enc/cng_enc.c +++ b/lib_enc/cng_enc.c @@ -885,12 +885,8 @@ void swb_CNG_enc( else if ( st->element_mode == IVAS_CPE_DFT && st->core_brate == SID_2k40 ) { /* LF-boost not used in DFT-stereo, instead the bandwidth is transmitted */ -#ifdef IND_LIST_DYN - delete_indice( st->hBstr, IND_CNG_ENV1 ); -#else st->hBstr->nb_bits_tot = st->hBstr->nb_bits_tot - st->hBstr->ind_list[IND_CNG_ENV1].nb_bits; st->hBstr->ind_list[IND_CNG_ENV1].nb_bits = -1; -#endif push_indice( st->hBstr, IND_BWIDTH, st->bwidth, 2 ); push_indice( st->hBstr, IND_UNUSED, 0, 4 ); push_indice( st->hBstr, IND_SID_BW, 1, 1 ); @@ -966,12 +962,8 @@ static void shb_CNG_encod( push_indice( hBstr, IND_SHB_CNG_GAIN, idx_ener, 4 ); push_indice( hBstr, IND_SID_BW, 1, 1 ); -#ifdef IND_LIST_DYN - delete_indice( hBstr, IND_CNG_ENV1 ); -#else hBstr->nb_bits_tot = hBstr->nb_bits_tot - hBstr->ind_list[IND_CNG_ENV1].nb_bits; hBstr->ind_list[IND_CNG_ENV1].nb_bits = -1; -#endif if ( st->element_mode == IVAS_CPE_DFT ) { push_indice( st->hBstr, IND_BWIDTH, st->bwidth, 2 ); diff --git a/lib_enc/dtx.c b/lib_enc/dtx.c index 652c28f139..c99a8faf28 100644 --- a/lib_enc/dtx.c +++ b/lib_enc/dtx.c @@ -259,13 +259,7 @@ void dtx( /* reset the bitstream (IVAS format signaling was already written) */ if ( st->element_mode != IVAS_CPE_MDCT && st->hBstr != NULL ) { - reset_indices_enc( st->hBstr, -#ifdef IND_LIST_DYN - st->hBstr->max_num_indices -#else - MAX_NUM_INDICES -#endif - ); + reset_indices_enc( st->hBstr, MAX_NUM_INDICES ); } } diff --git a/lib_enc/enc_ppp.c b/lib_enc/enc_ppp.c index a70d37a4dc..823d6cf3cd 100644 --- a/lib_enc/enc_ppp.c +++ b/lib_enc/enc_ppp.c @@ -169,13 +169,7 @@ ivas_error encod_ppp( } /* delete previous indices */ - reset_indices_enc( hBstr, -#ifdef IND_LIST_DYN - hBstr->max_num_indices -#else - MAX_NUM_INDICES -#endif - ); + reset_indices_enc( hBstr, MAX_NUM_INDICES ); /* signaling matrix (writing of signaling bits) */ signaling_enc( st ); diff --git a/lib_enc/eval_pit_contr.c b/lib_enc/eval_pit_contr.c index 76bf54b025..5dd3101772 100644 --- a/lib_enc/eval_pit_contr.c +++ b/lib_enc/eval_pit_contr.c @@ -326,26 +326,18 @@ int16_t Pit_exc_contribution_len( /* pitch contribution useless - delete all previously written indices belonging to pitch contribution */ for ( i = TAG_ACELP_SUBFR_LOOP_START; i < TAG_ACELP_SUBFR_LOOP_END; i++ ) { -#ifdef IND_LIST_DYN - delete_indice( hBstr, i ); -#else if ( hBstr->ind_list[i].nb_bits != -1 ) { hBstr->nb_bits_tot -= hBstr->ind_list[i].nb_bits; hBstr->ind_list[i].nb_bits = -1; } -#endif } -#ifdef IND_LIST_DYN - delete_indice( hBstr, IND_ES_PRED ); -#else if ( hBstr->ind_list[IND_ES_PRED].nb_bits != -1 ) { hBstr->nb_bits_tot -= hBstr->ind_list[IND_ES_PRED].nb_bits; hBstr->ind_list[IND_ES_PRED].nb_bits = -1; } -#endif } if ( st->core_brate < CFREQ_BITRATE ) diff --git a/lib_enc/fd_cng_enc.c b/lib_enc/fd_cng_enc.c index e0341e00c3..e43b65d56a 100644 --- a/lib_enc/fd_cng_enc.c +++ b/lib_enc/fd_cng_enc.c @@ -708,18 +708,14 @@ void generate_comfort_noise_enc( /* Perform STFT synthesis */ SynthesisSTFT( fftBuffer, timeDomainOutput, hFdCngCom->olapBufferSynth, hFdCngCom->olapWinSyn, tcx_transition, hFdCngCom, -1, -1 ); -#ifdef PARAM_ISM_DTX_CNG if ( st->hTdCngEnc != NULL ) { -#endif /* update CNG excitation energy for LP_CNG */ /* calculate the residual signal energy */ enr = cng_energy( st->element_mode, st->bwidth, st->hDtxEnc->CNG_mode, st->hTdCngEnc->CNG_att, hFdCngCom->exc_cng, hFdCngCom->frameSize ); st->hTdCngEnc->lp_ener = (float) ( 0.8f * st->hTdCngEnc->lp_ener + 0.2f * pow( 2.0f, enr ) ); -#ifdef PARAM_ISM_DTX_CNG } -#endif /* Overlap-add when previous frame is active */ if ( st->last_core_brate > SID_2k40 && st->codec_mode == MODE2 ) @@ -899,20 +895,8 @@ void stereoFdCngCoherence( else if ( sts[0]->core_brate <= SID_2k40 && sts[1]->core_brate <= SID_2k40 ) { /* case: no VAD for both channels -> INACTIVE FRAME */ - reset_indices_enc( sts[0]->hBstr, -#ifdef IND_LIST_DYN - sts[0]->hBstr->max_num_indices -#else - MAX_NUM_INDICES -#endif - ); - reset_indices_enc( sts[1]->hBstr, -#ifdef IND_LIST_DYN - sts[1]->hBstr->max_num_indices -#else - MAX_NUM_INDICES -#endif - ); + reset_indices_enc( sts[0]->hBstr, MAX_NUM_INDICES ); + reset_indices_enc( sts[1]->hBstr, MAX_NUM_INDICES ); /* synchronize SID sending for variable SID rate */ if ( sts[0]->core_brate != sts[1]->core_brate ) diff --git a/lib_enc/igf_enc.c b/lib_enc/igf_enc.c index 677bc1639e..9c68e3fcc7 100644 --- a/lib_enc/igf_enc.c +++ b/lib_enc/igf_enc.c @@ -1707,41 +1707,6 @@ void IGFEncSetMode( return; } -#ifdef IND_LIST_DYN - -/*-------------------------------------------------------------------* - * pack_bit() - * - * insert a bit into packed octet - *-------------------------------------------------------------------*/ - -static void pack_bit( - const int16_t bit, /* i : bit to be packed */ - uint8_t **pt, /* i/o: pointer to octet array into which bit will be placed */ - uint8_t *omask /* i/o: output mask to indicate where in the octet the bit is to be written */ -) -{ - if ( *omask == 0x80 ) - { - **pt = 0; - } - - if ( bit != 0 ) - { - **pt = **pt | *omask; - } - - *omask >>= 1; - if ( *omask == 0 ) - { - *omask = 0x80; - ( *pt )++; - } - - return; -} - -#endif /*-------------------------------------------------------------------* * IGFEncConcatenateBitstream() @@ -1757,56 +1722,10 @@ void IGFEncConcatenateBitstream( { int16_t i; IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; -#ifdef IND_LIST_DYN - Indice *ind_list; - uint8_t *pFrame; /* byte array with bit packet and byte aligned coded speech data */ - int16_t *pFrame_size; /* number of bits in the binary encoded access unit [bits] */ - int16_t k, nb_bits_written; - int32_t imask; - uint8_t omask; -#endif hPrivateData = &hIGFEnc->igfData; -#ifndef IND_LIST_DYN hBstr->next_ind -= bsBits; -#endif - -#ifdef IND_LIST_DYN - ind_list = &hBstr->ind_list[hBstr->nb_ind_tot - bsBits]; /* here, we assume that each bit has been written as a single indice */ - pFrame = hPrivateData->igfBitstream; - pFrame_size = &hPrivateData->igfBitstreamBits; - nb_bits_written = 0; - - omask = ( 0x80 >> ( *pFrame_size & 0x7 ) ); - pFrame += *pFrame_size >> 3; - - /* bitstream packing (conversion of individual indices into a serial stream) */ - for ( i = 0; i < bsBits; i++ ) - { - if ( ind_list[i].nb_bits > 0 ) - { - /* mask from MSB to LSB */ - imask = 1 << ( ind_list[i].nb_bits - 1 ); - /* write bit by bit */ - for ( k = 0; k < ind_list[i].nb_bits; k++ ) - { - pack_bit( ind_list[i].value & imask, &pFrame, &omask ); - imask >>= 1; - } - nb_bits_written += ind_list[i].nb_bits; - - /* delete the indice */ - ind_list[i].nb_bits = -1; - } - } - - *pFrame_size += nb_bits_written; - - /* update list of indices */ - hBstr->nb_ind_tot -= bsBits; - hBstr->nb_bits_tot -= nb_bits_written; -#else indices_to_serial_generic( &hBstr->ind_list[hBstr->next_ind], bsBits, hPrivateData->igfBitstream, &hPrivateData->igfBitstreamBits ); /* make sure there are no leftovers from the temporary bitstream writing */ @@ -1816,7 +1735,6 @@ void IGFEncConcatenateBitstream( } hBstr->nb_bits_tot -= hIGFEnc->infoTotalBitsPerFrameWritten; -#endif return; } diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index a2a168262d..16b1cf0c29 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -54,18 +54,12 @@ *-----------------------------------------------------------------------*/ ivas_error init_encoder( - Encoder_State *st, /* i/o: state structure */ -#ifdef IND_LIST_DYN - ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : encoder configuration handle */ -#endif + Encoder_State *st, /* i/o: state structure */ const int16_t idchan, /* i : channel ID */ const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ const int16_t interval_SID, /* i : interval for SID update */ - const int16_t vad_only_flag /* i : flag to indicate front-VAD structure */ -#ifdef PARAM_ISM_DTX_CNG - , - const ISM_MODE ism_mode /* i : ISM mode */ -#endif + const int16_t vad_only_flag, /* i : flag to indicate front-VAD structure */ + const ISM_MODE ism_mode /* i : ISM mode */ ) { int16_t i; @@ -118,19 +112,6 @@ ivas_error init_encoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Bitstream structure\n" ) ); } - -#ifdef IND_LIST_DYN - /* set the maximum allowed number of indices in the list */ - st->hBstr->max_num_indices = get_max_num_indices( hEncoderConfig->ivas_format, st->total_brate ); - - /* allocate buffer of indices */ - if ( ( st->hBstr->ind_list = (INDICE_HANDLE) malloc( st->hBstr->max_num_indices * sizeof( Indice ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); - } - - reset_indices_enc( st->hBstr, st->hBstr->max_num_indices ); -#endif } else { @@ -482,10 +463,10 @@ ivas_error init_encoder( * LP-CNG *-----------------------------------------------------------------*/ -#ifdef PARAM_ISM_DTX_CNG - if ( ( ( idchan == 0 && st->Opt_DTX_ON && st->element_mode != IVAS_CPE_MDCT ) || st->element_mode == EVS_MONO ) && !( ism_mode == ISM_MODE_PARAM ) ) +#ifdef DISCRETE_ISM_DTX_CNG + if ( ( ( idchan == 0 && st->Opt_DTX_ON && st->element_mode != IVAS_CPE_MDCT ) || st->element_mode == EVS_MONO ) && !( ism_mode == ISM_MODE_PARAM || ism_mode == ISM_MODE_DISC ) ) #else - if ( ( ( idchan == 0 && st->Opt_DTX_ON && st->element_mode != IVAS_CPE_MDCT ) || st->element_mode == EVS_MONO ) ) + if ( ( ( idchan == 0 && st->Opt_DTX_ON && st->element_mode != IVAS_CPE_MDCT ) || st->element_mode == EVS_MONO ) && !( ism_mode == ISM_MODE_PARAM ) ) #endif { if ( ( st->hTdCngEnc = (TD_CNG_ENC_HANDLE) malloc( sizeof( TD_CNG_ENC_DATA ) ) ) == NULL ) @@ -885,32 +866,22 @@ void LPDmem_enc_init( return; } + + /*-----------------------------------------------------------------------* - * destroy_encoder() + * destroy_cldfb_encoder() * * Free memory which was allocated in init_encoder() *-----------------------------------------------------------------------*/ -void destroy_encoder( +void destroy_cldfb_encoder( Encoder_State *st /* i/o: Encoder static variables structure */ ) { - if ( st->cldfbSynTd != NULL ) - { - deleteCldfb( &st->cldfbSynTd ); - } - - if ( st->cldfbAnaEnc != NULL ) - { - deleteCldfb( &st->cldfbAnaEnc ); - } - - if ( st->hFdCngEnc != NULL ) - { - deleteFdCngEnc( &st->hFdCngEnc ); - } + deleteCldfb( &st->cldfbSynTd ); + deleteCldfb( &st->cldfbAnaEnc ); - /* Close Core */ + deleteFdCngEnc( &st->hFdCngEnc ); return; } diff --git a/lib_enc/ivas_agc_enc.c b/lib_enc/ivas_agc_enc.c index f98c22b97e..83dbdad1e1 100644 --- a/lib_enc/ivas_agc_enc.c +++ b/lib_enc/ivas_agc_enc.c @@ -195,22 +195,24 @@ void ivas_spar_agc_enc_close( { ivas_agc_enc_state_t *hAgc; + if ( hAgcEnc == NULL || *hAgcEnc == NULL ) + { + return; + } + hAgc = *hAgcEnc; - if ( hAgc != NULL ) - { - free( hAgc->agc_com.winFunc ); - hAgc->agc_com.winFunc = NULL; + free( hAgc->agc_com.winFunc ); + hAgc->agc_com.winFunc = NULL; - free( hAgc->gain_state ); - hAgc->gain_state = NULL; + free( hAgc->gain_state ); + hAgc->gain_state = NULL; - free( hAgc->gain_data ); - hAgc->gain_data = NULL; + free( hAgc->gain_data ); + hAgc->gain_data = NULL; - free( hAgc ); - hAgc = NULL; - } + free( *hAgcEnc ); + *hAgcEnc = NULL; return; } diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index d4e5e6c686..002e499f4b 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -103,9 +103,6 @@ ivas_error ivas_core_enc( int16_t last_element_mode, tdm_Pitch_reuse_flag; int32_t element_brate, last_element_brate, input_Fs; ivas_error error; -#ifdef IND_LIST_DYN - int16_t max_num_indices; -#endif push_wmops( "ivas_core_enc" ); @@ -198,22 +195,6 @@ ivas_error ivas_core_enc( { st = sts[n]; -#ifdef IND_LIST_DYN - /*---------------------------------------------------------------------* - * Re-allocate the list of indices, if needed - *---------------------------------------------------------------------*/ - - /* get the maximum allowed number of indices in the list */ - max_num_indices = get_max_num_indices( ivas_format, st->total_brate ); - - /* check, if the maximum number of allowed indices has changed */ - if ( max_num_indices != st->hBstr->max_num_indices ) - { - /* re-allocate the list of indices */ - ind_list_realloc( st->hBstr, max_num_indices ); - } -#endif - /*---------------------------------------------------------------------* * Write signaling info into the bitstream *---------------------------------------------------------------------*/ @@ -282,11 +263,7 @@ ivas_error ivas_core_enc( } else { - stereo_mdct_core_enc( hCPE, -#ifdef IND_LIST_DYN - ivas_format, -#endif - old_inp_16k, old_wsp, pitch_buf ); + stereo_mdct_core_enc( hCPE, old_inp_16k, old_wsp, pitch_buf ); } } else if ( sts[0]->core_brate == SID_2k40 && sts[1]->core_brate == SID_2k40 ) @@ -471,6 +448,8 @@ ivas_error ivas_core_enc( dbgwrite( &st->sp_aud_decision1, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "sp_aud_decision1", n, id, ENC ) ); dbgwrite( &st->sp_aud_decision2, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "sp_aud_decision2", n, id, ENC ) ); + dbgwrite( &st->lp_noise, sizeof( float ), 1, input_frame, fname( debug_dir, "lp_noise", n, id, ENC ) ); + #if ( defined DEBUG_MODE_ACELP ) || ( defined DEBUG_MODE_TCX ) if ( st->coder_type == INACTIVE || st->coder_type == UNVOICED ) { diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c index 000fbab33e..85eba72f00 100644 --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -107,12 +107,7 @@ ivas_error pre_proc_front_ivas( const int16_t front_vad_flag, /* i : front-VAD flag to overwrite VAD decision */ const int16_t force_front_vad, /* i : flag to force VAD decision */ const int16_t front_vad_dtx_flag, /* i : front-VAD DTX flag to overwrite VAD decision*/ -#ifdef LOW_RATE_TRANS_CORE_CODER - const int32_t ivas_total_brate /* i : IVAS total bitrate - for setting the DTX */ -#else - const int32_t ivas_total_brate, /* i : IVAS total bitrate - for setting the DTX */ - const int16_t ivas_format /* i : IVAS format */ -#endif + const int32_t ivas_total_brate /* i : IVAS total bitrate - for setting the DTX */ ) { @@ -491,7 +486,12 @@ ivas_error pre_proc_front_ivas( if ( st->idchan == 0 && element_mode != IVAS_CPE_MDCT ) { - bw_detect( st, st->input, NULL, enerBuffer ); + bw_detect( st, st->input, NULL, enerBuffer +#ifdef FIX_MDCT_BASED_BWD + , + 0 +#endif + ); } if ( element_mode != IVAS_CPE_MDCT ) /* in MDCT stereo, set_bw_stereo() is used instead */ @@ -811,11 +811,7 @@ ivas_error pre_proc_front_ivas( } } /* Switch to ACELP for non-harmonic transient signals */ -#ifdef LOW_RATE_TRANS_CORE_CODER else if ( ( ( element_mode >= IVAS_CPE_DFT && element_brate <= IVAS_16k4 ) || ( element_mode == IVAS_SCE && element_brate < SCE_SMC_THR ) ) && ( loc_harm[0] != 1 ) && smc_dec == MUSIC ) -#else - else if ( ( ( ivas_format == STEREO_FORMAT && element_brate <= IVAS_16k4 ) || ( ivas_format == ISM_FORMAT && element_brate < SCE_SMC_THR ) ) && ( loc_harm[0] != 1 ) && smc_dec == MUSIC ) -#endif { if ( element_mode == IVAS_SCE ) { diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index 18d7f06e0e..e9d6968f1b 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -41,6 +41,7 @@ #endif #include "wmc_auto.h" + /*-------------------------------------------------------------------* * ivas_corecoder_enc_reconfig() * @@ -60,23 +61,9 @@ ivas_error ivas_corecoder_enc_reconfig( int16_t n, sce_id, cpe_id; int16_t len_inp_memory, n_CoreCoder_existing, nSCE_existing, nCPE_existing; float input_buff[MCT_MAX_BLOCKS][L_FRAME48k + NS2SA( 48000, IVAS_FB_ENC_DELAY_NS )]; - BSTR_ENC_HANDLE hBstr; -#ifndef IND_LIST_DYN - Indice *ind_list; -#endif -#ifndef IND_LIST_DYN - Indice *ind_list_metadata; - BSTR_ENC_HANDLE hMetaData; -#endif -#ifdef IND_LIST_DYN - int16_t i, nb_bits, max_num_indices_metadata; - Indice temp_ind_list[MAX_NUM_IND_TEMP_LIST]; -#endif - int16_t nb_bits_tot; -#ifndef IND_LIST_DYN - int16_t last_ind; - int16_t next_ind; -#endif + BSTR_ENC_HANDLE hBstr, hMetaData; + Indice *ind_list, *ind_list_metadata; + int16_t nb_bits_tot, next_ind, last_ind; ENCODER_CONFIG_HANDLE hEncoderConfig; ivas_error error; @@ -104,20 +91,6 @@ ivas_error ivas_corecoder_enc_reconfig( copy_encoder_config( st_ivas, st_ivas->hSCE[sce_id]->hCoreCoder[0], 0 ); st_ivas->hSCE[sce_id]->element_brate = brate_SCE; st_ivas->hSCE[sce_id]->hCoreCoder[0]->total_brate = st_ivas->hSCE[sce_id]->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ -#ifdef IND_LIST_DYN - if ( st_ivas->hSCE[sce_id]->hMetaData != NULL ) - { - /* get the maximum allowed number of indices in the list */ - max_num_indices_metadata = get_max_num_indices_metadata( hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); - - /* check, if the maximum number of allowed indices has changed */ - if ( max_num_indices_metadata != st_ivas->hSCE[sce_id]->hMetaData->max_num_indices ) - { - /* re-allocate the list of metadata indices */ - ind_list_realloc( st_ivas->hSCE[sce_id]->hMetaData, max_num_indices_metadata ); - } - } -#endif } for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) @@ -131,20 +104,6 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ } -#ifdef IND_LIST_DYN - if ( st_ivas->hCPE[cpe_id]->hMetaData != NULL ) - { - /* get the maximum allowed number of indices in the list */ - max_num_indices_metadata = get_max_num_indices_metadata( hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); - - /* check, if the maximum number of allowed indices has changed */ - if ( max_num_indices_metadata != st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices ) - { - /* re-allocate the list of metadata indices */ - ind_list_realloc( st_ivas->hCPE[cpe_id]->hMetaData, max_num_indices_metadata ); - } - } -#endif } if ( st_ivas->nCPE > 1 ) @@ -174,29 +133,21 @@ ivas_error ivas_corecoder_enc_reconfig( } /* something in transport changes */ -#ifndef IND_LIST_DYN ind_list = NULL; ind_list_metadata = NULL; -#endif hBstr = NULL; -#ifndef IND_LIST_DYN hMetaData = NULL; -#endif /* get the index list pointers */ if ( nSCE_old ) { hBstr = st_ivas->hSCE[0]->hCoreCoder[0]->hBstr; -#ifndef IND_LIST_DYN hMetaData = st_ivas->hSCE[0]->hMetaData; -#endif } else if ( nCPE_old ) { hBstr = st_ivas->hCPE[0]->hCoreCoder[0]->hBstr; -#ifndef IND_LIST_DYN hMetaData = st_ivas->hCPE[nCPE_old - 1]->hMetaData; -#endif } #ifdef DEBUGGING else @@ -206,41 +157,11 @@ ivas_error ivas_corecoder_enc_reconfig( #endif /* save bitstream information */ - nb_bits_tot = hBstr->nb_bits_tot; -#ifndef IND_LIST_DYN ind_list = hBstr->ind_list; /* pointer to the beginning of the global list */ + nb_bits_tot = hBstr->nb_bits_tot; next_ind = hBstr->next_ind; last_ind = hBstr->last_ind; -#endif -#ifdef IND_LIST_DYN - i = 0; - nb_bits = 0; - while ( nb_bits < nb_bits_tot && i < MAX_NUM_IND_TEMP_LIST ) - { - if ( hBstr->ind_list[i].nb_bits > 0 ) - { - temp_ind_list[i].id = hBstr->ind_list[i].id; - temp_ind_list[i].value = hBstr->ind_list[i].value; - temp_ind_list[i].nb_bits = hBstr->ind_list[i].nb_bits; - } - - nb_bits += temp_ind_list[i].nb_bits; - i++; - } - - for ( ; i < MAX_NUM_IND_TEMP_LIST; i++ ) - { - /* reset nb_bits of all other indices to -1 */ - temp_ind_list[i].nb_bits = -1; - } - -#ifdef DEBUGGING - assert( ( nb_bits == nb_bits_tot ) && "Error saving bitstream information during core-coder reconfiguration!\n" ); -#endif -#endif -#ifndef IND_LIST_DYN ind_list_metadata = hMetaData->ind_list; /* pointer to the beginning of the global list */ -#endif if ( hEncoderConfig->ivas_format == MC_FORMAT && last_mc_mode == MC_MODE_MCMASA && st_ivas->mc_mode == MC_MODE_MCMASA ) { @@ -300,8 +221,7 @@ ivas_error ivas_corecoder_enc_reconfig( if ( st_ivas->nCPE <= 1 && st_ivas->hMCT != NULL ) { - ivas_mct_enc_close( st_ivas->hMCT ); - st_ivas->hMCT = NULL; + ivas_mct_enc_close( &( st_ivas->hMCT ) ); } /* special case, if we have MCT now and had a single CPE before, remove the MDCT Stereo handles */ @@ -336,56 +256,23 @@ ivas_error ivas_corecoder_enc_reconfig( mvr2r( input_buff[sce_id], st_ivas->hSCE[sce_id]->hCoreCoder[0]->input_buff, len_inp_memory ); } -#ifndef IND_LIST_DYN - /* allocate buffer of indices */ + /* prepare bitstream buffers */ st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list + sce_id * MAX_NUM_INDICES; -#endif /* only reset indices if it is not the first index list, this already contains the IVAS format bits */ if ( sce_id > 0 ) { - reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, -#ifdef IND_LIST_DYN - st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->max_num_indices -#else - MAX_NUM_INDICES -#endif - ); + reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); } else { - st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->nb_bits_tot = nb_bits_tot; -#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->last_ind = last_ind; + st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->nb_bits_tot = nb_bits_tot; st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->next_ind = next_ind; -#endif -#ifdef IND_LIST_DYN - /* re-fill the buffer of indices with already written indices */ - i = 0; - nb_bits = 0; - while ( nb_bits < nb_bits_tot && i < MAX_NUM_IND_TEMP_LIST ) - { - if ( temp_ind_list[i].nb_bits > 0 ) - { - st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].id = temp_ind_list[i].id; - st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].value = temp_ind_list[i].value; - st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; - } - - nb_bits += temp_ind_list[i].nb_bits; - i++; - } - st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->nb_ind_tot = i; -#ifdef DEBUGGING - assert( ( nb_bits == nb_bits_tot ) && "Error restoring bitstream information during core-coder reconfiguration!\n" ); -#endif -#endif } -#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata + sce_id * MAX_BITS_METADATA; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); -#endif } } @@ -397,52 +284,22 @@ ivas_error ivas_corecoder_enc_reconfig( { st_ivas->hCPE[cpe_id]->element_brate = brate_CPE; - /* allocate buffer of indices */ + /* prepare bitstream buffers */ for ( n = 0; n < CPE_CHANNELS; n++ ) { copy_encoder_config( st_ivas, st_ivas->hCPE[cpe_id]->hCoreCoder[n], 0 ); st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ -#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list + ( cpe_id * CPE_CHANNELS + n + st_ivas->nSCE ) * MAX_NUM_INDICES; -#endif if ( cpe_id * CPE_CHANNELS + n > 0 || ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->nSCE > 0 ) ) { - reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, -#ifdef IND_LIST_DYN - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->max_num_indices -#else - MAX_NUM_INDICES -#endif - ); + reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); } else { - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_bits_tot = nb_bits_tot; -#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->last_ind = last_ind; + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_bits_tot = nb_bits_tot; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->next_ind = next_ind; -#endif -#ifdef IND_LIST_DYN - i = 0; - nb_bits = 0; - while ( nb_bits < nb_bits_tot && i < MAX_NUM_IND_TEMP_LIST ) - { - if ( temp_ind_list[i].nb_bits > 0 ) - { - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].id = temp_ind_list[i].id; - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].value = temp_ind_list[i].value; - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; - } - - nb_bits += temp_ind_list[i].nb_bits; - i++; - } - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_ind_tot = i; -#ifdef DEBUGGING - assert( ( nb_bits == nb_bits_tot ) && "Error restoring bitstream information during core-coder reconfiguration!\n" ); -#endif -#endif } } } @@ -468,49 +325,19 @@ ivas_error ivas_corecoder_enc_reconfig( } } + /* prepare bitstream buffers */ for ( n = 0; n < CPE_CHANNELS; n++ ) { -#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list + ( cpe_id * CPE_CHANNELS + n + st_ivas->nSCE ) * MAX_NUM_INDICES; -#endif - /* only reset indices if it is not the first index list, this already contains the IVAS format bits */ if ( cpe_id * CPE_CHANNELS + n > 0 || ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->nSCE > 0 ) ) { - reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, -#ifdef IND_LIST_DYN - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->max_num_indices -#else - MAX_NUM_INDICES -#endif - ); + reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); } else { - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_bits_tot = nb_bits_tot; -#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->last_ind = last_ind; + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_bits_tot = nb_bits_tot; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->next_ind = next_ind; -#endif -#ifdef IND_LIST_DYN - i = 0; - nb_bits = 0; - while ( nb_bits < nb_bits_tot && i < MAX_NUM_IND_TEMP_LIST ) - { - if ( temp_ind_list[i].nb_bits > 0 ) - { - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].id = temp_ind_list[i].id; - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].value = temp_ind_list[i].value; - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; - } - - nb_bits += temp_ind_list[i].nb_bits; - i++; - } - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_ind_tot = i; -#ifdef DEBUGGING - assert( ( nb_bits == nb_bits_tot ) && "Error restoring bitstream information during core-coder reconfiguration!\n" ); -#endif -#endif } if ( hEncoderConfig->Opt_DTX_ON ) @@ -545,6 +372,7 @@ ivas_error ivas_corecoder_enc_reconfig( for ( n = 0; n < CPE_CHANNELS; n++ ) { st_ivas->hCPE[0]->hCoreCoder[n]->total_brate = st_ivas->hCPE[0]->element_brate; + st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal = (int16_t) ( st_ivas->hCPE[0]->element_brate / FRAMES_PER_SEC ); st_ivas->hCPE[0]->hCoreCoder[n]->igf = getIgfPresent( st_ivas->hCPE[0]->hCoreCoder[n]->element_mode, st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal * FRAMES_PER_SEC, @@ -576,7 +404,7 @@ ivas_error ivas_corecoder_enc_reconfig( } } - /* alllocate buffer for metadata indices */ + /* metadata handling for CPEs */ if ( st_ivas->nCPE > 0 ) { if ( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData == NULL ) @@ -585,36 +413,15 @@ ivas_error ivas_corecoder_enc_reconfig( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MetaData structure\n" ) ); } - -#ifdef IND_LIST_DYN - /* set the maximum allowed number of metadata indices in the list */ - st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->max_num_indices = get_max_num_indices_metadata( hEncoderConfig->ivas_total_brate, hEncoderConfig->ivas_format ); - - /* allocate buffer of metadata indices */ - if ( ( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ind_list = (INDICE_HANDLE) malloc( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->max_num_indices * sizeof( Indice ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); - } -#endif } -#ifdef IND_LIST_DYN - reset_indices_enc( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData, st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->max_num_indices ); -#else st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ind_list = ind_list_metadata + st_ivas->nSCE * MAX_NUM_INDICES; reset_indices_enc( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData, MAX_BITS_METADATA ); -#endif for ( cpe_id = 0; cpe_id < st_ivas->nCPE - 1; cpe_id++ ) { if ( st_ivas->hCPE[cpe_id]->hMetaData != NULL ) { -#ifdef IND_LIST_DYN - if ( st_ivas->hCPE[cpe_id]->hMetaData->ind_list != NULL ) - { - free( st_ivas->hCPE[cpe_id]->hMetaData->ind_list ); - } -#endif free( st_ivas->hCPE[cpe_id]->hMetaData ); st_ivas->hCPE[cpe_id]->hMetaData = NULL; } @@ -633,6 +440,7 @@ ivas_error ivas_corecoder_enc_reconfig( for ( n = 0; n < CPE_CHANNELS; n++ ) { st_ivas->hCPE[0]->hCoreCoder[n]->total_brate = st_ivas->hCPE[0]->element_brate; + st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal = (int16_t) ( st_ivas->hCPE[0]->element_brate / FRAMES_PER_SEC ); st_ivas->hCPE[0]->hCoreCoder[n]->igf = getIgfPresent( st_ivas->hCPE[0]->hCoreCoder[n]->element_mode, st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal * FRAMES_PER_SEC, diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 054804372b..f9b787ac56 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -429,19 +429,11 @@ ivas_error ivas_cpe_enc( for ( n = 0; n < n_CoreChannels; n++ ) { -#ifdef LOW_RATE_TRANS_CORE_CODER error = pre_proc_front_ivas( NULL, hCPE, hCPE->element_brate, nb_bits_metadata, input_frame, n, old_inp_12k8[n], old_inp_16k[n], &ener[n], &relE[n], A[n], Aw[n], epsP[n], lsp_new[n], lsp_mid[n], &vad_hover_flag[n], &attack_flag[n], realBuffer[n], imagBuffer[n], old_wsp[n], pitch_fr[n], voicing_fr[n], &loc_harm[n], &cor_map_sum[n], &vad_flag_dtx[n], enerBuffer[n], fft_buff[n], A[0], lsp_new[0], currFlatness[n], tdm_ratio_idx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, band_energies_LR, 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0, ivas_total_brate ); -#else - error = pre_proc_front_ivas( NULL, hCPE, hCPE->element_brate, nb_bits_metadata, input_frame, n, old_inp_12k8[n], old_inp_16k[n], - &ener[n], &relE[n], A[n], Aw[n], epsP[n], lsp_new[n], lsp_mid[n], - &vad_hover_flag[n], &attack_flag[n], realBuffer[n], imagBuffer[n], old_wsp[n], pitch_fr[n], voicing_fr[n], &loc_harm[n], &cor_map_sum[n], &vad_flag_dtx[n], enerBuffer[n], - fft_buff[n], A[0], lsp_new[0], currFlatness[n], tdm_ratio_idx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, band_energies_LR, 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0, - ivas_total_brate, st_ivas->hEncoderConfig->ivas_format ); -#endif if ( error != IVAS_ERR_OK ) { return error; @@ -819,19 +811,6 @@ ivas_error create_cpe_enc( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MetaData structure\n" ) ); } - -#ifdef IND_LIST_DYN - /* set the maximum allowed number of indices in the list */ - hCPE->hMetaData->max_num_indices = get_max_num_indices_metadata( hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); - - /* allocate buffer of metadata indices */ - if ( ( hCPE->hMetaData->ind_list = (INDICE_HANDLE) malloc( hCPE->hMetaData->max_num_indices * sizeof( Indice ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); - } - - reset_indices_enc( hCPE->hMetaData, hCPE->hMetaData->max_num_indices ); -#endif } /*-----------------------------------------------------------------* @@ -853,19 +832,7 @@ ivas_error create_cpe_enc( st->mct_chan_mode = MCT_CHAN_MODE_LFE; } -#ifdef PARAM_ISM_DTX_CNG - if ( ( error = init_encoder( st, -#ifdef IND_LIST_DYN - hEncoderConfig, -#endif - n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) -#else - if ( ( error = init_encoder( st, -#ifdef IND_LIST_DYN - hEncoderConfig, -#endif - n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0 ) ) != IVAS_ERR_OK ) -#endif + if ( ( error = init_encoder( st, n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) { return error; } @@ -1037,12 +1004,6 @@ void destroy_cpe_enc( if ( hCPE->hMetaData != NULL ) { -#ifdef IND_LIST_DYN - if ( hCPE->hMetaData->ind_list != NULL ) - { - free( hCPE->hMetaData->ind_list ); - } -#endif free( hCPE->hMetaData ); hCPE->hMetaData = NULL; } diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index 7b4685251f..b894932958 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -114,7 +114,7 @@ void ivas_decision_matrix_enc( if ( st->element_mode == IVAS_SCE && st->low_rate_mode ) { - /* ISm low-rate mode */ + /* ISM low-rate mode */ st->core = ACELP_CORE; st->coder_type = INACTIVE; } @@ -391,7 +391,7 @@ void ivas_signaling_enc( } else if ( st->element_mode == IVAS_SCE && st->low_rate_mode ) { - /* ISm Low-rate mode -> do nothing -> always WB, ACELP core, IC coder_type */ + /* ISM Low-rate mode -> do nothing -> always WB, ACELP core, IC coder_type */ } else if ( ( st->element_mode == IVAS_CPE_MDCT && st->idchan == 1 ) || st->core_brate <= SID_2k40 ) { diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index a143ff37d2..43bc94fb04 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -104,11 +104,7 @@ ivas_error ivas_dirac_enc_open( return error; } /* Allocate and initialize FB mixer handle */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), input_Fs, fb_cfg, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -249,23 +245,27 @@ ivas_error ivas_dirac_enc_reconfigure( /*------------------------------------------------------------------------- * ivas_dirac_enc_close() * - * Close DirAC + * Close DirAC encoder handle *------------------------------------------------------------------------*/ void ivas_dirac_enc_close( - DIRAC_ENC_HANDLE hDirAC, /* i/o: encoder DirAC handle */ - const int32_t input_Fs /* i : input sampling rate */ + DIRAC_ENC_HANDLE *hDirAC_out, /* i/o: encoder DirAC handle */ + const int32_t input_Fs /* i : input sampling rate */ ) { int16_t i, j; + DIRAC_ENC_HANDLE hDirAC; + + if ( hDirAC_out == NULL || *hDirAC_out == NULL ) + { + return; + } + + hDirAC = *hDirAC_out; if ( hDirAC->hFbMixer != NULL ) { -#ifdef SBA_BR_SWITCHING_CLEAN_UP ivas_FB_mixer_close( &hDirAC->hFbMixer, input_Fs, 0 ); -#else - ivas_FB_mixer_close( &hDirAC->hFbMixer, input_Fs ); -#endif } for ( i = 0; i < DIRAC_MAX_ANA_CHANS; i++ ) @@ -311,7 +311,8 @@ void ivas_dirac_enc_close( hDirAC->hConfig = NULL; } - free( hDirAC ); + free( *hDirAC_out ); + *hDirAC_out = NULL; return; } diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 0500a8e775..1e4ba82207 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -132,14 +132,11 @@ ivas_error ivas_enc( /* bypass EVS coding in float precision, emulating EVS encoder/decoder delay */ for ( i = 0; i < n; i++ ) { -#ifdef SBA_HPF_TUNING_ENC if ( ( ivas_format == SBA_FORMAT ) && ( st_ivas->sba_mode == SBA_MODE_SPAR ) ) { hp20( data_f[HOA_keep_ind[i]], input_frame, st_ivas->mem_hp20_in[i], input_Fs ); } - else -#endif - if ( !( ivas_format == MC_FORMAT && i == LFE_CHANNEL ) ) /*TODO: is the HPF needed for LFE channel? */ + else if ( !( ivas_format == MC_FORMAT && i == LFE_CHANNEL ) ) /*TODO: is the HPF needed for LFE channel? */ { hp20( data_f[i], input_frame, st_ivas->mem_hp20_in[i], input_Fs ); } diff --git a/lib_enc/ivas_enc_cov_handler.c b/lib_enc/ivas_enc_cov_handler.c index b70c05e962..e117cfc5a5 100644 --- a/lib_enc/ivas_enc_cov_handler.c +++ b/lib_enc/ivas_enc_cov_handler.c @@ -117,17 +117,19 @@ void ivas_spar_covar_enc_close( { ivas_enc_cov_handler_state_t *hCovState; + if ( hCovEnc == NULL || *hCovEnc == NULL ) + { + return; + } + hCovState = *hCovEnc; - if ( hCovState != NULL ) - { - ivas_spar_covar_smooth_enc_close( &hCovState->pCov_state, nchan_inp ); + ivas_spar_covar_smooth_enc_close( &hCovState->pCov_state, nchan_inp ); - ivas_spar_covar_smooth_enc_close( &hCovState->pCov_dtx_state, nchan_inp ); + ivas_spar_covar_smooth_enc_close( &hCovState->pCov_dtx_state, nchan_inp ); - free( hCovState ); - hCovState = NULL; - } + free( *hCovEnc ); + *hCovEnc = NULL; return; } @@ -150,12 +152,7 @@ void ivas_enc_cov_handler_process( const int16_t end_band, const int16_t num_ch, const int16_t dtx_vad, -#ifdef SMOOTH_WITH_TRANS_DET - const int16_t transient_det[2] -#else - const int16_t transient_det -#endif -) + const int16_t transient_det[2] ) { int16_t i, j; int16_t dtx_cov_flag; @@ -218,11 +215,7 @@ void ivas_enc_cov_handler_process( } else { -#ifdef SMOOTH_WITH_TRANS_DET if ( ( transient_det[0] == 0 ) && ( transient_det[1] == 0 ) ) -#else - if ( transient_det == 0 ) -#endif { ivas_cov_smooth_process( hCovEnc->pCov_dtx_state, cov_dtx_real, pFb, start_band, end_band, num_ch, transient_det ); hCovEnc->prior_dtx_present = 1; diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 9af3c7e8a8..dfaa321605 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -184,11 +184,7 @@ int16_t getNumChanAnalysis( n = st_ivas->nSCE + CPE_CHANNELS * st_ivas->nCPE; if ( st_ivas->hEncoderConfig->ivas_format == SBA_FORMAT ) { -#ifdef SBA_HPF_TUNING_ENC n = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order ); -#else - n = DIRAC_MAX_ANA_CHANS; -#endif } else if ( st_ivas->hEncoderConfig->ivas_format == MC_FORMAT && ( st_ivas->mc_mode == MC_MODE_PARAMMC || st_ivas->mc_mode == MC_MODE_MCMASA ) ) { @@ -270,16 +266,14 @@ void ivas_initialize_handles_enc( st_ivas->mem_hp20_in = NULL; - /* ISm metadata handles */ + /* ISM metadata handles */ for ( i = 0; i < MAX_NUM_OBJECTS; i++ ) { st_ivas->hIsmMetaData[i] = NULL; } -#ifdef PARAM_ISM_DTX_CNG /* ISM DTX handle */ st_ivas->hISMDTX = NULL; -#endif /* Q Metadata handle */ st_ivas->hQMetaData = NULL; @@ -319,15 +313,9 @@ void ivas_initialize_handles_enc( *-------------------------------------------------------------------*/ ivas_error ivas_init_encoder( - Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ -#ifndef IND_LIST_DYN - , - Indice ind_list[][MAX_NUM_INDICES] /* o : bitstream indices */ -#endif -#ifndef IND_LIST_DYN - , + Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ + Indice ind_list[][MAX_NUM_INDICES], /* o : bitstream indices */ Indice ind_list_metadata[][MAX_BITS_METADATA] /* o : bitstream indices metadata */ -#endif ) { int16_t i, n; @@ -373,10 +361,9 @@ ivas_error ivas_init_encoder( return error; } -#ifndef IND_LIST_DYN + /* prepare bitstream buffers */ st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); -#endif /* prepare stereo downmix for EVS */ if ( hEncoderConfig->stereo_dmx_evs == 1 ) @@ -399,20 +386,16 @@ ivas_error ivas_init_encoder( return error; } -#ifndef IND_LIST_DYN - /* allocate buffer of indices */ + /* prepare bitstream buffers */ for ( n = 0; n < CPE_CHANNELS; n++ ) { st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); } -#endif -#ifndef IND_LIST_DYN /* MetaData for DFT stereo */ st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[0]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); -#endif } else if ( ivas_format == ISM_FORMAT ) { @@ -432,16 +415,12 @@ ivas_error ivas_init_encoder( return error; } - /* MetaData for ISMs */ -#ifndef IND_LIST_DYN + /* prepare bitstream buffers */ st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); -#endif -#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); -#endif } if ( st_ivas->ism_mode == ISM_MODE_PARAM ) @@ -452,15 +431,17 @@ ivas_error ivas_init_encoder( } } -#ifdef PARAM_ISM_DTX_CNG +#ifdef DISCRETE_ISM_DTX_CNG + if ( st_ivas->hEncoderConfig->Opt_DTX_ON ) +#else if ( st_ivas->hEncoderConfig->Opt_DTX_ON && st_ivas->ism_mode == ISM_MODE_PARAM ) +#endif { if ( ( error = ivas_ism_dtx_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } } -#endif } else if ( ivas_format == SBA_FORMAT || ivas_format == MASA_FORMAT ) { @@ -477,11 +458,7 @@ ivas_error ivas_init_encoder( if ( st_ivas->sba_mode == SBA_MODE_SPAR ) { -#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_spar_enc_open( st_ivas, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_spar_enc_open( st_ivas ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -508,16 +485,12 @@ ivas_error ivas_init_encoder( return error; } - /* MetaData for SBA */ -#ifndef IND_LIST_DYN + /* prepare bitstream buffers */ st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); -#endif -#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); -#endif if ( st_ivas->sba_mode == SBA_MODE_SPAR && st_ivas->hEncoderConfig->Opt_DTX_ON ) { @@ -532,12 +505,11 @@ ivas_error ivas_init_encoder( return error; } + /* prepare bitstream buffers */ for ( n = 0; n < CPE_CHANNELS; n++ ) { -#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); -#endif if ( hEncoderConfig->Opt_DTX_ON ) { @@ -545,14 +517,12 @@ ivas_error ivas_init_encoder( } } -#ifndef IND_LIST_DYN /* Metadata only initialized for the last CPE index */ if ( cpe_id == st_ivas->nCPE - 1 ) { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); } -#endif } if ( st_ivas->nCPE > 1 ) @@ -581,8 +551,6 @@ ivas_error ivas_init_encoder( return error; } -#ifndef IND_LIST_DYN - /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { /* we need the correct bitstream also for the LFE channel since it might become a proper coded channel when @@ -590,16 +558,13 @@ ivas_error ivas_init_encoder( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); } -#endif -#ifndef IND_LIST_DYN /* Metadata only initialized for the last CPE index*/ if ( cpe_id == st_ivas->nCPE - 1 ) { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); } -#endif } if ( ( error = create_mct_enc( st_ivas ) ) != IVAS_ERR_OK ) @@ -628,23 +593,19 @@ ivas_error ivas_init_encoder( return error; } -#ifndef IND_LIST_DYN - /* allocate buffer of indices */ + /* prepare bitstream buffers */ for ( n = 0; n < CPE_CHANNELS; n++ ) { st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); } -#endif -#ifndef IND_LIST_DYN /* Metadata only initialized for the last CPE index*/ if ( cpe_id == st_ivas->nCPE - 1 ) { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); } -#endif } if ( st_ivas->nCPE > 1 ) @@ -685,15 +646,12 @@ ivas_error ivas_init_encoder( return error; } -#ifndef IND_LIST_DYN - /* allocate buffer of indices */ + /* prepare bitstream buffers */ st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); -#endif -#ifndef IND_LIST_DYN + st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); -#endif } for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) @@ -705,23 +663,19 @@ ivas_error ivas_init_encoder( return error; } -#ifndef IND_LIST_DYN - /* allocate buffer of indices */ + /* prepare bitstream buffers */ for ( n = 0; n < CPE_CHANNELS; n++ ) { st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n + st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); } -#endif -#ifndef IND_LIST_DYN /* Metadata only initialized for the last CPE index*/ if ( cpe_id == st_ivas->nCPE - 1 ) { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); } -#endif } } } @@ -775,7 +729,7 @@ void destroy_core_enc( ENC_CORE_HANDLE hCoreCoder /* i/o: core encoder structure */ ) { - destroy_encoder( hCoreCoder ); + destroy_cldfb_encoder( hCoreCoder ); if ( hCoreCoder->hSignalBuf != NULL ) { @@ -785,14 +739,6 @@ void destroy_core_enc( if ( hCoreCoder->hBstr != NULL ) { -#ifdef IND_LIST_DYN - /* deallocate buffer of indices */ - if ( hCoreCoder->hBstr->ind_list != NULL ) - { - free( hCoreCoder->hBstr->ind_list ); - } -#endif - free( hCoreCoder->hBstr ); hCoreCoder->hBstr = NULL; } @@ -974,97 +920,52 @@ void ivas_destroy_enc( } /* ISM metadata handles */ - for ( n = 0; n < MAX_NUM_OBJECTS; n++ ) - { - if ( st_ivas->hIsmMetaData[n] != NULL ) - { - free( st_ivas->hIsmMetaData[n] ); - st_ivas->hIsmMetaData[n] = NULL; - } - } + ivas_ism_metadata_close( st_ivas->hIsmMetaData ); -#ifdef PARAM_ISM_DTX_CNG /* ISM DTX Handle */ if ( st_ivas->hISMDTX != NULL ) { free( st_ivas->hISMDTX ); st_ivas->hISMDTX = NULL; } -#endif /* Q Metadata handle */ ivas_qmetadata_close( &( st_ivas->hQMetaData ) ); /* DirAC handle */ - if ( st_ivas->hDirAC != NULL ) + if ( ivas_format == ISM_FORMAT ) { - if ( ivas_format == ISM_FORMAT ) - { - ivas_param_ism_enc_close( st_ivas->hDirAC, st_ivas->hEncoderConfig->input_Fs ); - } - else - { - ivas_dirac_enc_close( st_ivas->hDirAC, st_ivas->hEncoderConfig->input_Fs ); - } - st_ivas->hDirAC = NULL; + ivas_param_ism_enc_close( &( st_ivas->hDirAC ), st_ivas->hEncoderConfig->input_Fs ); } - - /* SPAR handle */ - if ( st_ivas->hSpar != NULL ) + else { -#ifdef SBA_BR_SWITCHING_CLEAN_UP - ivas_spar_enc_close( st_ivas->hSpar, st_ivas->hEncoderConfig->input_Fs, nchan_inp, 0 ); -#else - ivas_spar_enc_close( st_ivas->hSpar, st_ivas->hEncoderConfig->input_Fs, nchan_inp ); -#endif - st_ivas->hSpar = NULL; + ivas_dirac_enc_close( &( st_ivas->hDirAC ), st_ivas->hEncoderConfig->input_Fs ); } + /* SPAR handle */ + ivas_spar_enc_close( &( st_ivas->hSpar ), st_ivas->hEncoderConfig->input_Fs, nchan_inp, 0 ); + /* MASA handle */ - if ( st_ivas->hMasa != NULL ) - { #ifdef FIX_350_MASA_DELAY_COMP - ivas_masa_enc_close( st_ivas->hMasa ); + ivas_masa_enc_close( &( st_ivas->hMasa ) ); #else - ivas_masa_enc_close( st_ivas->hMasa, st_ivas->nchan_transport, ivas_format ); + ivas_masa_enc_close( &( st_ivas->hMasa ), st_ivas->nchan_transport, ivas_format ); #endif - st_ivas->hMasa = NULL; - } /* MCT handle */ - if ( st_ivas->hMCT != NULL ) - { - ivas_mct_enc_close( st_ivas->hMCT ); - st_ivas->hMCT = NULL; - } + ivas_mct_enc_close( &( st_ivas->hMCT ) ); + + /* LFE handle */ + ivas_lfe_enc_close( &( st_ivas->hLFE ) ); /* Parametric MC handle */ - if ( st_ivas->hParamMC != NULL ) - { - ivas_param_mc_enc_close( st_ivas->hParamMC, st_ivas->hEncoderConfig->input_Fs ); - st_ivas->hParamMC = NULL; - } + ivas_param_mc_enc_close( &( st_ivas->hParamMC ), st_ivas->hEncoderConfig->input_Fs ); /* Multi-channel MASA handle */ - if ( st_ivas->hMcMasa != NULL ) - { - ivas_mcmasa_enc_close( st_ivas->hMcMasa, st_ivas->hEncoderConfig->input_Fs ); - st_ivas->hMcMasa = NULL; - } + ivas_mcmasa_enc_close( &( st_ivas->hMcMasa ), st_ivas->hEncoderConfig->input_Fs ); /* Stereo downmix for EVS encoder handle */ - if ( st_ivas->hStereoDmxEVS != NULL ) - { - stereo_dmx_evs_close_encoder( st_ivas->hStereoDmxEVS ); - st_ivas->hStereoDmxEVS = NULL; - } - - /* LFE handle */ - if ( st_ivas->hLFE != NULL ) - { - ivas_lfe_enc_close( st_ivas->hLFE ); - st_ivas->hLFE = NULL; - } + stereo_dmx_evs_close_encoder( &( st_ivas->hStereoDmxEVS ) ); /* Encoder configuration handle */ if ( st_ivas->hEncoderConfig != NULL ) diff --git a/lib_enc/ivas_ism_dtx_enc.c b/lib_enc/ivas_ism_dtx_enc.c index bc8134f365..3839a42a9d 100644 --- a/lib_enc/ivas_ism_dtx_enc.c +++ b/lib_enc/ivas_ism_dtx_enc.c @@ -41,7 +41,16 @@ #endif #include "wmc_auto.h" -#ifdef PARAM_ISM_DTX_CNG + +#ifdef DISCRETE_ISM_DTX_CNG +/*-----------------------------------------------------------------------* + * Local constants + *-----------------------------------------------------------------------*/ + +#define MD_MAX_DIFF_AZIMUTH 10 +#define MD_MAX_DIFF_ELEVATION 10 +#endif + /*-------------------------------------------------------------------* * ivas_ism_dtx_open() @@ -67,8 +76,11 @@ ivas_error ivas_ism_dtx_open( hISMDTX->dtx_flag = 0; hISMDTX->sce_id_dtx = 0; - +#ifdef DISCRETE_ISM_DTX_CNG + hISMDTX->cnt_SID_ISM = -1; +#else set_s( hISMDTX->dtx_speech_buffer_enc, 0, PARAM_ISM_HYS_BUF_SIZE ); +#endif for ( i = 0; i < MAX_NUM_OBJECTS; i++ ) { @@ -83,6 +95,209 @@ ivas_error ivas_ism_dtx_open( } +#ifdef DISCRETE_ISM_DTX_CNG +/*-------------------------------------------------------------------* + * ivas_ism_get_dtx_enc() + * + * Analysis and decision about DTX in ISM format + *-------------------------------------------------------------------*/ + +/*! r: indication of DTX frame */ +int16_t ivas_ism_dtx_enc( + ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ + SCE_ENC_HANDLE hSCE[MAX_SCE], /* i/o: SCE encoder structure */ + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + const int16_t nchan_ism, /* i : number of objects */ + const int16_t nchan_transport, /* i : number of transport channels */ + int16_t vad_flag[MAX_NUM_OBJECTS], /* i : VAD flag */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + int16_t md_diff_flag[], /* o : metadata differential flag */ + int16_t *sid_flag /* o : indication of SID frame */ +) +{ + int16_t ch, dtx_flag; + int16_t nBits, nBits_MD_max; + int16_t nBits_azimuth, nBits_elevation, nBits_coh, nBits_sce_id; + float lp_noise[MAX_NUM_OBJECTS], lp_noise_variation, lp_noise_mean; + float lp_noise_max; + float tmp1, tmp2; + + /* initialization */ + for ( ch = 0; ch < nchan_transport; ch++ ) + { + hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; + } + + /*------------------------------------------------------------------* + * compute global ISM DTX flag + *-----------------------------------------------------------------*/ + + /* compute global ISM based on localVAD */ + dtx_flag = 1; + for ( ch = 0; ch < nchan_transport; ch++ ) + { + dtx_flag &= !vad_flag[ch]; + } + + /* compute global ISM based on long-term background noise */ + /* one of the channels is active -> no DTX */ + for ( ch = 0; ch < nchan_transport; ch++ ) + { + lp_noise[ch] = hSCE[ch]->hCoreCoder[0]->lp_noise; + } + + lp_noise_variation = var( lp_noise, nchan_transport ); + lp_noise_mean = mean( lp_noise, nchan_transport ); + + if ( lp_noise_mean > 50 || ( lp_noise_mean > 25 && lp_noise_variation > 32 ) ) + { + dtx_flag = 0; + } + + + /* default DTX is applied at lower bitrates; otherwise DTX is applied only in silence */ + maximum( lp_noise, nchan_transport, &lp_noise_max ); + + if ( !( ( nchan_ism == 1 && ivas_total_brate <= IVAS_24k4 ) || + ( nchan_ism == 2 && ivas_total_brate <= IVAS_48k ) || + ( nchan_ism == 3 && ivas_total_brate <= IVAS_80k ) || + ( nchan_ism == 4 && ivas_total_brate <= IVAS_96k ) || + lp_noise_max < 15 ) ) + { + dtx_flag = 0; + } + + /*------------------------------------------------------------------* + * Reset the bitstream + *-----------------------------------------------------------------*/ + + if ( dtx_flag ) + { + /* reset the bitstream (IVAS format signaling was already written) */ + reset_indices_enc( hSCE[0]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); + } + + /*------------------------------------------------------------------* + * decide about SID metadata to be sent or not (per object) + * estimate the MD bit-budget consumption + *-----------------------------------------------------------------*/ + + if ( dtx_flag ) + { + ivas_get_ism_sid_quan_bitbudget( nchan_ism, &nBits_azimuth, &nBits_elevation, &tmp1, &tmp2, &nBits_coh, &nBits_sce_id ); + + nBits = 0; + for ( ch = 0; ch < nchan_ism; ch++ ) + { + /* check difference between current and last metadata */ + md_diff_flag[ch] = 0; + if ( fabsf( hIsmMeta[ch]->azimuth - hIsmMeta[ch]->last_azimuth ) > MD_MAX_DIFF_AZIMUTH ) + { + md_diff_flag[ch] = 1; + } + + if ( fabsf( hIsmMeta[ch]->elevation - hIsmMeta[ch]->last_elevation ) > MD_MAX_DIFF_ELEVATION ) + { + md_diff_flag[ch] = 1; + } + + /* estimate SID metadata bit-budget */ + nBits++; /* number of objects */ + nBits++; /* SID metadata flag */ + if ( md_diff_flag[ch] == 1 ) + { + nBits += nBits_azimuth; + nBits += nBits_elevation; + } + } + + /* calculate maximum available MD bit-budget */ + nBits_MD_max = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC; + nBits_MD_max -= SID_FORMAT_NBITS; + if ( nchan_transport > 1 ) + { + nBits_MD_max -= nBits_sce_id; + } + + for ( ch = 0; ch < nchan_transport - 1; ch++ ) + { + nBits_MD_max -= nBits_coh; /* coherence */ + } + + if ( nchan_ism > 3 ) + { + nBits_MD_max--; /* ism_mode flag */ + } + + /* too many metadata bits -> switch to active coding */ + if ( nBits > nBits_MD_max ) + { + dtx_flag = 0; + } + } + + /*------------------------------------------------------------------* + * set core_brate for all channels + * get 'sid_flag' value + *-----------------------------------------------------------------*/ + + *sid_flag = 0; + + if ( !dtx_flag ) + { + /* at least one of the channels is active -> no DTX */ + for ( ch = 0; ch < nchan_transport; ch++ ) + { + hSCE[ch]->hCoreCoder[0]->core_brate = -1; + set_bw( IVAS_SCE, hSCE[ch]->element_brate, hSCE[ch]->hCoreCoder[0], MODE1 ); + } + + hISMDTX->cnt_SID_ISM = -1; + + /* IVAS format signaling was erased in dtx() */ + if ( hSCE[0]->hCoreCoder[0]->hBstr->nb_bits_tot == 0 ) + { + /* replicate ivas_write_format() */ + push_indice( hSCE[0]->hCoreCoder[0]->hBstr, IND_IVAS_FORMAT, 2 /* == ISM format */, IVAS_FORMAT_SIGNALING_NBITS ); + } + } + else /* ism_dtx_flag == 1 */ + { + for ( ch = 0; ch < nchan_transport; ch++ ) + { + hSCE[ch]->hCoreCoder[0]->cng_type = FD_CNG; + } + + /* * update the global SID counter */ + hISMDTX->cnt_SID_ISM++; + if ( hISMDTX->cnt_SID_ISM >= hSCE[0]->hCoreCoder[0]->hDtxEnc->max_SID ) + { + /* adaptive SID update interval */ + hSCE[0]->hCoreCoder[0]->hDtxEnc->max_SID = hSCE[0]->hCoreCoder[0]->hDtxEnc->interval_SID; + hISMDTX->cnt_SID_ISM = 0; + } + + /* encode SID in one channel only */ + for ( ch = 0; ch < nchan_transport; ch++ ) + { + hSCE[ch]->hCoreCoder[0]->core_brate = FRAME_NO_DATA; + } + + if ( hISMDTX->cnt_SID_ISM == 0 ) + { + hSCE[hISMDTX->sce_id_dtx]->hCoreCoder[0]->core_brate = SID_2k40; + *sid_flag = 1; + } + } + + if ( dtx_flag == 1 && *sid_flag == 0 ) + { + set_s( md_diff_flag, 0, nchan_transport ); + } + + return dtx_flag; +} +#else /*-------------------------------------------------------------------* * ivas_ism_dtx_enc() * @@ -170,13 +385,7 @@ int16_t ivas_ism_dtx_enc( if ( ( st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == -1 ) && ( st_ivas->hSCE[0]->hCoreCoder[0]->last_core_brate == SID_2k40 || st_ivas->hSCE[0]->hCoreCoder[0]->last_core_brate == FRAME_NO_DATA ) ) { st_ivas->hSCE[0]->hCoreCoder[0]->core_brate = st_ivas->hSCE[0]->hCoreCoder[0]->last_core_brate; - reset_indices_enc( st_ivas->hSCE[0]->hCoreCoder[0]->hBstr, -#ifdef IND_LIST_DYN - st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->max_num_indices -#else - MAX_NUM_INDICES -#endif - ); + reset_indices_enc( st_ivas->hSCE[0]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); } st_ivas->hSCE[1]->hCoreCoder[0]->core_brate = st_ivas->hSCE[0]->hCoreCoder[0]->core_brate; @@ -223,7 +432,7 @@ int16_t ivas_ism_dtx_enc( return dtx_flag; } - +#endif /*-------------------------------------------------------------------* * ivas_ism_get_sce_id_dtx() @@ -295,7 +504,11 @@ void ivas_ism_coh_estim_dtx_enc( { Encoder_State *st, *st_id0; int16_t sce_id, i; +#ifdef DISCRETE_ISM_DTX_CNG + float acorr_ene[MAX_NUM_OBJECTS], xcorr_ene; +#else float acorr_ene[PARAM_ISM_MAX_DMX], xcorr_ene; +#endif if ( nchan_transport == 1 ) { @@ -339,4 +552,3 @@ void ivas_ism_coh_estim_dtx_enc( return; } -#endif diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 85b8e0c4aa..25ce78ff2e 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -85,9 +85,16 @@ ivas_error ivas_ism_enc( float Etot_LR[1]; /* total energy; correlation shift */ float lf_E[1][2 * VOIC_BINS]; /* per bin spectrum energy in lf */ int16_t localVAD_HE_SAD[1]; /* local HE VAD */ +#ifdef DISCRETE_ISM_DTX_CNG + int16_t nchan_ism, dtx_flag, sid_flag, flag_noisy_speech; + int16_t md_diff_flag[MAX_NUM_OBJECTS]; +#else +#ifdef NCHAN_ISM_PARAMETER + int16_t nchan_ism, dtx_flag, sid_flag; +#else + int16_t dtx_flag, sid_flag, flag_noisy_speech; +#endif int16_t i, nBits; -#ifdef PARAM_ISM_DTX_CNG - int16_t dtx_flag, sid_flag; #endif ivas_error error; @@ -99,10 +106,27 @@ ivas_error ivas_ism_enc( error = IVAS_ERR_OK; -#ifdef PARAM_ISM_DTX_CNG dtx_flag = 0; sid_flag = 0; +#if ( !defined NCHAN_ISM_PARAMETER || defined DISCRETE_ISM_DTX_CNG ) + flag_noisy_speech = 0; +#endif + +#ifdef NCHAN_ISM_PARAMETER + nchan_ism = st_ivas->hEncoderConfig->nchan_ism; +#else +#ifdef DISCRETE_ISM_DTX_CNG + if ( st_ivas->ism_mode == ISM_MODE_PARAM ) + { + nchan_ism = st_ivas->hDirAC->hParamIsm->num_obj; + } + else /* ism_mode == ISM_MODE_DISC */ + { + nchan_ism = st_ivas->nchan_transport; + } +#endif #endif + set_s( md_diff_flag, 1, nchan_ism ); /*------------------------------------------------------------------* * Preprocesing @@ -158,39 +182,47 @@ ivas_error ivas_ism_enc( * Front Pre-processing *----------------------------------------------------------------*/ -#ifdef LOW_RATE_TRANS_CORE_CODER error = pre_proc_front_ivas( hSCE, NULL, hSCE->element_brate, nb_bits_metadata[sce_id], input_frame, 0, old_inp_12k8[sce_id][0], old_inp_16k[sce_id][0], &ener[sce_id][0], &relE[sce_id][0], A[sce_id][0], Aw[sce_id][0], epsP[sce_id][0], lsp_new[sce_id][0], lsp_mid[sce_id][0], &vad_hover_flag[sce_id][0], &attack_flag[sce_id][0], realBuffer[sce_id][0], imagBuffer[sce_id][0], old_wsp[sce_id][0], pitch_fr[sce_id][0], voicing_fr[sce_id][0], &loc_harm[sce_id][0], &cor_map_sum[sce_id][0], &vad_flag_dtx[sce_id][0], enerBuffer[sce_id][0], fft_buff[sce_id][0], A[sce_id][0], lsp_new[sce_id][0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, 0, 0, 0, 0, st_ivas->hEncoderConfig->ivas_total_brate ); -#else - error = pre_proc_front_ivas( hSCE, NULL, hSCE->element_brate, nb_bits_metadata[sce_id], input_frame, 0, old_inp_12k8[sce_id][0], old_inp_16k[sce_id][0], - &ener[sce_id][0], &relE[sce_id][0], A[sce_id][0], Aw[sce_id][0], epsP[sce_id][0], lsp_new[sce_id][0], lsp_mid[sce_id][0], - &vad_hover_flag[sce_id][0], &attack_flag[sce_id][0], realBuffer[sce_id][0], imagBuffer[sce_id][0], old_wsp[sce_id][0], pitch_fr[sce_id][0], voicing_fr[sce_id][0], &loc_harm[sce_id][0], &cor_map_sum[sce_id][0], &vad_flag_dtx[sce_id][0], enerBuffer[sce_id][0], - fft_buff[sce_id][0], A[sce_id][0], lsp_new[sce_id][0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, 0, 0, 0, 0, - st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->hEncoderConfig->ivas_format ); -#endif if ( error != IVAS_ERR_OK ) { return error; } - vad_flag[sce_id] = st->vad_flag; +#ifdef DISCRETE_ISM_DTX_CNG + if ( st_ivas->hEncoderConfig->Opt_DTX_ON ) + { + vad_flag[sce_id] = vad_flag_dtx[sce_id][0]; + } + else +#endif + { + vad_flag[sce_id] = st->vad_flag; + } } -#ifdef PARAM_ISM_DTX_CNG /*------------------------------------------------------------------* * DTX analysis *-----------------------------------------------------------------*/ +#ifdef DISCRETE_ISM_DTX_CNG + if ( st_ivas->hEncoderConfig->Opt_DTX_ON ) +#else if ( st_ivas->hEncoderConfig->Opt_DTX_ON && st_ivas->ism_mode == ISM_MODE_PARAM ) +#endif { /* compute the dominant sce_id using long term energy */ ivas_ism_get_sce_id_dtx( st_ivas->hISMDTX, st_ivas->hSCE, st_ivas->nchan_transport, input_frame ); /* analysis and decision about DTX */ +#ifdef DISCRETE_ISM_DTX_CNG + dtx_flag = ivas_ism_dtx_enc( st_ivas->hISMDTX, st_ivas->hSCE, st_ivas->hEncoderConfig->ivas_total_brate, nchan_ism, st_ivas->nchan_transport, vad_flag, st_ivas->hIsmMetaData, md_diff_flag, &sid_flag ); +#else dtx_flag = ivas_ism_dtx_enc( st_ivas, &sid_flag ); +#endif if ( sid_flag ) { @@ -199,85 +231,96 @@ ivas_error ivas_ism_enc( } #ifdef DEBUG_MODE_PARAM_ISM - dbgwrite( &( st_ivas->hISMDTX->flag_noisy_speech ), sizeof( int16_t ), 1, 1, "./res/ParamISM_noisy_speech_flag_enc.dat" ); + if ( st_ivas->hDirAC != NULL ) + dbgwrite( &( st_ivas->hDirAC->hParamIsm->flag_noisy_speech ), sizeof( int16_t ), 1, 1, "./res/ParamISM_noisy_speech_flag_enc.dat" ); dbgwrite( &( st_ivas->hISMDTX->dtx_flag ), sizeof( int16_t ), 1, 1, "./res/ParamISM_DTX_CNG_flag_enc.dat" ); + dbgwrite( &( st_ivas->hISMDTX->sce_id_dtx ), sizeof( int16_t ), 1, input_frame, "./res/sce_id_dtx" ); + dbgwrite( &( dtx_flag ), sizeof( int16_t ), 1, input_frame, "./res/dtx_flag" ); #endif } -#endif /*------------------------------------------------------------------* * Analysis of objects, configuration and decision about bitrates per channel * Metadata quantization and encoding *-----------------------------------------------------------------*/ -#ifdef PARAM_ISM_DTX_CNG if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { ivas_param_ism_compute_noisy_speech_flag( st_ivas ); +#ifdef DISCRETE_ISM_DTX_CNG + flag_noisy_speech = st_ivas->hDirAC->hParamIsm->flag_noisy_speech; +#endif } if ( dtx_flag ) { +#ifdef DISCRETE_ISM_DTX_CNG + ivas_ism_metadata_sid_enc( st_ivas->hISMDTX, flag_noisy_speech, nchan_ism, st_ivas->nchan_transport, st_ivas->ism_mode, st_ivas->hIsmMetaData, sid_flag, md_diff_flag, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata ); +#else if ( sid_flag ) { +#ifdef NCHAN_ISM_PARAMETER + ivas_param_ism_metadata_dtx_enc( st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, st_ivas->hIsmMetaData, st_ivas->hISMDTX, st_ivas->hDirAC->hParamIsm, nchan_ism ); +#else ivas_param_ism_metadata_dtx_enc( st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, st_ivas->hIsmMetaData, st_ivas->hISMDTX, st_ivas->hDirAC->hParamIsm ); +#endif } - } - else #endif - if ( st_ivas->ism_mode == ISM_MODE_PARAM ) + } + else if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { -#ifndef PARAM_ISM_DTX_CNG - /* Move the Noisy speech buffer */ - for ( i = 0; i < ( PARAM_ISM_HYS_BUF_SIZE - 1 ); i++ ) - { - st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i + 1]; - } - - /* For the current frame, make a decision based on some core-coder flags */ - if ( st_ivas->hSCE[0]->hCoreCoder[0]->flag_noisy_speech_snr && st_ivas->hSCE[1]->hCoreCoder[0]->flag_noisy_speech_snr ) - { - if ( st_ivas->hSCE[0]->hCoreCoder[0]->vad_flag || st_ivas->hSCE[1]->hCoreCoder[0]->vad_flag ) - { - st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = 0; - } - else - { - st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = 1; - } - } - else - { - st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = 0; - } - - /* Do a decision based on hysterisis */ - st_ivas->hDirAC->hParamIsm->flag_noisy_speech = 1; - for ( i = 0; i < PARAM_ISM_HYS_BUF_SIZE; i++ ) - { - st_ivas->hDirAC->hParamIsm->flag_noisy_speech = st_ivas->hDirAC->hParamIsm->flag_noisy_speech && st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i]; - } + // VE: call ivas_ism_metadata_enc() with 'st_ivas' - TBD +#ifdef TD5 + ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, +#ifdef NCHAN_ISM_PARAMETER + nchan_ism, +#endif + st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm, st_ivas->hEncoderConfig->ism_extended_metadata_flag ); +#else + ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, +#ifdef NCHAN_ISM_PARAMETER + nchan_ism, +#endif + st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm ); #endif - ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm ); } else /* ISM_MODE_DISC */ { - ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, NULL ); +#ifdef TD5 + ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, +#ifdef NCHAN_ISM_PARAMETER + nchan_ism, +#endif + st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, NULL, st_ivas->hEncoderConfig->ism_extended_metadata_flag ); +#else + ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, +#ifdef NCHAN_ISM_PARAMETER + nchan_ism, +#endif + st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, NULL ); +#endif } +#ifdef DISCRETE_ISM_DTX_CNG + update_last_metadata( nchan_ism, st_ivas->hIsmMetaData, md_diff_flag ); +#endif + /*----------------------------------------------------------------* * Write IVAS format signaling in SID frames *----------------------------------------------------------------*/ st = st_ivas->hSCE[0]->hCoreCoder[0]; +#ifdef DISCRETE_ISM_DTX_CNG + if ( sid_flag ) +#else if ( st->core_brate == SID_2k40 ) +#endif { ivas_write_format_sid( st_ivas->hEncoderConfig->ivas_format, IVAS_SCE, st->hBstr ); -#ifdef PARAM_ISM_DTX_CNG +#ifndef DISCRETE_ISM_DTX_CNG if ( st_ivas->ism_mode != ISM_MODE_PARAM ) -#endif { /* write unused bits */ nBits = ( IVAS_SID_5k2 - SID_2k40 ) / 50 - SID_FORMAT_NBITS; @@ -288,6 +331,7 @@ ivas_error ivas_ism_enc( nBits -= i; } } +#endif } /*------------------------------------------------------------------* @@ -329,9 +373,7 @@ ivas_error ivas_ism_enc( * Encoder *----------------------------------------------------------------*/ -#ifdef PARAM_ISM_DTX_CNG if ( !dtx_flag || ( dtx_flag && sce_id == st_ivas->hISMDTX->sce_id_dtx ) ) -#endif { if ( ( error = ivas_core_enc( hSCE, NULL, NULL, 1, old_inp_12k8[sce_id], old_inp_16k[sce_id], ener[sce_id], A[sce_id], Aw[sce_id], epsP[sce_id], lsp_new[sce_id], lsp_mid[sce_id], vad_hover_flag[sce_id], attack_flag[sce_id], realBuffer[sce_id], imagBuffer[sce_id], old_wsp[sce_id], loc_harm[sce_id], cor_map_sum[sce_id], vad_flag_dtx[sce_id], enerBuffer[sce_id], fft_buff[sce_id], 0, ISM_FORMAT, 0 ) ) != IVAS_ERR_OK ) { @@ -350,7 +392,6 @@ ivas_error ivas_ism_enc( st->hTranDet->transientDetector.prev_bIsAttackPresent = st->hTranDet->transientDetector.bIsAttackPresent; } -#ifdef PARAM_ISM_DTX_CNG if ( dtx_flag ) { for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ ) @@ -359,11 +400,47 @@ ivas_error ivas_ism_enc( { st_ivas->hSCE[sce_id]->hCoreCoder[0]->last_core = st_ivas->hSCE[st_ivas->hISMDTX->sce_id_dtx]->hCoreCoder[0]->last_core; st_ivas->hSCE[sce_id]->hCoreCoder[0]->last_core_brate = st_ivas->hSCE[st_ivas->hISMDTX->sce_id_dtx]->hCoreCoder[0]->core_brate; + st_ivas->hSCE[sce_id]->hCoreCoder[0]->last_L_frame = st_ivas->hSCE[st_ivas->hISMDTX->sce_id_dtx]->hCoreCoder[0]->last_L_frame; } } } -#endif +#ifdef DISCRETE_ISM_DTX_CNG +#ifdef DEBUG_MODE_INFO + if ( dtx_flag ) + { + float tmpF; + int16_t id, n; + + n = 0; + for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ ) + { + if ( sce_id != st_ivas->hISMDTX->sce_id_dtx ) + { + st = st_ivas->hSCE[sce_id]->hCoreCoder[0]; + id = st->id_element; + + dbgwrite( &st->core, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "core", n, id, ENC ) ); + dbgwrite( &st->extl, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "extl", n, id, ENC ) ); + dbgwrite( &st->bwidth, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "bwidth", n, id, ENC ) ); + tmpF = st->total_brate / 1000.0f; + dbgwrite( &tmpF, sizeof( float ), 1, input_frame, fname( debug_dir, "total_brate", n, id, ENC ) ); + tmpF = st->core_brate / 1000.0f; + dbgwrite( &tmpF, sizeof( float ), 1, input_frame, fname( debug_dir, "core_brate", n, id, ENC ) ); + tmpF = st->extl_brate / 1000.0f; + dbgwrite( &tmpF, sizeof( float ), 1, input_frame, fname( debug_dir, "extl_brate", n, id, ENC ) ); + + dbgwrite( &st->coder_type, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "coder_type", n, id, ENC ) ); + dbgwrite( &st->coder_type_raw, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "coder_type_raw", n, id, ENC ) ); + dbgwrite( &st->vad_flag, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "vad_flag", n, id, ENC ) ); + dbgwrite( &st->localVAD, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "localVAD", n, id, ENC ) ); + + dbgwrite( &st->lp_noise, sizeof( float ), 1, input_frame, fname( debug_dir, "lp_noise", n, id, ENC ) ); + } + } + } +#endif +#endif pop_wmops(); return error; @@ -377,7 +454,6 @@ ivas_error ivas_ism_enc( * - reconfigure the ISM format encoder *-------------------------------------------------------------------------*/ -/*! r : ISM format mode */ ivas_error ivas_ism_enc_config( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ) @@ -403,7 +479,7 @@ ivas_error ivas_ism_enc_config( /* Reset and Initialize */ if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { - st_ivas->nchan_transport = 2; + st_ivas->nchan_transport = MAX_PARAM_ISM_WAVE; } else { @@ -437,8 +513,7 @@ ivas_error ivas_ism_enc_config( if ( st_ivas->ism_mode == ISM_MODE_DISC && last_ism_mode == ISM_MODE_PARAM ) { /* Deallocate the memory used by ParamISM when switch to Discrete ISM */ - ivas_param_ism_enc_close( st_ivas->hDirAC, st_ivas->hEncoderConfig->input_Fs ); - st_ivas->hDirAC = NULL; + ivas_param_ism_enc_close( &( st_ivas->hDirAC ), st_ivas->hEncoderConfig->input_Fs ); } } diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 41e0f8ac78..1540e35ce4 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -49,16 +49,34 @@ * Local constants *-----------------------------------------------------------------------*/ +#ifdef TD5 +#define ISM_NUM_PARAM 5 /* number of coded metadata parameters */ +#else #define ISM_NUM_PARAM 2 /* number of coded metadata parameters */ +#endif #define ISM_MAX_AZIMUTH_DIFF_IDX ( ISM_AZIMUTH_NBITS - 1 /*zero*/ - 1 /*sign*/ ) #define ISM_MAX_ELEVATION_DIFF_IDX ( ISM_ELEVATION_NBITS - 1 /*zero*/ - 1 /*sign*/ ) +#ifdef TD5 +#define ISM_MAX_RADIUS_DIFF_IDX ( ISM_RADIUS_NBITS - 1 /*zero*/ - 1 /*sign*/ ) +#endif #define ISM_FEC_MAX 10 #define INTER_OBJECT_PARAM_CHECK ( ( ISM_FEC_MAX / 2 ) - 2 ) /* note: constant must be less than (ISM_FEC_MAX / number of coded parameters) */ +#ifdef TD5 +/*-----------------------------------------------------------------------* + * Local function declarations + *-----------------------------------------------------------------------*/ + +static void encode_angle_indices( BSTR_ENC_HANDLE hBstr, ISM_METADATA_ANGLE_HANDLE angle, const int16_t last_ism_metadata_flag, const int16_t ini_frame, const int16_t idx_azimuth_abs, const int16_t idx_elevation_abs, int16_t *flag_abs_azimuth, int16_t *flag_abs_elevation ); + +static void encode_radius( BSTR_ENC_HANDLE hBstr, int16_t *last_radius_idx, int16_t *radius_diff_cnt, const int16_t last_ism_metadata_flag, const int16_t idx_radius_abs, int16_t *flag_abs_radius ); + +#endif + /*-------------------------------------------------------------------------* * ivas_set_ism_metadata() * @@ -68,7 +86,14 @@ ivas_error ivas_set_ism_metadata( ISM_METADATA_HANDLE hIsmMeta, /* o : ISM metadata handle */ const float azimuth, /* i : azimuth value */ - const float elevation /* i : elevation value */ +#ifdef TD5 + const float elevation, /* i : elevation */ + const float radius_meta, /* i : radius */ + const float yaw, /* i : yaw */ + const float pitch /* i : pitch */ +#else + const float elevation /* i : elevation value */ +#endif ) { if ( hIsmMeta == NULL ) @@ -81,6 +106,11 @@ ivas_error ivas_set_ism_metadata( /* save read metadata parameters to the internal codec structure */ hIsmMeta->azimuth = azimuth; hIsmMeta->elevation = elevation; +#ifdef TD5 + hIsmMeta->radius = radius_meta; + hIsmMeta->yaw = yaw; + hIsmMeta->pitch = pitch; +#endif return IVAS_ERR_OK; } @@ -89,7 +119,7 @@ ivas_error ivas_set_ism_metadata( /*-------------------------------------------------------------------------* * rate_ism_importance() * - * Rate importance of particular ISm streams + * Rate importance of particular ISM streams *-------------------------------------------------------------------------*/ static void rate_ism_importance( @@ -146,64 +176,96 @@ static void rate_ism_importance( *-------------------------------------------------------------------------*/ ivas_error ivas_ism_metadata_enc( - const int32_t ism_total_brate, /* i : ISms total bitrate */ - const int16_t nchan_transport, /* i : number of transport channels */ - ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ - SCE_ENC_HANDLE hSCE[], /* i/o: SCE encoder handles */ - BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ - int16_t nb_bits_metadata[], /* o : number of metadata bits */ - const int16_t localVAD[], /* i : VAD flag */ - const int16_t ism_mode, /* i : ISM mode */ + const int32_t ism_total_brate, /* i : ISM total bitrate */ +#ifdef NCHAN_ISM_PARAMETER + const int16_t nchan_ism, /* i : number of ISM channels */ +#endif + const int16_t nchan_transport, /* i : number of transport channels */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + SCE_ENC_HANDLE hSCE[], /* i/o: SCE encoder handles */ + BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ + int16_t nb_bits_metadata[], /* o : number of metadata bits */ + const int16_t localVAD[], /* i : VAD flag */ + const int16_t ism_mode, /* i : ISM mode */ +#ifdef TD5 + const PARAM_ISM_CONFIG_HANDLE hParamIsm, /* i : Param ISM Enc Handle */ + const int16_t ism_extended_metadata_flag /* i : Extended metadata flag */ +#else const PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Enc Handle */ +#endif ) { +#ifdef TD5 +#ifdef TUNE_360_OBJECT_WITH_NOISE + int16_t i, ch, nb_bits_start = 0; +#else + int16_t i, ch, nb_bits_start = 0, diff; +#endif + int16_t idx_azimuth_abs = 0, flag_abs_azimuth[MAX_NUM_OBJECTS]; + int16_t idx_elevation_abs = 0, flag_abs_elevation[MAX_NUM_OBJECTS]; + int16_t flag_abs_azimuth_orientation[MAX_NUM_OBJECTS]; + int16_t idx_radius_abs = 0, flag_abs_radius[MAX_NUM_OBJECTS]; +#else int16_t i, ch, nb_bits_start = 0, diff; int16_t idx_azimuth, idx_azimuth_abs = 0, flag_abs_azimuth[MAX_NUM_OBJECTS], nbits_diff_azimuth; int16_t idx_elevation, idx_elevation_abs = 0, flag_abs_elevation[MAX_NUM_OBJECTS], nbits_diff_elevation; +#endif float valQ; ISM_METADATA_HANDLE hIsmMetaData; int32_t element_brate[MAX_NUM_OBJECTS], total_brate[MAX_NUM_OBJECTS]; int16_t ism_metadata_flag_global; int16_t ism_imp[MAX_NUM_OBJECTS]; - int16_t num_obj, nbands, nblocks; +#ifdef NCHAN_ISM_PARAMETER + int16_t nbands, nblocks; +#else + int16_t nchan_ism, nbands, nblocks; +#endif ivas_error error; error = IVAS_ERR_OK; push_wmops( "ism_meta_enc" ); +#ifndef NCHAN_ISM_PARAMETER if ( ism_mode == ISM_MODE_PARAM ) { - num_obj = hParamIsm->num_obj; + nchan_ism = hParamIsm->num_obj; } else if ( ism_mode == ISM_MODE_DISC ) { - num_obj = nchan_transport; + nchan_ism = nchan_transport; } else { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: incorrect ISM mode" ); } +#endif - if ( num_obj == 1 && ( hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 || hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA ) && ism_mode == ISM_MODE_DISC ) +#ifndef DISCRETE_ISM_DTX_CNG + if ( nchan_ism == 1 && ( hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 || hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA ) && ism_mode == ISM_MODE_DISC ) { /* no metadata encoding in CNG */ pop_wmops(); return error; } +#endif /* initialization */ ism_metadata_flag_global = 0; set_s( nb_bits_metadata, 0, nchan_transport ); - set_s( flag_abs_azimuth, 0, num_obj ); - set_s( flag_abs_elevation, 0, num_obj ); + set_s( flag_abs_azimuth, 0, nchan_ism ); + set_s( flag_abs_elevation, 0, nchan_ism ); +#ifdef TD5 + set_s( flag_abs_azimuth_orientation, 0, nchan_ism ); + set_s( flag_abs_radius, 0, nchan_ism ); +#endif /*----------------------------------------------------------------* * Set Metadata presence / importance flag *----------------------------------------------------------------*/ - for ( ch = 0; ch < num_obj; ch++ ) + for ( ch = 0; ch < nchan_ism; ch++ ) { if ( ism_mode == ISM_MODE_PARAM ) { @@ -211,6 +273,39 @@ ivas_error ivas_ism_metadata_enc( } else if ( ism_mode == ISM_MODE_DISC ) { +#ifdef TD5 +#ifdef TUNE_360_OBJECT_WITH_NOISE +#ifdef DISCRETE_ISM_DTX_CNG + hIsmMeta[ch]->ism_metadata_flag = localVAD[ch] || hSCE[ch]->hCoreCoder[0]->lp_noise > 10; +#else + /* In case of low level noise for low bitrate inactive frames, do not sent metadata */ + if ( localVAD[ch] == 0 && !( hSCE[ch]->hCoreCoder[0]->tcxonly ) && ( hSCE[ch]->hCoreCoder[0]->lp_noise <= 10 ) ) + { + hIsmMeta[ch]->ism_metadata_flag = 0; + } +#endif +#else + if ( hIsmMeta[ch]->ism_metadata_flag ) + { + /* at highest bitrates (with TCX core only) metadata are sent also for inactive frames */ + if ( localVAD[ch] == 0 && !( hSCE[ch]->hCoreCoder[0]->tcxonly ) ) + { + /* send metadata even in inactive segments when noise is audible and metadata are changing */ + diff = (int16_t) fabsf( hIsmMeta[ch]->azimuth - ism_dequant_meta( hIsmMeta[ch]->angle[0].last_azimuth_idx, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ) ); + diff = max( diff, (int16_t) fabsf( hIsmMeta[ch]->elevation - ism_dequant_meta( hIsmMeta[ch]->angle[0].last_elevation_idx, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ) ) ); + if ( ism_total_brate >= ISM_EXTENDED_METADATA_BRATE && ism_extended_metadata_flag ) + { + diff = max( diff, (int16_t) fabsf( hIsmMeta[ch]->yaw - ism_dequant_meta( hIsmMeta[ch]->angle[1].last_azimuth_idx, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ) ) ); + diff = max( diff, (int16_t) fabsf( hIsmMeta[ch]->pitch - ism_dequant_meta( hIsmMeta[ch]->angle[1].last_elevation_idx, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ) ) ); + } + if ( !( hSCE[ch]->hCoreCoder[0]->lp_noise > 15 && diff >= 10 ) ) + { + hIsmMeta[ch]->ism_metadata_flag = 0; + } + } + } +#endif +#else #ifdef TUNE_360_OBJECT_WITH_NOISE hIsmMeta[ch]->ism_metadata_flag = localVAD[ch] || hSCE[ch]->hCoreCoder[0]->lp_noise > 10; #else @@ -219,8 +314,8 @@ ivas_error ivas_ism_metadata_enc( if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) { /* send metadata even in inactive segments when noise is audible and metadata are changing */ - diff = (int16_t) fabsf( hIsmMeta[ch]->azimuth - ism_dequant_meta( hIsmMeta[ch]->last_azimuth_idx, ism_azimuth_borders, 1 << ISM_AZIMUTH_NBITS ) ); - diff = max( diff, (int16_t) fabsf( hIsmMeta[ch]->elevation - ism_dequant_meta( hIsmMeta[ch]->last_elevation_idx, ism_elevation_borders, 1 << ISM_ELEVATION_NBITS ) ) ); + diff = (int16_t) fabsf( hIsmMeta[ch]->azimuth - ism_dequant_meta( hIsmMeta[ch]->last_azimuth_idx, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ) ); + diff = max( diff, (int16_t) fabsf( hIsmMeta[ch]->elevation - ism_dequant_meta( hIsmMeta[ch]->last_elevation_idx, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ) ) ); if ( hSCE[ch]->hCoreCoder[0]->lp_noise > 15 && diff >= 10 ) { @@ -234,24 +329,25 @@ ivas_error ivas_ism_metadata_enc( /* at highest bitrates (with TCX core only) metadata are sent in every frame */ hIsmMeta[ch]->ism_metadata_flag = 1; } +#endif } } /*----------------------------------------------------------------* - * Rate importance of particular ISm streams + * Rate importance of particular ISM streams *----------------------------------------------------------------*/ rate_ism_importance( nchan_transport, hIsmMeta, hSCE, ism_imp ); #ifndef TUNE_360_OBJECT_WITH_NOISE /* relax the importance decision in "stereo" coding for noisy audio */ - if ( ism_mode == ISM_MODE_DISC && num_obj == 2 ) + if ( ism_mode == ISM_MODE_DISC && nchan_ism == 2 ) { float diff_F; if ( hIsmMeta[0]->ism_metadata_flag ^ hIsmMeta[1]->ism_metadata_flag ) { - for ( ch = 0; ch < num_obj; ch++ ) + for ( ch = 0; ch < nchan_ism; ch++ ) { diff_F = hSCE[ch]->hCoreCoder[0]->lp_speech - hSCE[ch]->hCoreCoder[0]->lp_noise; @@ -264,24 +360,33 @@ ivas_error ivas_ism_metadata_enc( } } #endif + /*----------------------------------------------------------------* - * Write ISm common signaling + * Write ISM common signaling *----------------------------------------------------------------*/ /* write number of objects - unary coding */ - for ( ch = 1; ch < num_obj; ch++ ) + for ( ch = 1; ch < nchan_ism; ch++ ) { push_indice( hBstr, IND_ISM_NUM_OBJECTS, 1, 1 ); } push_indice( hBstr, IND_ISM_NUM_OBJECTS, 0, 1 ); - /* write ISm metadata flag (one per object) */ +#ifdef TD5 + /* write extended metadata presence flag */ + if ( ism_total_brate >= ISM_EXTENDED_METADATA_BRATE ) + { + push_indice( hBstr, IND_ISM_EXTENDED_FLAG, ism_extended_metadata_flag, ISM_EXTENDED_METADATA_BITS ); + } +#endif + + /* write ISM metadata flag (one per object) */ for ( ch = 0; ch < nchan_transport; ch++ ) { push_indice( hBstr, IND_ISM_METADATA_FLAG, ism_imp[ch], ISM_METADATA_FLAG_BITS ); } - for ( ch = 0; ch < num_obj; ch++ ) + for ( ch = 0; ch < nchan_ism; ch++ ) { ism_metadata_flag_global |= hIsmMeta[ch]->ism_metadata_flag; } @@ -313,7 +418,7 @@ ivas_error ivas_ism_metadata_enc( nb_bits_start = hBstr->nb_bits_tot; } - for ( ch = 0; ch < num_obj; ch++ ) + for ( ch = 0; ch < nchan_ism; ch++ ) { hIsmMetaData = hIsmMeta[ch]; if ( ism_mode == ISM_MODE_DISC ) @@ -323,6 +428,43 @@ ivas_error ivas_ism_metadata_enc( if ( hIsmMeta[ch]->ism_metadata_flag ) { +#ifdef TD5 + /*----------------------------------------------------------------* + * Quantize and encode azimuth and elevation + *----------------------------------------------------------------*/ + + if ( ism_mode == ISM_MODE_DISC ) + { + idx_azimuth_abs = ism_quant_meta( hIsmMetaData->azimuth, &valQ, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ); + idx_elevation_abs = ism_quant_meta( hIsmMetaData->elevation, &valQ, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ); + } + else /* ISM_MODE_PARAM */ + { + idx_azimuth_abs = hParamIsm->azi_index[ch]; + idx_elevation_abs = hParamIsm->ele_index[ch]; + } + + encode_angle_indices( hBstr, &( hIsmMetaData->angle[0] ), hIsmMetaData->last_ism_metadata_flag, hSCE[0]->hCoreCoder[0]->ini_frame, idx_azimuth_abs, idx_elevation_abs, &flag_abs_azimuth[ch], &flag_abs_elevation[ch] ); + + /*----------------------------------------------------------------* + * Quantize and encode radius, yaw, and pitch + *----------------------------------------------------------------*/ + + if ( ism_mode == ISM_MODE_DISC && ism_extended_metadata_flag ) + { + idx_azimuth_abs = ism_quant_meta( hIsmMetaData->yaw, &valQ, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ); + idx_elevation_abs = ism_quant_meta( hIsmMetaData->pitch, &valQ, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ); + idx_radius_abs = usquant( hIsmMetaData->radius, &valQ, ISM_RADIUS_MIN, ISM_RADIUS_DELTA, 1 << ISM_RADIUS_NBITS ); + encode_angle_indices( hBstr, &( hIsmMetaData->angle[1] ), hIsmMetaData->last_ism_metadata_flag, hSCE[0]->hCoreCoder[0]->ini_frame, idx_azimuth_abs, idx_elevation_abs, &flag_abs_azimuth_orientation[ch], &flag_abs_elevation[ch] ); + encode_radius( hBstr, &hIsmMetaData->last_radius_idx, &hIsmMetaData->radius_diff_cnt, hIsmMetaData->last_ism_metadata_flag, idx_radius_abs, &flag_abs_radius[ch] ); + } + + /* save number of metadata bits written */ + if ( ism_mode == ISM_MODE_DISC ) + { + nb_bits_metadata[ch] = hBstr->nb_bits_tot - nb_bits_start; + } +#else /*----------------------------------------------------------------* * Azimuth quantization and encoding *----------------------------------------------------------------*/ @@ -330,7 +472,7 @@ ivas_error ivas_ism_metadata_enc( /* Azimuth quantization (quantize azimuth to the AZIMUTH_NBITS-bit index */ if ( ism_mode == ISM_MODE_DISC ) { - idx_azimuth_abs = ism_quant_meta( hIsmMetaData->azimuth, &valQ, ism_azimuth_borders, 1 << ISM_AZIMUTH_NBITS ); + idx_azimuth_abs = ism_quant_meta( hIsmMetaData->azimuth, &valQ, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ); } else if ( ism_mode == ISM_MODE_PARAM ) { @@ -436,7 +578,7 @@ ivas_error ivas_ism_metadata_enc( /* Elevation quantization (quantize azimuth to the ELEVATION_NBITS-bit index */ if ( ism_mode == ISM_MODE_DISC ) { - idx_elevation_abs = ism_quant_meta( hIsmMetaData->elevation, &valQ, ism_elevation_borders, 1 << ISM_ELEVATION_NBITS ); + idx_elevation_abs = ism_quant_meta( hIsmMetaData->elevation, &valQ, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ); } else /* ISM_MODE_PARAM */ { @@ -567,6 +709,7 @@ ivas_error ivas_ism_metadata_enc( { nb_bits_metadata[ch] = hBstr->nb_bits_tot - nb_bits_start; } +#endif } } @@ -576,12 +719,16 @@ ivas_error ivas_ism_metadata_enc( *----------------------------------------------------------------*/ i = 0; - while ( i == 0 || i < num_obj / INTER_OBJECT_PARAM_CHECK ) + while ( i == 0 || i < nchan_ism / INTER_OBJECT_PARAM_CHECK ) { int16_t num, abs_num, abs_first, abs_next, pos_zero; +#ifdef TD5 + int16_t abs_matrice[INTER_OBJECT_PARAM_CHECK * ISM_NUM_PARAM]; +#else int16_t abs_matrice[INTER_OBJECT_PARAM_CHECK * 2]; +#endif - num = min( INTER_OBJECT_PARAM_CHECK, num_obj - i * INTER_OBJECT_PARAM_CHECK ); + num = min( INTER_OBJECT_PARAM_CHECK, nchan_ism - i * INTER_OBJECT_PARAM_CHECK ); i++; set_s( abs_matrice, 0, INTER_OBJECT_PARAM_CHECK * ISM_NUM_PARAM ); @@ -627,12 +774,20 @@ ivas_error ivas_ism_metadata_enc( if ( abs_next % ISM_NUM_PARAM == 0 ) { +#ifdef TD5 + hIsmMeta[ch]->angle[0].azimuth_diff_cnt = abs_num - 1; +#else hIsmMeta[ch]->azimuth_diff_cnt = abs_num - 1; +#endif } if ( abs_next % ISM_NUM_PARAM == 1 ) { +#ifdef TD5 + hIsmMeta[ch]->angle[0].elevation_diff_cnt = abs_num - 1; +#else hIsmMeta[ch]->elevation_diff_cnt = abs_num - 1; +#endif /*hIsmMeta[ch]->elevation_diff_cnt = min( hIsmMeta[ch]->elevation_diff_cnt, ISM_FEC_MAX );*/ } @@ -695,12 +850,12 @@ ivas_error ivas_ism_metadata_enc( * Configuration and decision about bitrates per channel *----------------------------------------------------------------*/ - if ( ( error = ivas_ism_config( ism_total_brate, nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_config( ism_total_brate, nchan_transport, nchan_ism, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata ) ) != IVAS_ERR_OK ) { return error; } - for ( ch = 0; ch < num_obj; ch++ ) + for ( ch = 0; ch < nchan_ism; ch++ ) { hIsmMeta[ch]->last_ism_metadata_flag = hIsmMeta[ch]->ism_metadata_flag; } @@ -722,11 +877,7 @@ ivas_error ivas_ism_metadata_enc( /* write metadata only in active frames */ if ( hSCE[0]->hCoreCoder[0]->core_brate > SID_2k40 ) { -#ifdef IND_LIST_DYN - reset_indices_enc( hSCE[ch]->hMetaData, hSCE[ch]->hMetaData->max_num_indices ); -#else reset_indices_enc( hSCE[ch]->hMetaData, MAX_BITS_METADATA ); -#endif } } @@ -735,6 +886,7 @@ ivas_error ivas_ism_metadata_enc( return error; } + /*------------------------------------------------------------------------- * ivas_ism_metadata_enc_create() * @@ -752,7 +904,7 @@ ivas_error ivas_ism_metadata_enc_create( if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { - nchan_transport = 2; + nchan_transport = MAX_PARAM_ISM_WAVE; } else { @@ -763,21 +915,39 @@ ivas_error ivas_ism_metadata_enc_create( st_ivas->nSCE = nchan_transport; st_ivas->nCPE = 0; - /* allocate ISm metadata handles */ + /* allocate ISM metadata handles */ for ( ch = 0; ch < n_ISms; ch++ ) { if ( ( st_ivas->hIsmMetaData[ch] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISm MetaData\n" ) ); + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISM MetaData\n" ) ); } +#ifdef TD5 + st_ivas->hIsmMetaData[ch]->angle[0].last_azimuth_idx = 0; + st_ivas->hIsmMetaData[ch]->angle[0].azimuth_diff_cnt = ISM_FEC_MAX; + st_ivas->hIsmMetaData[ch]->angle[0].last_elevation_idx = 0; + st_ivas->hIsmMetaData[ch]->angle[0].elevation_diff_cnt = ISM_FEC_MAX - 1; + st_ivas->hIsmMetaData[ch]->last_radius_idx = 0; + st_ivas->hIsmMetaData[ch]->radius_diff_cnt = ISM_FEC_MAX - 2; + st_ivas->hIsmMetaData[ch]->angle[1].last_azimuth_idx = 0; + st_ivas->hIsmMetaData[ch]->angle[1].azimuth_diff_cnt = ISM_FEC_MAX - 2; + st_ivas->hIsmMetaData[ch]->angle[1].last_elevation_idx = 0; + st_ivas->hIsmMetaData[ch]->angle[1].elevation_diff_cnt = ISM_FEC_MAX - 2; +#else st_ivas->hIsmMetaData[ch]->last_azimuth_idx = 0; st_ivas->hIsmMetaData[ch]->azimuth_diff_cnt = ISM_FEC_MAX; st_ivas->hIsmMetaData[ch]->last_elevation_idx = 0; st_ivas->hIsmMetaData[ch]->elevation_diff_cnt = ISM_FEC_MAX - 1; +#endif st_ivas->hIsmMetaData[ch]->last_ism_metadata_flag = 0; ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); + +#ifdef DISCRETE_ISM_DTX_CNG + st_ivas->hIsmMetaData[ch]->last_azimuth = 0.0f; + st_ivas->hIsmMetaData[ch]->last_elevation = 0.0f; +#endif } if ( ( error = ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, nchan_transport, n_ISms, NULL, NULL, NULL, element_brate_tmp, NULL, NULL ) ) != IVAS_ERR_OK ) @@ -787,3 +957,507 @@ ivas_error ivas_ism_metadata_enc_create( return IVAS_ERR_OK; } + + +#ifdef TD5 +/*------------------------------------------------------------------------- + * encode_radius() + * + * Radius index encoding + *-------------------------------------------------------------------------*/ + +static void encode_radius( + BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ + int16_t *last_radius_idx, /* i/o: last radius index */ + int16_t *radius_diff_cnt, /* i/o: radius diff coding counter */ + const int16_t last_ism_metadata_flag, /* last frame ism_metadata_flag */ + const int16_t idx_radius_abs, /* i : Azimuth index */ + int16_t *flag_abs_radius /* o : Radius encoding mode */ +) +{ + int16_t idx_radius, nbits_diff_radius, diff; + + idx_radius = idx_radius_abs; + nbits_diff_radius = 0; + *flag_abs_radius = 0; /* differential coding by default */ + + if ( *radius_diff_cnt == ISM_FEC_MAX /* make differential encoding in ISM_FEC_MAX consecutive frames at maximum (in order to control the decoding in FEC) */ + || last_ism_metadata_flag == 0 /* If last frame had no metadata coded, do not use differential coding */ + ) + { + *flag_abs_radius = 1; + } + + diff = idx_radius_abs - *last_radius_idx; + + /* try differential coding */ + if ( *flag_abs_radius == 0 ) + { + if ( diff == 0 ) + { + idx_radius = 0; + nbits_diff_radius = 1; + } + else if ( ABSVAL( diff ) <= ISM_MAX_RADIUS_DIFF_IDX ) + { + idx_radius = 1 << 1; + nbits_diff_radius = 1; + + if ( diff < 0 ) + { + idx_radius += 1; /* negative sign */ + diff *= -1; + } + else + { + idx_radius += 0; /* positive sign */ + } + + idx_radius = idx_radius << diff; + nbits_diff_radius++; + + /* unary coding of "diff */ + idx_radius += ( ( 1 << diff ) - 1 ); + nbits_diff_radius += diff; + + if ( nbits_diff_radius < ISM_RADIUS_NBITS ) + { + /* add stop bit */ + idx_radius = idx_radius << 1; + nbits_diff_radius++; + } + } + else + { + *flag_abs_radius = 1; + } + } + + /* update counter */ + if ( *flag_abs_radius == 0 ) + { + ( *radius_diff_cnt )++; + *radius_diff_cnt = min( *radius_diff_cnt, ISM_FEC_MAX ); + } + else + { + *radius_diff_cnt = 0; + } + + /* Write radius */ + push_indice( hBstr, IND_ISM_RADIUS_DIFF_FLAG, *flag_abs_radius, 1 ); + + if ( *flag_abs_radius ) + { + push_indice( hBstr, IND_ISM_RADIUS, idx_radius, ISM_RADIUS_NBITS ); + } + else + { + push_indice( hBstr, IND_ISM_RADIUS, idx_radius, nbits_diff_radius ); + } + + /* Updates */ + *last_radius_idx = idx_radius_abs; + + return; +} + + +/*----------------------------------------------------------------* + * encode_angle_indices() + * + * Encoding of an angle + *----------------------------------------------------------------*/ + +static void encode_angle_indices( + BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ + ISM_METADATA_ANGLE_HANDLE angle, /* i/o: angle handle */ + const int16_t last_ism_metadata_flag, /* i : last frame ism_metadata_flag */ + const int16_t ini_frame, /* i : initialization frames counter */ + const int16_t idx_azimuth_abs, /* i : Azimuth index */ + const int16_t idx_elevation_abs, /* i : Elevation index */ + int16_t *flag_abs_azimuth, /* o : Azimuth encoding mode */ + int16_t *flag_abs_elevation /* o : Elevation encoding mode */ +) +{ + int16_t idx_azimuth, nbits_diff_azimuth, diff; + int16_t idx_elevation, nbits_diff_elevation; + + /*----------------------------------------------------------------* + * Azimuth index encoding + *----------------------------------------------------------------*/ + + idx_azimuth = idx_azimuth_abs; + + nbits_diff_azimuth = 0; + + *flag_abs_azimuth = 0; /* differential coding by default */ + if ( angle->azimuth_diff_cnt == ISM_FEC_MAX /* make differential encoding in ISM_FEC_MAX consecutive frames at maximum (in order to control the decoding in FEC) */ + || last_ism_metadata_flag == 0 /* If last frame had no metadata coded, do not use differential coding */ + ) + { + *flag_abs_azimuth = 1; + } + + /* try differential coding */ + if ( *flag_abs_azimuth == 0 ) + { + diff = idx_azimuth_abs - angle->last_azimuth_idx; + + /* azimuth is on a circle - check for diff coding for -180° -> 180° and vice versa changes */ + if ( abs( diff ) > ( ( 1 << ISM_AZIMUTH_NBITS ) - 1 ) - ISM_MAX_AZIMUTH_DIFF_IDX ) + { + if ( diff > 0 ) + { + diff -= ( 1 << ISM_AZIMUTH_NBITS ) - 1; + } + else + { + diff += ( 1 << ISM_AZIMUTH_NBITS ) - 1; + } + } + + if ( diff == 0 ) + { + idx_azimuth = 0; + nbits_diff_azimuth = 1; + } + else if ( ABSVAL( diff ) < ISM_MAX_AZIMUTH_DIFF_IDX ) /* when diff bits >= abs bits, prefer abs */ + { + idx_azimuth = 1 << 1; + nbits_diff_azimuth = 1; + + if ( diff < 0 ) + { + idx_azimuth += 1; /* negative sign */ + diff *= -1; + } + else + { + idx_azimuth += 0; /* positive sign */ + } + + idx_azimuth = idx_azimuth << diff; + nbits_diff_azimuth++; + + /* unary coding of "diff */ + idx_azimuth += ( ( 1 << diff ) - 1 ); + nbits_diff_azimuth += diff; + + if ( nbits_diff_azimuth < ISM_AZIMUTH_NBITS - 1 ) + { + /* add stop bit - only for codewords shorter than ISM_AZIMUTH_NBITS */ + idx_azimuth = idx_azimuth << 1; + nbits_diff_azimuth++; + } + } + else + { + *flag_abs_azimuth = 1; + } + } + + /* update counter */ + if ( *flag_abs_azimuth == 0 ) + { + angle->azimuth_diff_cnt++; + angle->elevation_diff_cnt = min( angle->elevation_diff_cnt, ISM_FEC_MAX ); + } + else + { + angle->azimuth_diff_cnt = 0; + } + + /* Write azimuth */ + push_indice( hBstr, IND_ISM_AZIMUTH_DIFF_FLAG, *flag_abs_azimuth, 1 ); + + if ( *flag_abs_azimuth ) + { + push_indice( hBstr, IND_ISM_AZIMUTH, idx_azimuth, ISM_AZIMUTH_NBITS ); + } + else + { + push_indice( hBstr, IND_ISM_AZIMUTH, idx_azimuth, nbits_diff_azimuth ); + } + + /*----------------------------------------------------------------* + * Elevation index encoding + *----------------------------------------------------------------*/ + + idx_elevation = idx_elevation_abs; + nbits_diff_elevation = 0; + *flag_abs_elevation = 0; /* differential coding by default */ + if ( angle->elevation_diff_cnt == ISM_FEC_MAX /* make differential encoding in ISM_FEC_MAX consecutive frames at maximum (in order to control the decoding in FEC) */ + || last_ism_metadata_flag == 0 /* If last frame had no metadata coded, do not use differential coding */ + ) + { + *flag_abs_elevation = 1; + } + + /* note: elevation is coded starting from the second frame only (it is meaningless in the init_frame) */ + if ( ini_frame == 0 ) + { + *flag_abs_elevation = 1; + angle->last_elevation_idx = idx_elevation_abs; + } + + diff = idx_elevation_abs - angle->last_elevation_idx; + + /* avoid absolute coding of elevation if absolute coding was already used for azimuth */ + if ( *flag_abs_azimuth == 1 ) + { + int16_t diff_orig = diff; + + *flag_abs_elevation = 0; + + + if ( diff >= 0 ) + { + diff = min( diff, ISM_MAX_ELEVATION_DIFF_IDX ); + } + else + { + diff = -1 * min( -diff, ISM_MAX_ELEVATION_DIFF_IDX ); + } + + if ( last_ism_metadata_flag == 0 || abs( diff_orig - diff ) > ISM_MAX_ELEVATION_DIFF_IDX ) + { + angle->elevation_diff_cnt = ISM_FEC_MAX - 1; + } + } + + /* try differential coding */ + if ( *flag_abs_elevation == 0 ) + { + if ( diff == 0 ) + { + idx_elevation = 0; + nbits_diff_elevation = 1; + } + else if ( ABSVAL( diff ) <= ISM_MAX_ELEVATION_DIFF_IDX ) + { + idx_elevation = 1 << 1; + nbits_diff_elevation = 1; + + if ( diff < 0 ) + { + idx_elevation += 1; /* negative sign */ + diff *= -1; + } + else + { + idx_elevation += 0; /* positive sign */ + } + + idx_elevation = idx_elevation << diff; + nbits_diff_elevation++; + + /* unary coding of "diff */ + idx_elevation += ( ( 1 << diff ) - 1 ); + nbits_diff_elevation += diff; + + if ( nbits_diff_elevation < ISM_ELEVATION_NBITS ) + { + /* add stop bit */ + idx_elevation = idx_elevation << 1; + nbits_diff_elevation++; + } + } + else + { + *flag_abs_elevation = 1; + } + } + + /* update counter */ + if ( *flag_abs_elevation == 0 ) + { + angle->elevation_diff_cnt++; + angle->elevation_diff_cnt = min( angle->elevation_diff_cnt, ISM_FEC_MAX ); + } + else + { + angle->elevation_diff_cnt = 0; + } + + /* Write elevation */ + if ( *flag_abs_azimuth == 0 ) /* do not write "flag_abs_elevation" if "flag_abs_azimuth == 1" */ + { + push_indice( hBstr, IND_ISM_ELEVATION_DIFF_FLAG, *flag_abs_elevation, 1 ); + } + + if ( *flag_abs_elevation ) + { + push_indice( hBstr, IND_ISM_ELEVATION, idx_elevation, ISM_ELEVATION_NBITS ); + } + else + { + push_indice( hBstr, IND_ISM_ELEVATION, idx_elevation, nbits_diff_elevation ); + } + + /*----------------------------------------------------------------* + * Updates + *----------------------------------------------------------------*/ + + angle->last_azimuth_idx = idx_azimuth_abs; + angle->last_elevation_idx = idx_elevation_abs; + + return; +} +#endif + + +#ifdef DISCRETE_ISM_DTX_CNG +/*-------------------------------------------------------------------* + * ivas_ism_metadata_sid_enc() + * + * Quantize and encode ISM metadata in SID frame + *-------------------------------------------------------------------*/ + +void ivas_ism_metadata_sid_enc( + ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ + const int16_t flag_noisy_speech, /* i : noisy speech flag */ + const int16_t nchan_ism, /* i : number of objects */ + const int16_t nchan_transport, /* i : number of transport channels */ + const ISM_MODE ism_mode, /* i : ISM mode */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + const int16_t sid_flag, /* i : indication of SID frame */ + const int16_t md_diff_flag[], /* i : metadata differental flag */ + BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ + int16_t nb_bits_metadata[] /* o : number of metadata bits */ +) +{ + int16_t i, ch, nBits, nBits_start, nBits_unused; + float q_step, q_step_border; + int16_t idx, idx_azimuth, idx_elevation; + int16_t nBits_azimuth, nBits_elevation, nBits_coh, nBits_sce_id; + float valQ; + ISM_METADATA_HANDLE hIsmMetaData; + + if ( sid_flag ) + { + nBits = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC; + nBits -= SID_FORMAT_NBITS; + nBits_start = hBstr->nb_bits_tot; + + /*----------------------------------------------------------------* + * Write ISm common signaling + *----------------------------------------------------------------*/ + + /* write number of objects - unary coding */ + for ( ch = 1; ch < nchan_ism; ch++ ) + { + push_indice( hBstr, IND_ISM_NUM_OBJECTS, 1, 1 ); + } + push_indice( hBstr, IND_ISM_NUM_OBJECTS, 0, 1 ); + + /* write SID metadata flag (one per object) */ + for ( ch = 0; ch < nchan_ism; ch++ ) + { + push_indice( hBstr, IND_ISM_METADATA_FLAG, md_diff_flag[ch], 1 ); + } + + /*----------------------------------------------------------------* + * Set quantization bits based on the number of coded objects + *----------------------------------------------------------------*/ + + ivas_get_ism_sid_quan_bitbudget( nchan_ism, &nBits_azimuth, &nBits_elevation, &q_step, &q_step_border, &nBits_coh, &nBits_sce_id ); + + /*----------------------------------------------------------------* + * Spatial parameters, loop over TCs - 1 + *----------------------------------------------------------------*/ + + /* write ISM mode flag to explicitly signal number of spatial parameters */ + if ( nchan_ism > 2 ) + { + if ( ism_mode == ISM_MODE_DISC ) + { + push_indice( hBstr, IND_ISM_VAD_FLAG, 0, 1 ); + } + else + { + push_indice( hBstr, IND_ISM_VAD_FLAG, 1, 1 ); + } + + if ( ism_mode == ISM_MODE_PARAM ) + { + /* write noisy speech flag */ + push_indice( hBstr, IND_ISM_NOISY_SPEECH_FLAG, flag_noisy_speech, 1 ); + nBits_sce_id = 1; + } + } + + if ( nchan_transport > 1 ) + { + /* write sce id */ + push_indice( hBstr, IND_ISM_SCE_ID_DTX, hISMDTX->sce_id_dtx, nBits_sce_id ); + + /* quantize and write coherence */ + for ( ch = 0; ch < nchan_transport; ch++ ) + { + if ( ch == hISMDTX->sce_id_dtx ) + { + continue; + } + + idx = (int16_t) ( hISMDTX->coh[ch] * ( ( 1 << nBits_coh ) - 1 ) + 0.5f ); + assert( ( idx >= 0 ) && ( idx <= ( ( 1 << nBits_coh ) - 1 ) ) ); + push_indice( hBstr, IND_ISM_DTX_COH_SCA, idx, nBits_coh ); + } + } + + /*----------------------------------------------------------------* + * Metadata quantization and coding, loop over all objects + *----------------------------------------------------------------*/ + + for ( ch = 0; ch < nchan_ism; ch++ ) + { + if ( md_diff_flag[ch] == 1 ) + { + hIsmMetaData = hIsmMeta[ch]; + + idx_azimuth = ism_quant_meta( hIsmMetaData->azimuth, &valQ, ism_azimuth_borders, q_step, q_step_border, 1 << nBits_azimuth ); + idx_elevation = ism_quant_meta( hIsmMetaData->elevation, &valQ, ism_elevation_borders, q_step, q_step_border, 1 << nBits_elevation ); + + push_indice( hBstr, IND_ISM_AZIMUTH, idx_azimuth, nBits_azimuth ); + push_indice( hBstr, IND_ISM_ELEVATION, idx_elevation, nBits_elevation ); + + /* update last indexes to correspond to active frames coding */ + if ( nBits_azimuth > ISM_AZIMUTH_NBITS ) + { +#ifdef TD5 + hIsmMetaData->angle[0].last_azimuth_idx = idx_azimuth >> ( nBits_azimuth - ISM_AZIMUTH_NBITS ); + hIsmMetaData->angle[0].last_elevation_idx = idx_elevation >> ( nBits_elevation - ISM_ELEVATION_NBITS ); +#else + hIsmMetaData->last_azimuth_idx = idx_azimuth >> ( nBits_azimuth - ISM_AZIMUTH_NBITS ); + hIsmMetaData->last_elevation_idx = idx_elevation >> ( nBits_elevation - ISM_ELEVATION_NBITS ); +#endif + } + else + { +#ifdef TD5 + hIsmMetaData->angle[0].last_azimuth_idx = idx_azimuth << ( ISM_AZIMUTH_NBITS - nBits_azimuth ); + hIsmMetaData->angle[0].last_elevation_idx = idx_elevation << ( ISM_ELEVATION_NBITS - nBits_elevation ); +#else + hIsmMetaData->last_azimuth_idx = idx_azimuth << ( ISM_AZIMUTH_NBITS - nBits_azimuth ); + hIsmMetaData->last_elevation_idx = idx_elevation << ( ISM_ELEVATION_NBITS - nBits_elevation ); +#endif + } + } + } + + /* Write unused (padding) bits */ + nBits_unused = nBits - hBstr->nb_bits_tot; + while ( nBits_unused > 0 ) + { + i = min( nBits_unused, 16 ); + push_indice( hBstr, IND_UNUSED, 0, i ); + nBits_unused -= i; + } + + nb_bits_metadata[0] = hBstr->nb_bits_tot - nBits_start; + } + + return; +} +#endif diff --git a/lib_enc/ivas_ism_param_enc.c b/lib_enc/ivas_ism_param_enc.c index ef66df5a90..63c1fcea81 100644 --- a/lib_enc/ivas_ism_param_enc.c +++ b/lib_enc/ivas_ism_param_enc.c @@ -47,16 +47,27 @@ static void ivas_param_ism_compute_obj_parameters( +#ifdef NCHAN_ISM_PARAMETER + const int16_t nchan_ism, /* i : number of ISM channels */ +#endif float reference_power_obj[MAX_NUM_OBJECTS][PARAM_ISM_MDFT_NO_SLOTS][DIRAC_NO_FB_BANDS_MAX], /* i : Reference power */ PARAM_ISM_CONFIG_HANDLE hParamIsm /* i/o: Param ISM Enc Handle */ ) { +#ifdef NCHAN_ISM_PARAMETER + int16_t i, b, m, br, mr; +#else int16_t i, b, m, br, mr, num_obj; +#endif int16_t brange_start, brange_end, mrange_start, mrange_end, time_merge_fac; float power_ratios_m[MAX_PARAM_ISM_NBANDS][MAX_PARAM_ISM_NBLOCKS]; +#ifdef NCHAN_ISM_PARAMETER + assert( nchan_ism == 3 || nchan_ism == 4 ); +#else num_obj = hParamIsm->num_obj; assert( num_obj == 3 || num_obj == 4 ); +#endif for ( b = 0; b < hParamIsm->nbands; b++ ) { @@ -81,7 +92,11 @@ static void ivas_param_ism_compute_obj_parameters( /* for each object, sum up reference power within current T/F tile */ +#ifdef NCHAN_ISM_PARAMETER + for ( i = 0; i < nchan_ism; i++ ) +#else for ( i = 0; i < num_obj; i++ ) +#endif { for ( mr = mrange_start; mr < mrange_end; mr++ ) { @@ -103,7 +118,12 @@ static void ivas_param_ism_compute_obj_parameters( index_1 = 1; index_2 = 0; } - for ( i = 2; i < num_obj; i++ ) + +#ifdef NCHAN_ISM_PARAMETER + for ( i = MAX_PARAM_ISM_WAVE; i < nchan_ism; i++ ) +#else + for ( i = MAX_PARAM_ISM_WAVE; i < num_obj; i++ ) +#endif { if ( ref_power_local[i] > ref_power_local[index_1] ) { @@ -149,23 +169,36 @@ static void ivas_param_ism_compute_obj_parameters( static void ivas_param_ism_enc_quantize_DOA( +#ifdef NCHAN_ISM_PARAMETER + const int16_t nchan_ism, /* i : number of ISM channels */ +#endif ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS], /* i : ISM metadata */ PARAM_ISM_CONFIG_HANDLE hParamIsm /* i/o: Param ISM encoder handle */ ) { +#ifdef NCHAN_ISM_PARAMETER + int16_t i, azi_idx, ele_idx; +#else int16_t i, azi_idx, ele_idx, num_obj; +#endif float valQ; +#ifndef NCHAN_ISM_PARAMETER num_obj = hParamIsm->num_obj; +#endif /* Loop over objects */ +#ifdef NCHAN_ISM_PARAMETER + for ( i = 0; i < nchan_ism; i++ ) +#else for ( i = 0; i < num_obj; i++ ) +#endif { /* Quantize the elevation and obtain quantized elevation value and index */ - ele_idx = ism_quant_meta( hIsmMetaData[i]->elevation, &valQ, ism_elevation_borders, 1 << ISM_ELEVATION_NBITS ); + ele_idx = ism_quant_meta( hIsmMetaData[i]->elevation, &valQ, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ); /* Obtain the index of quantized azimuth values */ - azi_idx = ism_quant_meta( hIsmMetaData[i]->azimuth, &valQ, ism_azimuth_borders, 1 << ISM_AZIMUTH_NBITS ); + azi_idx = ism_quant_meta( hIsmMetaData[i]->azimuth, &valQ, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ); /*Replace azimuth with quantized values */ hIsmMetaData[i]->azimuth = valQ; @@ -191,7 +224,11 @@ void ivas_param_ism_stereo_dmx( const int16_t input_frame /* i : Length of input frame */ ) { +#ifdef NCHAN_ISM_PARAMETER + int16_t i, j; +#else int16_t i, j, num_obj; +#endif float alpha, azi_shift, tmp, tmp_1; float cardioid_left[MAX_NUM_OBJECTS], cardioid_right[MAX_NUM_OBJECTS]; float stereo_dmx[2][L_FRAME48k]; @@ -202,14 +239,20 @@ void ivas_param_ism_stereo_dmx( /*Initialization*/ alpha = 0.5; azi_shift = 0; +#ifndef NCHAN_ISM_PARAMETER num_obj = st_ivas->hDirAC->hParamIsm->num_obj; +#endif /* Set the stereo dmx to zero */ set_zero( stereo_dmx[0], L_FRAME48k ); set_zero( stereo_dmx[1], L_FRAME48k ); /* Loop over all objects */ +#ifdef NCHAN_ISM_PARAMETER + for ( i = 0; i < st_ivas->hEncoderConfig->nchan_ism; i++ ) +#else for ( i = 0; i < num_obj; i++ ) +#endif { hIsmMetaData = st_ivas->hIsmMetaData[i]; @@ -271,8 +314,10 @@ ivas_error ivas_param_ism_enc_open( input_Fs = st_ivas->hEncoderConfig->input_Fs; +#ifndef NCHAN_ISM_PARAMETER /* Assign the number of objects */ hDirAC->hParamIsm->num_obj = st_ivas->hEncoderConfig->nchan_inp; +#endif /* set FB config. */ if ( ( error = ivas_fb_set_cfg( &fb_cfg, ISM_FORMAT, SBA_MODE_NONE, st_ivas->hEncoderConfig->nchan_inp, 0, 0, input_Fs ) ) != IVAS_ERR_OK ) @@ -281,16 +326,16 @@ ivas_error ivas_param_ism_enc_open( } /* Allocate and initialize FB mixer handle */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), input_Fs, fb_cfg, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) -#endif { return error; } +#ifdef NCHAN_ISM_PARAMETER + ivas_param_ism_config( hDirAC->hParamIsm, st_ivas->hEncoderConfig->nchan_inp ); +#else ivas_param_ism_config( hDirAC->hParamIsm ); +#endif /* Assign memories for Band and Block grouping */ hDirAC->hParamIsm->nbands = MAX_PARAM_ISM_NBANDS; @@ -316,27 +361,29 @@ ivas_error ivas_param_ism_enc_open( /*-------------------------------------------------------------------------* * ivas_param_ism_enc_close() * - * Close Param ISM handle + * Close Param ISM encoder handle *-------------------------------------------------------------------------*/ void ivas_param_ism_enc_close( - DIRAC_ENC_HANDLE hDirAC, /* i/o: encoder DirAC handle */ - const int32_t input_Fs /* i : input sampling_rate */ + DIRAC_ENC_HANDLE *hDirAC, /* i/o: encoder DirAC handle */ + const int32_t input_Fs /* i : input sampling_rate */ ) { -#ifdef SBA_BR_SWITCHING_CLEAN_UP - ivas_FB_mixer_close( &hDirAC->hFbMixer, input_Fs, 0 ); -#else - ivas_FB_mixer_close( &hDirAC->hFbMixer, input_Fs ); -#endif + if ( hDirAC == NULL || *hDirAC == NULL ) + { + return; + } - if ( hDirAC->hParamIsm != NULL ) + ivas_FB_mixer_close( &( *hDirAC )->hFbMixer, input_Fs, 0 ); + + if ( ( *hDirAC )->hParamIsm != NULL ) { - free( hDirAC->hParamIsm ); - hDirAC->hParamIsm = NULL; + free( ( *hDirAC )->hParamIsm ); + ( *hDirAC )->hParamIsm = NULL; } - free( hDirAC ); + free( ( *hDirAC ) ); + ( *hDirAC ) = NULL; return; } @@ -355,6 +402,9 @@ void ivas_param_ism_enc( ) { int16_t i, j, ts, l_ts; +#ifdef NCHAN_ISM_PARAMETER + int16_t nchan_ism; +#endif int16_t num_time_slots; float *pcm_in[MAX_NUM_OBJECTS]; float fb_RealBuffer[MAX_NUM_OBJECTS][DIRAC_NO_FB_BANDS_MAX]; @@ -365,6 +415,9 @@ void ivas_param_ism_enc( DIRAC_ENC_HANDLE hDirAC; PARAM_ISM_CONFIG_HANDLE hParamIsm; +#ifdef NCHAN_ISM_PARAMETER + nchan_ism = st_ivas->hEncoderConfig->nchan_ism; +#endif hDirAC = st_ivas->hDirAC; hParamIsm = hDirAC->hParamIsm; @@ -373,7 +426,11 @@ void ivas_param_ism_enc( l_ts = input_frame / PARAM_ISM_MDFT_NO_SLOTS; num_time_slots = PARAM_ISM_MDFT_NO_SLOTS; +#ifdef NCHAN_ISM_PARAMETER + for ( i = 0; i < nchan_ism; i++ ) +#else for ( i = 0; i < hParamIsm->num_obj; i++ ) +#endif { pcm_in[i] = &data[i][0]; @@ -382,12 +439,18 @@ void ivas_param_ism_enc( p_fb_RealBuffer[i] = &fb_RealBuffer[i][0]; p_fb_ImagBuffer[i] = &fb_ImagBuffer[i][0]; } + for ( ts = 0; ts < num_time_slots; ts++ ) { ivas_fb_mixer_get_windowed_fr( hDirAC->hFbMixer, pcm_in, p_fb_RealBuffer, p_fb_ImagBuffer, l_ts, l_ts ); + ivas_fb_mixer_update_prior_input( hDirAC->hFbMixer, pcm_in, l_ts ); +#ifdef NCHAN_ISM_PARAMETER + for ( i = 0; i < nchan_ism; i++ ) +#else for ( i = 0; i < hParamIsm->num_obj; i++ ) +#endif { pcm_in[i] += l_ts; for ( j = 0; j < DIRAC_NO_FB_BANDS_MAX; j++ ) @@ -396,18 +459,27 @@ void ivas_param_ism_enc( } } } + /* Quantize DOAs */ +#ifdef NCHAN_ISM_PARAMETER + ivas_param_ism_enc_quantize_DOA( nchan_ism, st_ivas->hIsmMetaData, hParamIsm ); +#else ivas_param_ism_enc_quantize_DOA( st_ivas->hIsmMetaData, hParamIsm ); +#endif /* Compute object indices and power ratios */ +#ifdef NCHAN_ISM_PARAMETER + ivas_param_ism_compute_obj_parameters( nchan_ism, reference_power_obj, hParamIsm ); +#else ivas_param_ism_compute_obj_parameters( reference_power_obj, hParamIsm ); +#endif pop_wmops(); return; } -#ifdef PARAM_ISM_DTX_CNG +#ifndef DISCRETE_ISM_DTX_CNG static void ivas_param_ism_enc_quantize_DOA_dtx( float azimuth, float elevation, @@ -474,10 +546,14 @@ static void ivas_param_ism_enc_quantize_DOA_dtx( *-------------------------------------------------------------------------*/ void ivas_param_ism_metadata_dtx_enc( - BSTR_ENC_HANDLE hBstr, /* i/o : bitstream handle */ - ISM_METADATA_HANDLE hIsmMeta[], /* i : ISM metadata handles */ - ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ - PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Enc Handle */ + BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ + ISM_METADATA_HANDLE hIsmMeta[], /* i : ISM metadata handles */ + ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ + PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Enc Handle */ +#ifdef NCHAN_ISM_PARAMETER + , + const int16_t nchan_ism /* i : number of ISM channels */ +#endif ) { int16_t i, nBits, nBits_unused; @@ -489,7 +565,11 @@ void ivas_param_ism_metadata_dtx_enc( /* Transmit the metadata */ /* write number of objects - unary coding */ +#ifdef NCHAN_ISM_PARAMETER + for ( i = 0; i < nchan_ism; i++ ) +#else for ( i = 1; i < hParamIsm->num_obj; i++ ) +#endif { push_indice( hBstr, IND_ISM_NUM_OBJECTS, 1, 1 ); } @@ -506,7 +586,11 @@ void ivas_param_ism_metadata_dtx_enc( assert( ( coh_idx >= 0 ) && ( coh_idx <= ( ( 1 << PARAM_ISM_DTX_COH_SCA_BITS ) - 1 ) ) ); push_indice( hBstr, IND_ISM_DTX_COH_SCA, coh_idx, PARAM_ISM_DTX_COH_SCA_BITS ); +#ifdef NCHAN_ISM_PARAMETER + for ( i = 0; i < nchan_ism; i++ ) +#else for ( i = 0; i < hParamIsm->num_obj; i++ ) +#endif { ivas_param_ism_enc_quantize_DOA_dtx( hIsmMeta[i]->azimuth, hIsmMeta[i]->elevation, PARAM_ISM_DTX_AZI_BITS, PARAM_ISM_DTX_ELE_BITS, &azi_idx, &ele_idx ); push_indice( hBstr, IND_ISM_AZIMUTH, azi_idx, PARAM_ISM_DTX_AZI_BITS ); @@ -532,7 +616,7 @@ void ivas_param_ism_metadata_dtx_enc( return; } - +#endif /*-------------------------------------------------------------------* * ivas_param_ism_compute_noisy_speech_flag() @@ -580,4 +664,3 @@ void ivas_param_ism_compute_noisy_speech_flag( return; } -#endif diff --git a/lib_enc/ivas_lfe_enc.c b/lib_enc/ivas_lfe_enc.c index fe2e0d3c02..a14424774f 100644 --- a/lib_enc/ivas_lfe_enc.c +++ b/lib_enc/ivas_lfe_enc.c @@ -98,11 +98,7 @@ static void ivas_lfe_enc_quant( BSTR_ENC_HANDLE hBstr ) { int16_t bits_written; -#ifdef IND_LIST_DYN - int16_t nb_ind_tot; -#else int16_t next_ind_pos; -#endif uint16_t quant_strategy, write_bit; int16_t num_quant_strategies; int16_t shift_bits; @@ -121,11 +117,7 @@ static void ivas_lfe_enc_quant( num_quant_strategies = IVAS_MAX_NUM_QUANT_STRATS; shift_bits = IVAS_LFE_SHIFT_BITS; bits_written = hBstr->nb_bits_tot; -#ifdef IND_LIST_DYN - nb_ind_tot = hBstr->nb_ind_tot; -#else next_ind_pos = hBstr->next_ind; -#endif for ( quant_strategy = 0; quant_strategy < num_quant_strategies; quant_strategy++ ) @@ -251,11 +243,7 @@ static void ivas_lfe_enc_quant( } bits_written_arith_enc = hBstr->nb_bits_tot; -#ifdef IND_LIST_DYN - next_ind_pos_arith_enc = hBstr->nb_ind_tot; -#else next_ind_pos_arith_enc = hBstr->next_ind; -#endif push_next_indice( hBstr, coding_strategy, 1 ); base2_num_bits_tot = hBstr->nb_bits_tot - bits_written; @@ -271,24 +259,13 @@ static void ivas_lfe_enc_quant( { if ( quant_strategy == ( num_quant_strategies - 1 ) || ( ( target_bits + IVAS_LFE_ID_BITS ) >= base2_num_bits_tot ) ) { -#ifdef IND_LIST_DYN - /* reset bits buffer and code the indices with base 2 coding */ - for ( j = hBstr->nb_ind_tot - 1; j >= next_ind_pos_arith_enc; j-- ) - { - hBstr->ind_list[j].nb_bits = -1; - } - hBstr->nb_ind_tot = next_ind_pos_arith_enc; -#else /* reset bits buffer and code the indices with base 2 coding */ for ( j = hBstr->next_ind - 1; j >= next_ind_pos_arith_enc; j-- ) { hBstr->ind_list[j].nb_bits = -1; } -#endif hBstr->nb_bits_tot = bits_written_arith_enc; -#ifndef IND_LIST_DYN hBstr->next_ind = next_ind_pos_arith_enc; -#endif coding_strategy = 1; push_next_indice( hBstr, coding_strategy, 1 ); @@ -321,21 +298,13 @@ static void ivas_lfe_enc_quant( if ( quant_strategy < ( num_quant_strategies - 1 ) ) { /* reset all indices that were already written - TODO: maybe better store them temporarily first and write at the very end? */ -#ifdef IND_LIST_DYN - for ( j = hBstr->nb_ind_tot - 1; j >= nb_ind_tot; j-- ) -#else for ( j = hBstr->next_ind - 1; j >= next_ind_pos; j-- ) -#endif { hBstr->ind_list[j].nb_bits = -1; } hBstr->nb_bits_tot = bits_written; -#ifdef IND_LIST_DYN - hBstr->nb_ind_tot = nb_ind_tot; -#else hBstr->next_ind = next_ind_pos; -#endif } } } @@ -491,21 +460,27 @@ ivas_error ivas_create_lfe_enc( *-------------------------------------------------------------------------*/ void ivas_lfe_enc_close( - LFE_ENC_HANDLE hLFE /* i/o: LFE encoder handle */ + LFE_ENC_HANDLE *hLFE /* i/o: LFE encoder handle */ ) { - if ( hLFE->old_wtda_audio != NULL ) + if ( hLFE == NULL || *hLFE == NULL ) + { + return; + } + + if ( ( *hLFE )->old_wtda_audio != NULL ) { - free( hLFE->old_wtda_audio ); - hLFE->old_wtda_audio = NULL; + free( ( *hLFE )->old_wtda_audio ); + ( *hLFE )->old_wtda_audio = NULL; } - if ( hLFE->pWindow_state ) + if ( ( *hLFE )->pWindow_state ) { - free( hLFE->pWindow_state ); - hLFE->pWindow_state = NULL; + free( ( *hLFE )->pWindow_state ); + ( *hLFE )->pWindow_state = NULL; } - free( hLFE ); + free( ( *hLFE ) ); + ( *hLFE ) = NULL; return; } diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index eb685cd0bc..337753925c 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -149,7 +149,7 @@ ivas_error ivas_masa_enc_open( *-----------------------------------------------------------------------*/ void ivas_masa_enc_close( - MASA_ENCODER_HANDLE hMasa /* i/o: MASA metadata structure */ + MASA_ENCODER_HANDLE *hMasa /* i/o: MASA metadata structure */ #ifndef FIX_350_MASA_DELAY_COMP , const int16_t nchan_transport, /* i : Number of transport channels */ @@ -159,9 +159,14 @@ void ivas_masa_enc_close( { int16_t i; - for ( i = 0; i < hMasa->data.num_Cldfb_instances; i++ ) + if ( hMasa == NULL || *hMasa == NULL ) + { + return; + } + + for ( i = 0; i < ( *hMasa )->data.num_Cldfb_instances; i++ ) { - deleteCldfb( &( hMasa->data.cldfbAnaEnc[i] ) ); + deleteCldfb( &( ( *hMasa )->data.cldfbAnaEnc[i] ) ); } #ifndef FIX_350_MASA_DELAY_COMP @@ -169,13 +174,14 @@ void ivas_masa_enc_close( { for ( i = 0; i < nchan_transport; i++ ) { - free( hMasa->data.delay_buffer[i] ); - hMasa->data.delay_buffer[i] = NULL; + free( ( *hMasa )->data.delay_buffer[i] ); + ( *hMasa )->data.delay_buffer[i] = NULL; } } #endif - free( hMasa ); + free( ( *hMasa ) ); + ( *hMasa ) = NULL; return; } @@ -589,7 +595,11 @@ ivas_error ivas_masa_enc_config( ivas_set_qmetadata_maxbit_req( hQMetaData, ivas_format ); +#ifdef FIX_373_MASA_DELAY_COMP_MSAN + masa_sample_rate_band_correction( &( hMasa->config ), hMasa->data.band_mapping, hQMetaData, st_ivas->hEncoderConfig->input_Fs, NULL ); +#else masa_sample_rate_band_correction( &( hMasa->config ), hMasa->data.band_mapping, hQMetaData, st_ivas->hEncoderConfig->input_Fs ); +#endif /* Transmit stereo signals using a mono downmix at lowest bitrates */ if ( ivas_format == MASA_FORMAT && st_ivas->nCPE == 1 && st_ivas->hCPE[0]->hStereoDft != NULL && st_ivas->hCPE[0]->hStereoDft->hConfig != NULL ) @@ -1698,9 +1708,6 @@ void ivas_masa_enc_reconfigure( int16_t n, tmp; int16_t sce_id, cpe_id; int32_t ivas_total_brate; -#ifdef IND_LIST_DYN - int16_t max_num_indices_metadata; -#endif ivas_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; @@ -1711,21 +1718,6 @@ void ivas_masa_enc_reconfigure( copy_encoder_config( st_ivas, st_ivas->hSCE[sce_id]->hCoreCoder[0], 0 ); st_ivas->hSCE[sce_id]->element_brate = ivas_total_brate / st_ivas->nchan_transport; st_ivas->hSCE[sce_id]->hCoreCoder[0]->total_brate = st_ivas->hSCE[sce_id]->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ - -#ifdef IND_LIST_DYN - if ( st_ivas->hSCE[sce_id]->hMetaData != NULL ) - { - /* get the maximum allowed number of indices in the list */ - max_num_indices_metadata = get_max_num_indices_metadata( st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); - - /* check, if the maximum number of allowed indices has changed */ - if ( max_num_indices_metadata != st_ivas->hSCE[sce_id]->hMetaData->max_num_indices ) - { - /* re-allocate the list of metadata indices */ - ind_list_realloc( st_ivas->hSCE[sce_id]->hMetaData, max_num_indices_metadata ); - } - } -#endif } for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) @@ -1737,21 +1729,6 @@ void ivas_masa_enc_reconfigure( { copy_encoder_config( st_ivas, st_ivas->hCPE[cpe_id]->hCoreCoder[n], 0 ); st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ - -#ifdef IND_LIST_DYN - if ( st_ivas->hCPE[cpe_id]->hMetaData != NULL ) - { - /* get the maximum allowed number of indices in the list */ - max_num_indices_metadata = get_max_num_indices_metadata( st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); - - /* check, if the maximum number of allowed indices has changed */ - if ( max_num_indices_metadata != st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices ) - { - /* re-allocate the list of metadata indices */ - ind_list_realloc( st_ivas->hCPE[cpe_id]->hMetaData, max_num_indices_metadata ); - } - } -#endif } if ( ivas_total_brate < MASA_STEREO_MIN_BITRATE ) diff --git a/lib_enc/ivas_mc_param_enc.c b/lib_enc/ivas_mc_param_enc.c index 9b1241f234..db9945d0ce 100644 --- a/lib_enc/ivas_mc_param_enc.c +++ b/lib_enc/ivas_mc_param_enc.c @@ -146,11 +146,7 @@ ivas_error ivas_param_mc_enc_open( } /* Allocate and initialize FB mixer handle */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &( hParamMC->hFbMixer ), input_Fs, fb_cfg, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_FB_mixer_open( &( hParamMC->hFbMixer ), input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -364,18 +360,20 @@ ivas_error ivas_param_mc_enc_reconfig( *------------------------------------------------------------------------*/ void ivas_param_mc_enc_close( - PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ + PARAM_MC_ENC_HANDLE *hParamMC, /* i/o: Parametric MC encoder handle */ const int32_t sampling_rate ) { - ivas_param_mc_metadata_close( &hParamMC->hMetadataPMC ); + if ( hParamMC == NULL || *hParamMC == NULL ) + { + return; + } -#ifdef SBA_BR_SWITCHING_CLEAN_UP - ivas_FB_mixer_close( &hParamMC->hFbMixer, sampling_rate, 0 ); -#else - ivas_FB_mixer_close( &hParamMC->hFbMixer, sampling_rate ); -#endif + ivas_param_mc_metadata_close( &( *hParamMC )->hMetadataPMC ); + + ivas_FB_mixer_close( &( *hParamMC )->hFbMixer, sampling_rate, 0 ); - free( hParamMC ); + free( ( *hParamMC ) ); + ( *hParamMC ) = NULL; return; } @@ -388,10 +386,10 @@ void ivas_param_mc_enc_close( *------------------------------------------------------------------------*/ void ivas_param_mc_enc( - Encoder_Struct *st_ivas, /* i/o: IVAS Encoder handle */ - BSTR_ENC_HANDLE hMetaData, /* i/o: IVAS Metadata bitstream handle */ - float data_f[][L_FRAME48k], /* i/o: input: CICP6, CICP12, CICP14, CICP16 or CICP19 MC data */ - const int16_t input_frame /* i : input frame length */ + Encoder_Struct *st_ivas, /* i/o: IVAS Encoder handle */ + BSTR_ENC_HANDLE hMetaData, /* i/o: IVAS Metadata bitstream handle */ + float data_f[][L_FRAME48k], /* i/o: input: CICP6, CICP12, CICP14, CICP16 or CICP19 MC data */ + const int16_t input_frame /* i : input frame length */ ) { int16_t k; diff --git a/lib_enc/ivas_mcmasa_enc.c b/lib_enc/ivas_mcmasa_enc.c index 153bc3ecad..866e4e176c 100644 --- a/lib_enc/ivas_mcmasa_enc.c +++ b/lib_enc/ivas_mcmasa_enc.c @@ -194,11 +194,7 @@ ivas_error ivas_mcmasa_enc_open( } /* Allocate and initialize FB mixer handle */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &( hMcMasa->hFbMixer ), input_Fs, fb_cfg, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_FB_mixer_open( &( hMcMasa->hFbMixer ), input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -228,11 +224,7 @@ ivas_error ivas_mcmasa_enc_open( return error; } -#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &( hMcMasa->hFbMixerLfe ), input_Fs, fb_cfgLfe, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_FB_mixer_open( &( hMcMasa->hFbMixerLfe ), input_Fs, fb_cfgLfe ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -459,11 +451,11 @@ ivas_error ivas_mcmasa_enc_reconfig( /* brute-force solution: close McMASA and re-instantiate with new settings */ #ifdef FIX_350_MASA_DELAY_COMP - ivas_masa_enc_close( st_ivas->hMasa ); + ivas_masa_enc_close( &( st_ivas->hMasa ) ); #else - ivas_masa_enc_close( st_ivas->hMasa, st_ivas->nchan_transport, st_ivas->hEncoderConfig->ivas_format ); + ivas_masa_enc_close( &( st_ivas->hMasa ), st_ivas->nchan_transport, st_ivas->hEncoderConfig->ivas_format ); #endif - ivas_mcmasa_enc_close( st_ivas->hMcMasa, st_ivas->hEncoderConfig->input_Fs ); + ivas_mcmasa_enc_close( &( st_ivas->hMcMasa ), st_ivas->hEncoderConfig->input_Fs ); /* Determine if to separate some channels from the analysis */ ivas_mcmasa_setNumTransportChannels( &( st_ivas->nchan_transport ), &( st_ivas->hEncoderConfig->element_mode_init ), ivas_total_brate ); @@ -491,36 +483,33 @@ ivas_error ivas_mcmasa_enc_reconfig( *--------------------------------------------------------------------------*/ void ivas_mcmasa_enc_close( - MCMASA_ENC_HANDLE hMcMasa, /* i/o: encoder McMASA handle */ - const int32_t input_Fs /* i : input sampling rate */ + MCMASA_ENC_HANDLE *hMcMasa, /* i/o: encoder McMASA handle */ + const int32_t input_Fs /* i : input sampling rate */ ) { int16_t i, j; - if ( hMcMasa->separateChannelEnabled ) + if ( hMcMasa == NULL || *hMcMasa == NULL ) { - free( hMcMasa->delay_buffer_lfe[0] ); - free( hMcMasa->delay_buffer_lfe[1] ); + return; + } + + if ( ( *hMcMasa )->separateChannelEnabled ) + { + free( ( *hMcMasa )->delay_buffer_lfe[0] ); + free( ( *hMcMasa )->delay_buffer_lfe[1] ); for ( i = 0; i < 2; i++ ) { - free( hMcMasa->lfeAnaRingBuffer[i] ); + free( ( *hMcMasa )->lfeAnaRingBuffer[i] ); } } -#ifdef SBA_BR_SWITCHING_CLEAN_UP - ivas_FB_mixer_close( &hMcMasa->hFbMixer, input_Fs, 0 ); -#else - ivas_FB_mixer_close( &hMcMasa->hFbMixer, input_Fs ); -#endif + ivas_FB_mixer_close( &( *hMcMasa )->hFbMixer, input_Fs, 0 ); - if ( !hMcMasa->separateChannelEnabled ) + if ( !( *hMcMasa )->separateChannelEnabled ) { -#ifdef SBA_BR_SWITCHING_CLEAN_UP - ivas_FB_mixer_close( &hMcMasa->hFbMixerLfe, input_Fs, 0 ); -#else - ivas_FB_mixer_close( &hMcMasa->hFbMixerLfe, input_Fs ); -#endif + ivas_FB_mixer_close( &( *hMcMasa )->hFbMixerLfe, input_Fs, 0 ); } /* intensity 3-dim */ @@ -528,35 +517,36 @@ void ivas_mcmasa_enc_close( { for ( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) { - free( hMcMasa->direction_vector_m[i][j] ); - hMcMasa->direction_vector_m[i][j] = NULL; + free( ( *hMcMasa )->direction_vector_m[i][j] ); + ( *hMcMasa )->direction_vector_m[i][j] = NULL; } - for ( j = 0; j < hMcMasa->no_col_avg_diff; j++ ) + for ( j = 0; j < ( *hMcMasa )->no_col_avg_diff; j++ ) { - free( hMcMasa->buffer_intensity_real[i][j] ); - hMcMasa->buffer_intensity_real[i][j] = NULL; + free( ( *hMcMasa )->buffer_intensity_real[i][j] ); + ( *hMcMasa )->buffer_intensity_real[i][j] = NULL; } - free( hMcMasa->buffer_intensity_real[i] ); - hMcMasa->buffer_intensity_real[i] = NULL; + free( ( *hMcMasa )->buffer_intensity_real[i] ); + ( *hMcMasa )->buffer_intensity_real[i] = NULL; - free( hMcMasa->direction_vector_m[i] ); - hMcMasa->direction_vector_m[i] = NULL; + free( ( *hMcMasa )->direction_vector_m[i] ); + ( *hMcMasa )->direction_vector_m[i] = NULL; } - for ( j = 0; j < hMcMasa->no_col_avg_diff; j++ ) + for ( j = 0; j < ( *hMcMasa )->no_col_avg_diff; j++ ) { - free( hMcMasa->buffer_intensity_real_vert[j] ); - hMcMasa->buffer_intensity_real_vert[j] = NULL; + free( ( *hMcMasa )->buffer_intensity_real_vert[j] ); + ( *hMcMasa )->buffer_intensity_real_vert[j] = NULL; } - free( hMcMasa->buffer_intensity_real_vert ); - hMcMasa->buffer_intensity_real_vert = NULL; + free( ( *hMcMasa )->buffer_intensity_real_vert ); + ( *hMcMasa )->buffer_intensity_real_vert = NULL; - free( hMcMasa->buffer_energy ); - hMcMasa->buffer_energy = NULL; + free( ( *hMcMasa )->buffer_energy ); + ( *hMcMasa )->buffer_energy = NULL; - free( hMcMasa ); + free( ( *hMcMasa ) ); + ( *hMcMasa ) = NULL; return; } diff --git a/lib_enc/ivas_mct_enc.c b/lib_enc/ivas_mct_enc.c index 707e74e329..b66a2c5733 100644 --- a/lib_enc/ivas_mct_enc.c +++ b/lib_enc/ivas_mct_enc.c @@ -173,8 +173,7 @@ ivas_error ivas_mct_enc( } /* joint MCT encoding */ - ivas_mct_core_enc( ivas_format, hMCT, st_ivas->hCPE, hMCT->nchan_out_woLFE + hMCT->num_lfe, ivas_total_brate, switch_bw, - ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCT ) ? (int16_t) st_ivas->hLFE->lfe_bits : 0, st_ivas->hEncoderConfig->sba_order ); + ivas_mct_core_enc( ivas_format, hMCT, st_ivas->hCPE, hMCT->nchan_out_woLFE + hMCT->num_lfe, ivas_total_brate, switch_bw, ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCT ) ? (int16_t) st_ivas->hLFE->lfe_bits : 0, st_ivas->hEncoderConfig->sba_order ); /* Spectrum quantization and coding */ for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) @@ -499,29 +498,35 @@ ivas_error mct_enc_reconfigure( *-------------------------------------------------------------------------*/ void ivas_mct_enc_close( - MCT_ENC_HANDLE hMCT /* i/o: MCT encoder structure */ + MCT_ENC_HANDLE *hMCT /* i/o: MCT encoder structure */ ) { int16_t n, maxBlocks; - maxBlocks = hMCT->nchan_out_woLFE / 2; + if ( hMCT == NULL || *hMCT == NULL ) + { + return; + } + + maxBlocks = ( *hMCT )->nchan_out_woLFE / 2; for ( n = 0; n < maxBlocks; n++ ) { - if ( hMCT->hBlockData[n] != NULL ) + if ( ( *hMCT )->hBlockData[n] != NULL ) { - if ( hMCT->hBlockData[n]->hStereoMdct != NULL ) + if ( ( *hMCT )->hBlockData[n]->hStereoMdct != NULL ) { - free( hMCT->hBlockData[n]->hStereoMdct ); - hMCT->hBlockData[n]->hStereoMdct = NULL; + free( ( *hMCT )->hBlockData[n]->hStereoMdct ); + ( *hMCT )->hBlockData[n]->hStereoMdct = NULL; } - free( hMCT->hBlockData[n] ); - hMCT->hBlockData[n] = NULL; + free( ( *hMCT )->hBlockData[n] ); + ( *hMCT )->hBlockData[n] = NULL; } } - free( hMCT ); + free( ( *hMCT ) ); + ( *hMCT ) = NULL; return; } @@ -608,34 +613,18 @@ static ivas_error ivas_mc_enc_reconfig( } /*De-allocate handles for other MC modes*/ - if ( st_ivas->hParamMC != NULL ) - { - ivas_param_mc_enc_close( st_ivas->hParamMC, st_ivas->hEncoderConfig->input_Fs ); - st_ivas->hParamMC = NULL; - } + ivas_param_mc_enc_close( &( st_ivas->hParamMC ), st_ivas->hEncoderConfig->input_Fs ); /* De-allocate McMasa-related handles */ - if ( st_ivas->hMcMasa != NULL ) - { - ivas_mcmasa_enc_close( st_ivas->hMcMasa, st_ivas->hEncoderConfig->input_Fs ); - st_ivas->hMcMasa = NULL; - } + ivas_mcmasa_enc_close( &( st_ivas->hMcMasa ), st_ivas->hEncoderConfig->input_Fs ); - if ( st_ivas->hMasa != NULL ) - { #ifdef FIX_350_MASA_DELAY_COMP - ivas_masa_enc_close( st_ivas->hMasa ); + ivas_masa_enc_close( &( st_ivas->hMasa ) ); #else - ivas_masa_enc_close( st_ivas->hMasa, nchan_transport_old, MC_FORMAT ); + ivas_masa_enc_close( &( st_ivas->hMasa ), nchan_transport_old, MC_FORMAT ); #endif - st_ivas->hMasa = NULL; - } - if ( st_ivas->hQMetaData != NULL ) - { - ivas_qmetadata_close( &st_ivas->hQMetaData ); - st_ivas->hQMetaData = NULL; - } + ivas_qmetadata_close( &st_ivas->hQMetaData ); } } else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) @@ -656,39 +645,30 @@ static ivas_error ivas_mc_enc_reconfig( } /* De-allocate McMasa-related handles */ - if ( st_ivas->hMcMasa != NULL ) - { - ivas_mcmasa_enc_close( st_ivas->hMcMasa, st_ivas->hEncoderConfig->input_Fs ); - st_ivas->hMcMasa = NULL; - } + ivas_mcmasa_enc_close( &( st_ivas->hMcMasa ), st_ivas->hEncoderConfig->input_Fs ); + if ( st_ivas->hMasa != NULL ) { #ifdef FIX_350_MASA_DELAY_COMP - ivas_masa_enc_close( st_ivas->hMasa ); + ivas_masa_enc_close( &( st_ivas->hMasa ) ); #else - ivas_masa_enc_close( st_ivas->hMasa, nchan_transport_old, MC_FORMAT ); + ivas_masa_enc_close( &( st_ivas->hMasa ), nchan_transport_old, MC_FORMAT ); #endif st_ivas->hMasa = NULL; } - if ( st_ivas->hQMetaData != NULL ) - { - ivas_qmetadata_close( &st_ivas->hQMetaData ); - st_ivas->hQMetaData = NULL; - } + ivas_qmetadata_close( &st_ivas->hQMetaData ); /* De-allocate MCT handle if last mode was MCT */ - if ( last_mc_mode == MC_MODE_MCT && st_ivas->hMCT != NULL && st_ivas->nchan_transport <= CPE_CHANNELS ) + if ( last_mc_mode == MC_MODE_MCT && st_ivas->nchan_transport <= CPE_CHANNELS ) { - ivas_mct_enc_close( st_ivas->hMCT ); - st_ivas->hMCT = NULL; + ivas_mct_enc_close( &( st_ivas->hMCT ) ); } if ( last_mc_mode == MC_MODE_MCT && st_ivas->hLFE != NULL ) { /* LFE handle */ - ivas_lfe_enc_close( st_ivas->hLFE ); - st_ivas->hLFE = NULL; + ivas_lfe_enc_close( &( st_ivas->hLFE ) ); } } else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) @@ -721,26 +701,14 @@ static ivas_error ivas_mc_enc_reconfig( } } - if ( st_ivas->hParamMC != NULL ) - { - ivas_param_mc_enc_close( st_ivas->hParamMC, st_ivas->hEncoderConfig->input_Fs ); - st_ivas->hParamMC = NULL; - } + ivas_param_mc_enc_close( &( st_ivas->hParamMC ), st_ivas->hEncoderConfig->input_Fs ); if ( last_mc_mode == MC_MODE_MCT ) { /* LFE handle */ - if ( st_ivas->hLFE != NULL ) - { - ivas_lfe_enc_close( st_ivas->hLFE ); - st_ivas->hLFE = NULL; - } + ivas_lfe_enc_close( &( st_ivas->hLFE ) ); - if ( st_ivas->hMCT != NULL ) - { - ivas_mct_enc_close( st_ivas->hMCT ); - st_ivas->hMCT = NULL; - } + ivas_mct_enc_close( &( st_ivas->hMCT ) ); } } diff --git a/lib_enc/ivas_mdct_core_enc.c b/lib_enc/ivas_mdct_core_enc.c index 626dcf2631..ef9264d5df 100644 --- a/lib_enc/ivas_mdct_core_enc.c +++ b/lib_enc/ivas_mdct_core_enc.c @@ -686,6 +686,7 @@ void ivas_mdct_core_whitening_enc( core_signal_analysis_high_bitrate( new_samples[ch] + L_INP_MEM, T_op[ch], NULL, NULL, st, mdst_spectrum[ch], tnsSize[ch], tnsBits[ch], param_core[ch], <pBits[ch], windowedSignal[ch], st->L_frame, st->hTcxEnc->L_frameTCX, hCPE->last_element_mode, 0 ); /* BWD in MDCT domain */ +#ifndef FIX_MDCT_BASED_BWD if ( st->hTcxEnc->transform_type[0] == TCX_20 && st->hTcxCfg->tcx_last_overlap_mode != TRANSITION_OVERLAP ) { if ( st->mct_chan_mode != MCT_CHAN_MODE_LFE ) @@ -693,6 +694,22 @@ void ivas_mdct_core_whitening_enc( bw_detect( st, NULL, st->hTcxEnc->spectrum[0], NULL ); } } +#else + if ( st->mct_chan_mode != MCT_CHAN_MODE_LFE && st->hTcxCfg->tcx_last_overlap_mode != TRANSITION_OVERLAP ) + { + nSubframes = ( st->hTcxEnc->tcxMode == TCX_20 ) ? 1 : NB_DIV; + + for ( n = 0; n < nSubframes; n++ ) + { + bw_detect( st, NULL, st->hTcxEnc->spectrum[n], NULL, mct_on ); + + if ( nSubframes == NB_DIV && n == 0 ) + { + st->last_input_bwidth = st->input_bwidth; + } + } + } +#endif if ( st->last_core == ACELP_CORE ) /* reset past kernel info */ { diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 97bc34a9cb..ac4f83a657 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -130,10 +130,7 @@ ivas_error ivas_qmetadata_enc_encode( ) { int16_t i, bit_pos_start, bit_pos_start_coh; - int16_t next_ind_start; -#ifndef IND_LIST_DYN - int16_t last_ind_start; -#endif + int16_t next_ind_start, last_ind_start; uint16_t diffuseness_index_max_ec_frame; uint16_t diffuseness_index_max_ec_frame_pre[QMETADATA_MAX_NO_DIRECTIONS]; int16_t bits_dir_raw_pre[QMETADATA_MAX_NO_DIRECTIONS]; @@ -406,12 +403,8 @@ ivas_error ivas_qmetadata_enc_encode( /* Save state of metadata bitstream buffer after writing energy ratios, number of dirs and save space for coherence*/ bit_pos_start = hMetaData->nb_bits_tot; -#ifdef IND_LIST_DYN - next_ind_start = hMetaData->nb_ind_tot; -#else next_ind_start = hMetaData->next_ind; last_ind_start = hMetaData->last_ind; -#endif /* Encode quantized directions with EC frame-wise*/ if ( total_bits_1dir + bits_surround_coh <= hQMetaData->qmetadata_max_bit_req ) @@ -420,11 +413,7 @@ ivas_error ivas_qmetadata_enc_encode( bits_signaling[d]++; } -#ifdef IND_LIST_DYN - next_ind_raw_flag = hMetaData->nb_ind_tot; -#else next_ind_raw_flag = hMetaData->next_ind; -#endif push_next_indice( hMetaData, 0, 1 ); /* Raw coding flag*/ bits_dir_bands[0] = ivas_qmetadata_raw_encode_dir( NULL, q_direction, q_direction->cfg.nbands, q_direction->cfg.start_band ); @@ -456,11 +445,7 @@ ivas_error ivas_qmetadata_enc_encode( /* Encode quantized directions with EC band-wise */ if ( ( total_bits_1dir + bits_surround_coh <= hQMetaData->qmetadata_max_bit_req ) && ( bits_dir[d] + bits_diff[d] + bits_coherence[d] + bits_signaling[d] > total_bits_1dir ) && q_direction->cfg.nblocks > 1 ) { - restore_metadata_buffer( hMetaData, next_ind_start, -#ifndef IND_LIST_DYN - last_ind_start, -#endif - bit_pos_start ); + restore_metadata_buffer( hMetaData, next_ind_start, last_ind_start, bit_pos_start ); /* Write signaling */ push_next_indice( hMetaData, 1, 1 ); /*Write 1 bit to signal no EC frame-wise (EC1)*/ @@ -468,11 +453,7 @@ ivas_error ivas_qmetadata_enc_encode( bits_signaling[d] = 3; /* Write raw flags */ -#ifdef IND_LIST_DYN - next_ind_raw_flag = hMetaData->nb_ind_tot; -#else next_ind_raw_flag = hMetaData->next_ind; -#endif for ( i = start_band; i < nbands; i++ ) { push_next_indice( hMetaData, 0, 1 ); /* Raw coding flag*/ @@ -541,11 +522,7 @@ ivas_error ivas_qmetadata_enc_encode( /*Bit budget exceeded, bit reduction strategy?*/ extra_bits = 0; - restore_metadata_buffer( hMetaData, next_ind_start, -#ifndef IND_LIST_DYN - last_ind_start, -#endif - bit_pos_start ); + restore_metadata_buffer( hMetaData, next_ind_start, last_ind_start, bit_pos_start ); push_next_indice( hMetaData, 1, 1 ); /*Write 1 bit to signal no EC frame-wise (EC1)*/ if ( nblocks > 1 ) @@ -931,19 +908,15 @@ void ivas_qmetadata_enc_sid_encode( void reset_metadata_spatial( const IVAS_FORMAT ivas_format, /* i : IVAS format */ - BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ + BSTR_ENC_HANDLE hMetaData, /* i/o: Metadata bitstream handle */ const int32_t element_brate, /* i : element bitrate */ int32_t *total_brate, /* o : total bitrate */ const int32_t core_brate, /* i : core bitrate */ - const int16_t nb_bits_metadata, /* i : number of metadata bits */ + const int16_t nb_bits_metadata, /* i : number of meatdata bits */ const SBA_MODE sba_mode /* i : SBA mode */ ) { int16_t i, next_ind_sid, last_ind_sid; -#ifdef IND_LIST_DYN - int16_t j; -#endif - int16_t metadata_sid_bits; if ( core_brate == SID_2k40 || core_brate == FRAME_NO_DATA ) @@ -952,9 +925,7 @@ void reset_metadata_spatial( { if ( sba_mode == SBA_MODE_SPAR ) { -#ifdef DEBUGGING assert( hMetaData->ind_list[0].nb_bits == 1 ); -#endif hMetaData->ind_list[0].value = 1; metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS; while ( hMetaData->nb_bits_tot < metadata_sid_bits ) @@ -965,22 +936,15 @@ void reset_metadata_spatial( else { /* Reset metadata and keep only SID metadata*/ -#ifdef IND_LIST_DYN - last_ind_sid = hMetaData->nb_ind_tot; - next_ind_sid = hMetaData->nb_ind_tot; -#else last_ind_sid = hMetaData->next_ind; next_ind_sid = hMetaData->next_ind; -#endif while ( hMetaData->nb_bits_tot > nb_bits_metadata ) { next_ind_sid--; hMetaData->nb_bits_tot -= hMetaData->ind_list[next_ind_sid].nb_bits; } -#ifndef IND_LIST_DYN hMetaData->next_ind = 0; -#endif hMetaData->nb_bits_tot = 0; for ( i = 0; i < next_ind_sid; i++ ) @@ -988,17 +952,6 @@ void reset_metadata_spatial( hMetaData->ind_list[i].nb_bits = -1; } -#ifdef IND_LIST_DYN - for ( j = 0, i = next_ind_sid; i < last_ind_sid; i++, j++ ) - { - hMetaData->ind_list[j].value = hMetaData->ind_list[i].value; - hMetaData->ind_list[j].nb_bits = hMetaData->ind_list[i].nb_bits; - hMetaData->nb_bits_tot += hMetaData->ind_list[j].nb_bits; - hMetaData->ind_list[i].nb_bits = -1; - } - - hMetaData->nb_ind_tot = j; -#else for ( i = next_ind_sid; i < last_ind_sid; i++ ) { hMetaData->ind_list[hMetaData->next_ind].value = hMetaData->ind_list[i].value; @@ -1007,20 +960,13 @@ void reset_metadata_spatial( hMetaData->next_ind++; hMetaData->ind_list[i].nb_bits = -1; } - hMetaData->last_ind = hMetaData->next_ind; -#endif -#ifdef DEBUGGING assert( ( hMetaData->nb_bits_tot == ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS ) && "Problem of SID metadata in SCE" ); -#endif } } else { /*Reset metadata*/ -#ifdef IND_LIST_DYN - reset_indices_enc( hMetaData, hMetaData->max_num_indices ); -#else for ( i = 0; i < hMetaData->next_ind; i++ ) { hMetaData->ind_list[i].nb_bits = -1; @@ -1028,7 +974,6 @@ void reset_metadata_spatial( hMetaData->nb_bits_tot = 0; hMetaData->next_ind = 0; hMetaData->last_ind = 0; -#endif } *total_brate = element_brate; @@ -1038,22 +983,12 @@ void reset_metadata_spatial( /* Reset SID metadata bits*/ while ( hMetaData->nb_bits_tot > nb_bits_metadata ) { -#ifdef IND_LIST_DYN - hMetaData->nb_ind_tot--; - hMetaData->nb_bits_tot -= hMetaData->ind_list[hMetaData->nb_ind_tot].nb_bits; - hMetaData->ind_list[hMetaData->nb_ind_tot].nb_bits = -1; -#else hMetaData->next_ind--; hMetaData->nb_bits_tot -= hMetaData->ind_list[hMetaData->next_ind].nb_bits; hMetaData->ind_list[hMetaData->next_ind].nb_bits = -1; -#endif } -#ifdef DEBUGGING assert( hMetaData->nb_bits_tot == nb_bits_metadata && "Problem in metadata for SCE" ); -#endif -#ifndef IND_LIST_DYN hMetaData->last_ind = hMetaData->next_ind; -#endif } return; @@ -1559,34 +1494,24 @@ static int16_t ivas_qmetadata_entropy_encode_df_ratio( /*------------------------------------------------------------------------- * restore_metadata_buffer() * - * Restore metadata buffer + * Reset metadata buffer *------------------------------------------------------------------------*/ void restore_metadata_buffer( BSTR_ENC_HANDLE hMetaData, const int16_t next_ind_start, -#ifndef IND_LIST_DYN const int16_t last_ind_start, -#endif const int16_t bit_pos_start ) { int16_t i; -#ifdef IND_LIST_DYN - for ( i = next_ind_start; i <= hMetaData->nb_ind_tot; i++ ) -#else for ( i = next_ind_start; i <= hMetaData->next_ind; i++ ) -#endif { hMetaData->ind_list[i].nb_bits = -1; } hMetaData->nb_bits_tot = bit_pos_start; -#ifdef IND_LIST_DYN - hMetaData->nb_ind_tot = next_ind_start; -#else hMetaData->next_ind = next_ind_start; hMetaData->last_ind = last_ind_start; -#endif return; } @@ -4776,11 +4701,7 @@ static int16_t ivas_qmetadata_quantize_coherence( else { /* write dummy data now and save the position */ -#ifdef IND_LIST_DYN - *indice_coherence = hMetaData->nb_ind_tot; -#else *indice_coherence = hMetaData->next_ind; -#endif k = nbits; while ( k > 0 ) { diff --git a/lib_enc/ivas_sba_enc.c b/lib_enc/ivas_sba_enc.c index e878d74183..d3aab0a6e8 100644 --- a/lib_enc/ivas_sba_enc.c +++ b/lib_enc/ivas_sba_enc.c @@ -120,14 +120,10 @@ ivas_error ivas_sba_enc_reconfigure( DIRAC_ENC_HANDLE hDirAC = st_ivas->hDirAC; SPAR_ENC_HANDLE hSpar; SBA_MODE sba_mode_old; -#ifdef SBA_HPF_TUNING_ENC int16_t analysis_order_old; -#endif -#ifdef SBA_BR_SWITCHING_CLEAN_UP int16_t spar_reconfig_flag; spar_reconfig_flag = 0; -#endif nchan_transport_old = st_ivas->nchan_transport; nCPE_old = st_ivas->nCPE; nSCE_old = st_ivas->nSCE; @@ -136,7 +132,6 @@ ivas_error ivas_sba_enc_reconfigure( st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, hEncoderConfig->sba_order ); st_ivas->sba_mode = ivas_sba_mode_select( ivas_total_brate ); -#ifdef SBA_HPF_TUNING_ENC analysis_order_old = ivas_sba_get_analysis_order( hEncoderConfig->last_ivas_total_brate, hEncoderConfig->sba_order ); if ( analysis_order_old != st_ivas->sba_analysis_order ) @@ -204,17 +199,12 @@ ivas_error ivas_sba_enc_reconfigure( old_mem_hp20_in = NULL; } } -#endif if ( st_ivas->sba_mode == SBA_MODE_SPAR ) { if ( st_ivas->hSpar == NULL ) { -#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_spar_enc_open( st_ivas, spar_reconfig_flag ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_spar_enc_open( st_ivas ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -223,7 +213,6 @@ ivas_error ivas_sba_enc_reconfigure( ivas_spar_config( ivas_total_brate, min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ), &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->hSpar->core_nominal_brate, -1 ); -#ifdef SBA_BR_SWITCHING_CLEAN_UP for ( n = 0; n < DIRAC_MAX_ANA_CHANS; n++ ) { if ( hDirAC->sba_synchro_buffer[n] != NULL ) @@ -233,17 +222,10 @@ ivas_error ivas_sba_enc_reconfigure( } } hDirAC->num_samples_synchro_delay = 0; -#endif } else { -#ifdef SBA_BR_SWITCHING_CLEAN_UP - ivas_spar_enc_close( st_ivas->hSpar, hEncoderConfig->input_Fs, hEncoderConfig->nchan_inp, spar_reconfig_flag ); - -#else - ivas_spar_enc_close( st_ivas->hSpar, hEncoderConfig->input_Fs, hEncoderConfig->nchan_inp ); -#endif - st_ivas->hSpar = NULL; + ivas_spar_enc_close( &( st_ivas->hSpar ), hEncoderConfig->input_Fs, hEncoderConfig->nchan_inp, spar_reconfig_flag ); } hSpar = st_ivas->hSpar; @@ -264,68 +246,19 @@ ivas_error ivas_sba_enc_reconfigure( { if ( hDirAC->hFbMixer != NULL ) { -#ifndef SBA_BR_SWITCHING_CLEAN_UP - ivas_FB_mixer_close( &( hDirAC->hFbMixer ), hEncoderConfig->input_Fs ); -#else ivas_FB_mixer_close( &( hDirAC->hFbMixer ), hEncoderConfig->input_Fs, 0 ); -#endif hDirAC->hFbMixer = NULL; } if ( sba_mode_old == SBA_MODE_SPAR ) { -#ifndef SBA_BR_SWITCHING_CLEAN_UP - IVAS_FB_CFG *fb_cfg; - int16_t nchan_internal, sba_order_internal; - int16_t table_idx, active_w_mixing; - - sba_order_internal = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ); - nchan_internal = ivas_sba_get_nchan_metadata( sba_order_internal ); - - /* Covar. State handle */ - ivas_spar_covar_enc_close( &hSpar->hCovEnc, hSpar->hFbMixer->fb_cfg->num_in_chans ); - - /* MD handle */ - ivas_spar_md_enc_close( &hSpar->hMdEnc ); - - if ( ( error = ivas_spar_md_enc_open( &( hSpar->hMdEnc ), hEncoderConfig, sba_order_internal ) ) != IVAS_ERR_OK ) - { - return error; - } - - /*Initialization*/ - hSpar->hMdEnc->table_idx = -1; - - /* FB mixer handle */ - ivas_FB_mixer_close( &hSpar->hFbMixer, hEncoderConfig->input_Fs ); - - table_idx = ivas_get_spar_table_idx( ivas_total_brate, sba_order_internal, SPAR_CONFIG_BW, NULL, NULL ); - active_w_mixing = ivas_spar_br_table_consts[table_idx].active_w; - if ( ( error = ivas_fb_set_cfg( &fb_cfg, SBA_FORMAT, SBA_MODE_SPAR, nchan_internal, st_ivas->nchan_transport, active_w_mixing, hEncoderConfig->input_Fs ) ) != IVAS_ERR_OK ) - { - return error; - } - fb_cfg->remix_order = remix_order_set[hSpar->hMdEnc->spar_md_cfg.remix_unmix_order]; - - if ( ( error = ivas_FB_mixer_open( &( hSpar->hFbMixer ), hEncoderConfig->input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* Covar. State handle */ - if ( ( error = ivas_spar_covar_enc_open( &( hSpar->hCovEnc ), hSpar->hFbMixer->pFb, hEncoderConfig->input_Fs, nchan_internal ) ) != IVAS_ERR_OK ) - { - return error; - } -#else spar_reconfig_flag = 1; - ivas_spar_enc_close( st_ivas->hSpar, hEncoderConfig->input_Fs, hEncoderConfig->nchan_inp, spar_reconfig_flag ); + ivas_spar_enc_close( &( st_ivas->hSpar ), hEncoderConfig->input_Fs, hEncoderConfig->nchan_inp, spar_reconfig_flag ); if ( ( error = ivas_spar_enc_open( st_ivas, spar_reconfig_flag ) ) != IVAS_ERR_OK ) { return error; } -#endif } } else @@ -340,11 +273,7 @@ ivas_error ivas_sba_enc_reconfigure( } /* Allocate and initialize FB mixer handle */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), hEncoderConfig->input_Fs, fb_cfg, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_FB_mixer_open( &( hDirAC->hFbMixer ), hEncoderConfig->input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -368,43 +297,6 @@ ivas_error ivas_sba_enc_reconfigure( } } } -#ifndef SBA_BR_SWITCHING_CLEAN_UP - /* initialize delay for SPAR/DirAC delay synchronization */ - if ( ( st_ivas->sba_mode == SBA_MODE_DIRAC ) && ( ( sba_mode_old != st_ivas->sba_mode ) || ( nchan_transport_old != st_ivas->nchan_transport ) ) ) - { - if ( hDirAC->num_samples_synchro_delay == 0 ) - { - hDirAC->num_samples_synchro_delay = NS2SA( hEncoderConfig->input_Fs, IVAS_FB_ENC_DELAY_NS ); - - for ( n = 0; n < DIRAC_MAX_ANA_CHANS; n++ ) - { - if ( ( hDirAC->sba_synchro_buffer[n] = (float *) malloc( hDirAC->num_samples_synchro_delay * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hDirAC synchro buffer\n" ) ); - } - set_zero( hDirAC->sba_synchro_buffer[n], hDirAC->num_samples_synchro_delay ); - } - for ( ; n < DIRAC_MAX_ANA_CHANS; n++ ) - { - hDirAC->sba_synchro_buffer[n] = NULL; - } - } - } - else - { - for ( n = 0; n < DIRAC_MAX_ANA_CHANS; n++ ) - { - if ( hDirAC->sba_synchro_buffer[n] != NULL ) - { - free( hDirAC->sba_synchro_buffer[n] ); - hDirAC->sba_synchro_buffer[n] = NULL; - } - } - hDirAC->num_samples_synchro_delay = 0; - } - - -#endif } if ( ( error = ivas_dirac_enc_reconfigure( st_ivas ) ) != IVAS_ERR_OK ) diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 03cc8d9028..c8577a85ba 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -180,21 +180,12 @@ ivas_error ivas_sce_enc( * Front Pre-processing *----------------------------------------------------------------*/ -#ifdef LOW_RATE_TRANS_CORE_CODER error = pre_proc_front_ivas( hSCE, NULL, hSCE->element_brate, nb_bits_metadata, input_frame, 0, old_inp_12k8[0], old_inp_16k[0], &ener[0], &relE[0], A[0], Aw[0], epsP[0], lsp_new[0], lsp_mid[0], &vad_hover_flag[0], &attack_flag[0], realBuffer[0], imagBuffer[0], old_wsp[0], pitch_fr[0], voicing_fr[0], &loc_harm[0], &cor_map_sum[0], &vad_flag_dtx[0], enerBuffer[0], fft_buff[0], A[0], lsp_new[0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, flag_16k_smc, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->force_front_vad : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_dtx_flag : 0, st_ivas->hEncoderConfig->ivas_total_brate ); -#else - error = pre_proc_front_ivas( hSCE, NULL, hSCE->element_brate, nb_bits_metadata, input_frame, 0, old_inp_12k8[0], old_inp_16k[0], - &ener[0], &relE[0], A[0], Aw[0], epsP[0], lsp_new[0], lsp_mid[0], - &vad_hover_flag[0], &attack_flag[0], realBuffer[0], imagBuffer[0], old_wsp[0], pitch_fr[0], voicing_fr[0], &loc_harm[0], &cor_map_sum[0], &vad_flag_dtx[0], enerBuffer[0], - fft_buff[0], A[0], lsp_new[0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, flag_16k_smc, - st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->force_front_vad : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_dtx_flag : 0, - st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->hEncoderConfig->ivas_format ); -#endif if ( error != IVAS_ERR_OK ) { return error; @@ -260,10 +251,8 @@ ivas_error ivas_sce_enc( hSCE->last_element_brate = hSCE->element_brate; -#ifdef LOW_RATE_TRANS_CORE_CODER /* Store previous attack detection flag */ st->hTranDet->transientDetector.prev_bIsAttackPresent = st->hTranDet->transientDetector.bIsAttackPresent; -#endif #ifdef DEBUG_MODE_INFO { @@ -323,19 +312,6 @@ ivas_error create_sce_enc( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MetaData structure\n" ) ); } - -#ifdef IND_LIST_DYN - /* set the maximum allowed number of indices in the list */ - hSCE->hMetaData->max_num_indices = get_max_num_indices_metadata( st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); - - /* allocate buffer of metadata indices */ - if ( ( hSCE->hMetaData->ind_list = (INDICE_HANDLE) malloc( hSCE->hMetaData->max_num_indices * sizeof( Indice ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); - } - - reset_indices_enc( hSCE->hMetaData, hSCE->hMetaData->max_num_indices ); -#endif } else { @@ -356,19 +332,7 @@ ivas_error create_sce_enc( st->total_brate = hSCE->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; -#ifdef PARAM_ISM_DTX_CNG - if ( ( error = init_encoder( st, -#ifdef IND_LIST_DYN - st_ivas->hEncoderConfig, -#endif - 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) -#else - if ( ( error = init_encoder( st, -#ifdef IND_LIST_DYN - st_ivas->hEncoderConfig, -#endif - 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0 ) ) != IVAS_ERR_OK ) -#endif + if ( ( error = init_encoder( st, 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) { return error; } @@ -403,12 +367,6 @@ void destroy_sce_enc( if ( hSCE->hMetaData != NULL ) { -#ifdef IND_LIST_DYN - if ( hSCE->hMetaData->ind_list != NULL ) - { - free( hSCE->hMetaData->ind_list ); - } -#endif free( hSCE->hMetaData ); hSCE->hMetaData = NULL; } diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 43058148d4..c659979d2b 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -58,11 +58,8 @@ static ivas_error ivas_spar_enc_process( Encoder_Struct *st_ivas, const ENCODER_ *------------------------------------------------------------------------*/ ivas_error ivas_spar_enc_open( - Encoder_Struct *st_ivas /* i/o: IVAS encoder handle */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP - , + Encoder_Struct *st_ivas, /* i/o: IVAS encoder handle */ const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ -#endif ) { SPAR_ENC_HANDLE hSpar; @@ -75,20 +72,16 @@ ivas_error ivas_spar_enc_open( hEncoderConfig = st_ivas->hEncoderConfig; error = IVAS_ERR_OK; -#ifdef SBA_BR_SWITCHING_CLEAN_UP hSpar = st_ivas->hSpar; if ( !spar_reconfig_flag ) { -#endif /* SPAR encoder handle */ if ( ( hSpar = (SPAR_ENC_HANDLE) malloc( sizeof( SPAR_ENC_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR encoder" ); } -#ifdef SBA_BR_SWITCHING_CLEAN_UP } -#endif input_Fs = hEncoderConfig->input_Fs; sba_order_internal = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ); @@ -113,12 +106,8 @@ ivas_error ivas_spar_enc_open( ivas_fb_set_cfg( &fb_cfg, SBA_FORMAT, SBA_MODE_SPAR, nchan_inp, nchan_transport, active_w_mixing, input_Fs ); fb_cfg->remix_order = remix_order_set[hSpar->hMdEnc->spar_md_cfg.remix_unmix_order]; -/* FB mixer handle */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP + /* FB mixer handle */ if ( ( error = ivas_FB_mixer_open( &( hSpar->hFbMixer ), input_Fs, fb_cfg, spar_reconfig_flag ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_FB_mixer_open( &( hSpar->hFbMixer ), input_Fs, fb_cfg ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -129,18 +118,14 @@ ivas_error ivas_spar_enc_open( return error; } -#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { -#endif /* Transient Detector handle */ if ( ( error = ivas_transient_det_open( &( hSpar->hTranDet ), input_Fs ) ) != IVAS_ERR_OK ) { return error; } -#ifdef SBA_BR_SWITCHING_CLEAN_UP } -#endif /* initialization */ hSpar->hMdEnc->table_idx = -1; @@ -194,10 +179,8 @@ ivas_error ivas_spar_enc_open( * Allocate and initialize Front-VAD handle *-----------------------------------------------------------------*/ -#ifdef SBA_BR_SWITCHING_CLEAN_UP if ( !spar_reconfig_flag ) { -#endif hSpar->front_vad_flag = 0; hSpar->front_vad_dtx_flag = 0; hSpar->force_front_vad = 0; @@ -219,19 +202,7 @@ ivas_error ivas_spar_enc_open( hSpar->hCoreCoderVAD->total_brate = hEncoderConfig->ivas_total_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ hSpar->hCoreCoderVAD->mct_chan_mode = MCT_CHAN_MODE_IGNORE; -#ifdef PARAM_ISM_DTX_CNG - if ( ( error = init_encoder( hSpar->hCoreCoderVAD, -#ifdef IND_LIST_DYN - hEncoderConfig, -#endif - 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) -#else - if ( ( error = init_encoder( hSpar->hCoreCoderVAD, -#ifdef IND_LIST_DYN - hEncoderConfig, -#endif - 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1 ) ) != IVAS_ERR_OK ) -#endif + if ( ( error = init_encoder( hSpar->hCoreCoderVAD, 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) { return error; } @@ -241,9 +212,7 @@ ivas_error ivas_spar_enc_open( hSpar->hCoreCoderVAD = NULL; hSpar->hFrontVad = NULL; } -#ifdef SBA_BR_SWITCHING_CLEAN_UP } -#endif /*-----------------------------------------------------------------* * Final assignment @@ -262,82 +231,67 @@ ivas_error ivas_spar_enc_open( *------------------------------------------------------------------------*/ void ivas_spar_enc_close( - SPAR_ENC_HANDLE hSpar, /* i/o: SPAR encoder handle */ - const int32_t input_Fs, /* i : input sampling rate */ - const int16_t nchan_inp /* i : number of input channels */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP - , + SPAR_ENC_HANDLE *hSpar, /* i/o: SPAR encoder handle */ + const int32_t input_Fs, /* i : input sampling rate */ + const int16_t nchan_inp, /* i : number of input channels */ const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ -#endif ) { int16_t num_chans; - if ( hSpar != NULL ) + if ( hSpar == NULL || *hSpar == NULL ) { -#ifdef SBA_BR_SWITCHING_CLEAN_UP - if ( !spar_reconfig_flag ) - { -#endif - /* core-coder-VAD handle */ - if ( hSpar->hCoreCoderVAD != NULL ) - { - destroy_core_enc( hSpar->hCoreCoderVAD ); - hSpar->hCoreCoderVAD = NULL; - } + return; + } - /* front-VAD handle */ - if ( hSpar->hFrontVad != NULL ) - { - front_vad_destroy( &hSpar->hFrontVad ); - hSpar->hFrontVad = NULL; - } -#ifdef SBA_BR_SWITCHING_CLEAN_UP + if ( !spar_reconfig_flag ) + { + /* core-coder-VAD handle */ + if ( ( *hSpar )->hCoreCoderVAD != NULL ) + { + destroy_core_enc( ( *hSpar )->hCoreCoderVAD ); + ( *hSpar )->hCoreCoderVAD = NULL; } -#endif - num_chans = hSpar->hFbMixer->fb_cfg->num_in_chans; - assert( num_chans <= nchan_inp ); + /* front-VAD handle */ + if ( ( *hSpar )->hFrontVad != NULL ) + { + front_vad_destroy( &( *hSpar )->hFrontVad ); + ( *hSpar )->hFrontVad = NULL; + } + } - /* MD handle */ - ivas_spar_md_enc_close( &hSpar->hMdEnc ); + num_chans = ( *hSpar )->hFbMixer->fb_cfg->num_in_chans; + assert( num_chans <= nchan_inp ); - /* Covar. State handle */ - ivas_spar_covar_enc_close( &hSpar->hCovEnc, num_chans ); + /* MD handle */ + ivas_spar_md_enc_close( &( *hSpar )->hMdEnc ); - /* FB mixer handle */ -#ifdef SBA_BR_SWITCHING_CLEAN_UP - ivas_FB_mixer_close( &hSpar->hFbMixer, input_Fs, spar_reconfig_flag ); -#else - ivas_FB_mixer_close( &hSpar->hFbMixer, input_Fs ); + /* Covar. State handle */ + ivas_spar_covar_enc_close( &( *hSpar )->hCovEnc, num_chans ); - /* Trans Det handle */ - ivas_transient_det_close( &hSpar->hTranDet ); -#endif + /* FB mixer handle */ + ivas_FB_mixer_close( &( *hSpar )->hFbMixer, input_Fs, spar_reconfig_flag ); - /* AGC */ - ivas_spar_agc_enc_close( &hSpar->hAgcEnc ); + /* AGC */ + ivas_spar_agc_enc_close( &( *hSpar )->hAgcEnc ); - /* PCA */ - if ( hSpar->hPCA != NULL ) - { - free( hSpar->hPCA ); - hSpar->hPCA = NULL; - } + /* PCA */ + if ( ( *hSpar )->hPCA != NULL ) + { + free( ( *hSpar )->hPCA ); + ( *hSpar )->hPCA = NULL; + } -#ifdef SBA_BR_SWITCHING_CLEAN_UP - if ( !spar_reconfig_flag ) - { - /* Trans Det handle */ - ivas_transient_det_close( &hSpar->hTranDet ); -#endif - free( hSpar ); - hSpar = NULL; -#ifdef SBA_BR_SWITCHING_CLEAN_UP - } -#endif + if ( !spar_reconfig_flag ) + { + /* Trans Det handle */ + ivas_transient_det_close( &( *hSpar )->hTranDet ); + free( ( *hSpar ) ); + ( *hSpar ) = NULL; } + return; } @@ -438,11 +392,7 @@ static ivas_error ivas_spar_enc_process( float pcm_tmp[IVAS_SPAR_MAX_CH][L_FRAME48k * 2]; float *p_pcm_tmp[IVAS_SPAR_MAX_CH]; int16_t i, j, b, i_ts, input_frame, dtx_vad; -#ifdef SMOOTH_WITH_TRANS_DET int16_t transient_det[2]; -#else - int16_t transient_det; -#endif int32_t ivas_total_brate, input_Fs; float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; float *cov_dtx_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; @@ -485,15 +435,11 @@ static ivas_error ivas_spar_enc_process( * Transient detector *-----------------------------------------------------------------------------------------*/ -#ifdef SMOOTH_WITH_TRANS_DET ivas_transient_det_process( hSpar->hTranDet, data_f[0], input_frame, transient_det ); if ( sba_order == 1 ) { transient_det[1] = transient_det[0]; } -#else - transient_det = ivas_transient_det_process( hSpar->hTranDet, data_f[0], input_frame ); -#endif /* store previous input samples for W in local buffer */ assert( num_del_samples <= IVAS_FB_1MS_48K_SAMP ); diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 6b2492ebb4..645f690ac0 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -225,6 +225,11 @@ void ivas_spar_md_enc_close( int16_t num_channels, i, j; ivas_spar_md_enc_state_t *hMdEnc; + if ( hMdEnc_in == NULL || *hMdEnc_in == NULL ) + { + return; + } + hMdEnc = *hMdEnc_in; num_channels = hMdEnc->num_umx_ch; @@ -250,7 +255,6 @@ void ivas_spar_md_enc_close( { for ( i = 0; i < num_channels; i++ ) { - for ( j = 0; j < num_channels; j++ ) { free( hMdEnc->cov_real[i][j] ); @@ -264,7 +268,6 @@ void ivas_spar_md_enc_close( { for ( i = 0; i < num_channels; i++ ) { - for ( j = 0; j < num_channels; j++ ) { free( hMdEnc->cov_dtx_real[i][j] ); @@ -288,11 +291,8 @@ void ivas_spar_md_enc_close( free( hMdEnc->mixer_mat_local ); } - if ( hMdEnc != NULL ) - { - free( hMdEnc ); - hMdEnc = NULL; - } + free( *hMdEnc_in ); + *hMdEnc_in = NULL; return; } @@ -510,29 +510,17 @@ static void write_metadata_buffer( BSTR_ENC_HANDLE hMetaData_tmp, BSTR_ENC_HANDLE hMetaData, const int16_t bit_pos_start, - const int16_t next_ind_start -#ifndef IND_LIST_DYN - , - const int16_t last_ind_start -#endif -) + const int16_t next_ind_start, + const int16_t last_ind_start ) { int16_t i; if ( hMetaData->nb_bits_tot > 0 ) { - restore_metadata_buffer( hMetaData, next_ind_start, -#ifndef IND_LIST_DYN - last_ind_start, -#endif - bit_pos_start ); + restore_metadata_buffer( hMetaData, next_ind_start, last_ind_start, bit_pos_start ); } -#ifdef IND_LIST_DYN - for ( i = 0; i < hMetaData_tmp->nb_ind_tot; i++ ) -#else for ( i = 0; i < hMetaData_tmp->next_ind; i++ ) -#endif { push_next_indice( hMetaData, hMetaData_tmp->ind_list[i].value, hMetaData_tmp->ind_list[i].nb_bits ); } @@ -568,10 +556,7 @@ ivas_error ivas_spar_md_enc_process( int16_t nB, bands_bw, packed_ok = 0; ivas_strats_t cs[MAX_CODING_STRATS]; int16_t code_strat; - int16_t bit_pos_start, next_ind_start; -#ifndef IND_LIST_DYN - int16_t last_ind_start; -#endif + int16_t bit_pos_start, next_ind_start, last_ind_start; BSTR_ENC_DATA hMetaData_tmp; Indice ind_list_tmp[MAX_BITS_METADATA]; // IVAS_fmToDo: size to be optimized float Wscale[IVAS_MAX_NUM_BANDS]; @@ -624,12 +609,8 @@ ivas_error ivas_spar_md_enc_process( /* Save state of metadata bitstream buffer */ bit_pos_start = hMetaData->nb_bits_tot; -#ifdef IND_LIST_DYN - next_ind_start = hMetaData->nb_ind_tot; -#else next_ind_start = hMetaData->next_ind; last_ind_start = hMetaData->last_ind; -#endif dmx_switch = 0; @@ -890,23 +871,13 @@ ivas_error ivas_spar_md_enc_process( strat = cs[i]; if ( strat != NO_STRAT ) { -#ifdef IND_LIST_DYN - hMetaData_tmp.max_num_indices = MAX_BITS_METADATA; - reset_indices_enc( &hMetaData_tmp, hMetaData_tmp.max_num_indices ); -#else reset_indices_enc( &hMetaData_tmp, MAX_BITS_METADATA ); -#endif ivas_write_spar_md_bitstream( hMdEnc, num_bands, bands_bw, &hMetaData_tmp, hEncoderConfig->ivas_total_brate, strat, qsi, planarCP ); if ( hMetaData->nb_bits_tot == bit_pos_start || hMetaData_tmp.nb_bits_tot < ( hMetaData->nb_bits_tot - bit_pos_start ) ) { - write_metadata_buffer( &hMetaData_tmp, hMetaData, bit_pos_start, next_ind_start -#ifndef IND_LIST_DYN - , - last_ind_start -#endif - ); + write_metadata_buffer( &hMetaData_tmp, hMetaData, bit_pos_start, next_ind_start, last_ind_start ); code_strat = strat; } if ( hMetaData->nb_bits_tot - bit_pos_start + ( ( ( hEncoderConfig->ivas_total_brate == IVAS_256k ) && ( sba_order == SBA_FOA_ORDER ) ) ? 1 : 0 ) <= hMdEnc->spar_md_cfg.tgt_bits_per_blk ) diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index e450990254..a56f6423d3 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -550,7 +550,6 @@ typedef struct ivas_stereo_classifier_data_structure } STEREO_CLASSIF_DATA, *STEREO_CLASSIF_HANDLE; -#ifdef PARAM_ISM_DTX_CNG /*----------------------------------------------------------------------------------* * ISM DTX structure *----------------------------------------------------------------------------------*/ @@ -560,13 +559,16 @@ typedef struct int16_t dtx_flag; int16_t sce_id_dtx; +#ifdef DISCRETE_ISM_DTX_CNG + int16_t cnt_SID_ISM; +#else int16_t dtx_speech_buffer_enc[PARAM_ISM_HYS_BUF_SIZE]; +#endif float long_term_energy_stereo_dmx_enc[MAX_NUM_OBJECTS][PARAM_ISM_HYS_BUF_SIZE]; float coh[MAX_NUM_OBJECTS]; } ISM_DTX_DATA, *ISM_DTX_HANDLE; -#endif /*----------------------------------------------------------------------------------* * Front-VAD structure @@ -1012,9 +1014,15 @@ typedef struct encoder_config_structure int16_t element_mode_init; /* element mode used at initialization */ int16_t stereo_dmx_evs; /* flag to indicate that stereo downmix for EVS encoder */ +#ifdef NCHAN_ISM_PARAMETER + int16_t nchan_ism; /* number of ISM channels */ +#endif int16_t sba_order; /* Ambisonic (SBA) order */ int16_t sba_planar; /* Ambisonic (SBA) planar flag */ MC_LS_SETUP mc_input_setup; /* multichannel input ls setup */ +#ifdef TD5 + int16_t ism_extended_metadata_flag; /* flag indicating extended metadata encoding, including radius and orientation (yaw, pitch) in ISM format */ +#endif int16_t Opt_AMR_WB; /* flag indicating AMR-WB IO mode */ @@ -1071,9 +1079,7 @@ typedef struct /* multichannel modules */ ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS]; /* ISM metadata handles (storage for one frame of read ISM metadata) */ -#ifdef PARAM_ISM_DTX_CNG ISM_DTX_HANDLE hISMDTX; /* ISM DTX handle */ -#endif DIRAC_ENC_HANDLE hDirAC; /* DirAC data handle */ SPAR_ENC_HANDLE hSpar; /* SPAR encoder handle */ MASA_ENCODER_HANDLE hMasa; /* MASA encoder data and configuration */ diff --git a/lib_enc/ivas_stereo_dmx_evs.c b/lib_enc/ivas_stereo_dmx_evs.c index 052970fa70..a5c0fe147f 100644 --- a/lib_enc/ivas_stereo_dmx_evs.c +++ b/lib_enc/ivas_stereo_dmx_evs.c @@ -946,16 +946,22 @@ ivas_error stereo_dmx_evs_init_encoder( *-------------------------------------------------------------------*/ void stereo_dmx_evs_close_encoder( - STEREO_DMX_EVS_ENC_HANDLE hStereoDmxEVS /* i/o: Stereo downmix for EVS encoder handle */ + STEREO_DMX_EVS_ENC_HANDLE *hStereoDmxEVS /* i/o: Stereo downmix for EVS encoder handle */ ) { - if ( hStereoDmxEVS->hPOC != NULL ) + if ( hStereoDmxEVS == NULL || *hStereoDmxEVS == NULL ) { - free( hStereoDmxEVS->hPOC ); - hStereoDmxEVS->hPOC = NULL; + return; } - free( hStereoDmxEVS ); + if ( ( *hStereoDmxEVS )->hPOC != NULL ) + { + free( ( *hStereoDmxEVS )->hPOC ); + ( *hStereoDmxEVS )->hPOC = NULL; + } + + free( ( *hStereoDmxEVS ) ); + ( *hStereoDmxEVS ) = NULL; return; } diff --git a/lib_enc/ivas_stereo_mdct_core_enc.c b/lib_enc/ivas_stereo_mdct_core_enc.c index 047db979e2..9500da4fb9 100644 --- a/lib_enc/ivas_stereo_mdct_core_enc.c +++ b/lib_enc/ivas_stereo_mdct_core_enc.c @@ -116,10 +116,7 @@ static void sync_tcx_mode( *-------------------------------------------------------------------*/ void stereo_mdct_core_enc( - CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ -#ifdef IND_LIST_DYN - const int16_t ivas_format, /* i : IVAS format */ -#endif + CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ float new_samples[CPE_CHANNELS][L_INP], /* i : new samples */ float old_wsp[CPE_CHANNELS][L_WSP], /* i : 12.8kHz weighted speech (for LTP */ float pitch_buf[CPE_CHANNELS][NB_SUBFR16k] /* o : floating pitch for each subframe */ @@ -148,9 +145,6 @@ void stereo_mdct_core_enc( int16_t p_param[CPE_CHANNELS][2]; int16_t stereo_bits; int16_t meta_bits, signal_bits; -#ifdef IND_LIST_DYN - int16_t max_num_indices; -#endif push_wmops( "stereo_mdct_core_enc" ); @@ -185,19 +179,6 @@ void stereo_mdct_core_enc( { st = sts[ch]; SetTCXModeInfo( st, st->hTranDet, &st->hTcxCfg->tcx_curr_overlap_mode ); - -#ifdef IND_LIST_DYN - /* re-allocate list of indices, if needed (note that st->total_brate is modified later in this function) */ - /* get the maximum allowed number of indices in the list */ - max_num_indices = get_max_num_indices( ivas_format, st->total_brate ); - - /* check, if the maximum number of allowed indices has changed */ - if ( max_num_indices != st->hBstr->max_num_indices ) - { - /* re-allocate the list of indices */ - ind_list_realloc( st->hBstr, max_num_indices ); - } -#endif } /* adaptively sync tcx modes*/ diff --git a/lib_enc/ivas_tcx_core_enc.c b/lib_enc/ivas_tcx_core_enc.c index 3971c6740e..40a97cc33e 100644 --- a/lib_enc/ivas_tcx_core_enc.c +++ b/lib_enc/ivas_tcx_core_enc.c @@ -457,11 +457,7 @@ void stereo_tcx_core_enc( mvr2r( lsp_q, st->lsp_old, M ); } -#ifdef PARAM_ISM_DTX_CNG if ( st->Opt_DTX_ON && !st->tcxonly && st->hTdCngEnc != NULL ) -#else - if ( st->Opt_DTX_ON && !st->tcxonly ) -#endif { /* update CNG parameters in active frames */ if ( st->bwidth == NB && st->enableTcxLpc && st->core != ACELP_CORE ) diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 1b771a041c..50052cda3c 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -48,12 +48,8 @@ struct IVAS_ENC { Encoder_Struct *st_ivas; -#ifndef IND_LIST_DYN - Indice ind_list[MAX_NUM_DATA][MAX_NUM_INDICES]; /* list of indices */ -#endif -#ifndef IND_LIST_DYN + Indice ind_list[MAX_NUM_DATA][MAX_NUM_INDICES]; /* list of indices */ Indice ind_list_metadata[MAX_NUM_METADATA][MAX_BITS_METADATA]; /* list of indices for metadata */ -#endif ENC_CORE_HANDLE hCoreCoder; bool isConfigured; #ifdef DEBUGGING @@ -103,9 +99,7 @@ ivas_error IVAS_ENC_Open( ) { Encoder_Struct *st_ivas; -#ifndef IND_LIST_DYN int16_t i, j; -#endif if ( phIvasEnc == NULL ) { @@ -116,7 +110,13 @@ ivas_error IVAS_ENC_Open( * Allocate and initialize IVAS application encoder handle *-----------------------------------------------------------------*/ +#ifdef BITSTREAM_INDICES_MEMORY +#define WMC_TOOL_SKIP + if ( ( *phIvasEnc = (IVAS_ENC_HANDLE) malloc( sizeof( struct IVAS_ENC ) ) ) == NULL ) +#undef WMC_TOOL_SKIP +#else if ( ( *phIvasEnc = (IVAS_ENC_HANDLE) malloc( sizeof( struct IVAS_ENC ) ) ) == NULL ) +#endif { return IVAS_ERR_FAILED_ALLOC; } @@ -134,7 +134,6 @@ ivas_error IVAS_ENC_Open( * Initialize indices *-----------------------------------------------------------------*/ -#ifndef IND_LIST_DYN for ( i = 0; i < MAX_NUM_DATA; ++i ) { for ( j = 0; j < MAX_NUM_INDICES; ++j ) @@ -143,9 +142,7 @@ ivas_error IVAS_ENC_Open( ( *phIvasEnc )->ind_list[i][j].value = 0; } } -#endif -#ifndef IND_LIST_DYN for ( i = 0; i < MAX_NUM_METADATA; ++i ) { for ( j = 0; j < MAX_BITS_METADATA; ++j ) @@ -154,7 +151,6 @@ ivas_error IVAS_ENC_Open( ( *phIvasEnc )->ind_list_metadata[i][j].value = 0; } } -#endif /*-----------------------------------------------------------------* * Allocate IVAS-codec encoder state @@ -224,7 +220,13 @@ void IVAS_ENC_Close( ( *phIvasEnc )->st_ivas = NULL; +#ifdef BITSTREAM_INDICES_MEMORY +#define WMC_TOOL_SKIP free( *phIvasEnc ); +#undef WMC_TOOL_SKIP +#else + free( *phIvasEnc ); +#endif *phIvasEnc = NULL; phIvasEnc = NULL; @@ -364,7 +366,12 @@ ivas_error IVAS_ENC_ConfigureForObjects( const bool max_bwidth_user, /* i : shows if bandwidth limitation was set by the user (true) or if default bandwidth was used (false) */ const IVAS_ENC_BANDWIDTH maxBandwidth, /* i : bandwidth limitation */ const IVAS_ENC_DTX_CONFIG dtxConfig, /* i : configuration of DTX, can by set to default by using IVAS_ENC_GetDefaultDtxConfig() */ - const uint16_t numObjects /* i : number of objects to be encoded */ +#ifdef TD5 + const uint16_t numObjects, /* i : number of objects to be encoded */ + const bool ism_extended_metadata /* i : Extended metadata used (true/false), where extended metadata includes radius and orientation */ +#else + const uint16_t numObjects /* i : number of objects to be encoded */ +#endif ) { Encoder_Struct *st_ivas; @@ -384,7 +391,12 @@ ivas_error IVAS_ENC_ConfigureForObjects( st_ivas->hEncoderConfig->ivas_format = ISM_FORMAT; st_ivas->hEncoderConfig->element_mode_init = IVAS_SCE; st_ivas->hEncoderConfig->nchan_inp = numObjects; - +#ifdef NCHAN_ISM_PARAMETER + st_ivas->hEncoderConfig->nchan_ism = numObjects; +#endif +#ifdef TD5 + st_ivas->hEncoderConfig->ism_extended_metadata_flag = ism_extended_metadata; +#endif hIvasEnc->maxBandwidthUser = max_bwidth_user; error = configureEncoder( hIvasEnc, inputFs, bitrate, maxBandwidth, dtxConfig, IVAS_ENC_GetDefaultChannelAwareConfig() ); @@ -424,7 +436,12 @@ ivas_error IVAS_ENC_FeedObjectMetadata( return IVAS_ERR_INDEX_OUT_OF_BOUNDS; } +#ifdef TD5 + error = ivas_set_ism_metadata( hIvasEnc->st_ivas->hIsmMetaData[ismIndex], metadata.azimuth, metadata.elevation, metadata.radius, metadata.yaw, metadata.pitch ); +#else error = ivas_set_ism_metadata( hIvasEnc->st_ivas->hIsmMetaData[ismIndex], metadata.azimuth, metadata.elevation ); +#endif + if ( error != IVAS_ERR_OK ) { return error; @@ -871,22 +888,16 @@ static ivas_error configureEncoder( return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "8kHz input sampling rate is not supported in IVAS." ); } -#ifdef PARAM_ISM_DTX_CNG if ( hEncoderConfig->Opt_DTX_ON && hEncoderConfig->ivas_format != MONO_FORMAT && - ( ( hEncoderConfig->ivas_format == ISM_FORMAT && hEncoderConfig->nchan_inp == 2 ) || // ToDo: see Issue 113 - ( hEncoderConfig->ivas_format == ISM_FORMAT && hEncoderConfig->nchan_inp > 2 && hEncoderConfig->ivas_total_brate != IVAS_24k4 && hEncoderConfig->ivas_total_brate != IVAS_32k ) || // ParamISM - ( hEncoderConfig->ivas_format == MASA_FORMAT && hEncoderConfig->ivas_total_brate > IVAS_128k ) || // ToDo: remove the bitrate limitation - ( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_get_sba_num_TCs( hEncoderConfig->ivas_total_brate, 1 ) > 2 ) || // ToDo: support for 3+ TCs to be done - hEncoderConfig->ivas_format == MC_FORMAT // ToDo: TBD - ) ) -#else - if ( hEncoderConfig->Opt_DTX_ON && hEncoderConfig->ivas_format != MONO_FORMAT && - ( ( hEncoderConfig->ivas_format == ISM_FORMAT && hEncoderConfig->nchan_inp > 1 ) || // ToDo: see Issue 113 - ( hEncoderConfig->ivas_format == MASA_FORMAT && hEncoderConfig->ivas_total_brate > IVAS_128k ) || // ToDo: remove the bitrate limitation - ( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_get_sba_num_TCs( hEncoderConfig->ivas_total_brate, 1 ) > 2 ) || // ToDo: support for 3+ TCs to be done - hEncoderConfig->ivas_format == MC_FORMAT // ToDo: TBD - ) ) + ( +#ifndef DISCRETE_ISM_DTX_CNG + ( hEncoderConfig->ivas_format == ISM_FORMAT && hEncoderConfig->nchan_inp == 2 ) || // ToDo: see Issue 113 + ( hEncoderConfig->ivas_format == ISM_FORMAT && hEncoderConfig->nchan_inp > 2 && hEncoderConfig->ivas_total_brate != IVAS_24k4 && hEncoderConfig->ivas_total_brate != IVAS_32k ) || // ParamISM #endif + ( hEncoderConfig->ivas_format == MASA_FORMAT && hEncoderConfig->ivas_total_brate > IVAS_128k ) || // ToDo: remove the bitrate limitation + ( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_get_sba_num_TCs( hEncoderConfig->ivas_total_brate, 1 ) > 2 ) || // ToDo: support for 3+ TCs to be done + hEncoderConfig->ivas_format == MC_FORMAT // ToDo: TBD + ) ) { return IVAS_ERROR( IVAS_ERR_DTX_NOT_SUPPORTED, "DTX is not supported in this IVAS format and element mode." ); } @@ -912,21 +923,12 @@ static ivas_error configureEncoder( * Finalize initialization *-----------------------------------------------------------------*/ - if ( ( error = ivas_init_encoder( st_ivas -#ifndef IND_LIST_DYN - , - hIvasEnc->ind_list -#endif -#ifndef IND_LIST_DYN - , - hIvasEnc->ind_list_metadata -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_init_encoder( st_ivas, hIvasEnc->ind_list, hIvasEnc->ind_list_metadata ) ) != IVAS_ERR_OK ) { return error; } -#ifdef PARAM_ISM_DTX_CNG +#ifndef DISCRETE_ISM_DTX_CNG if ( hEncoderConfig->Opt_DTX_ON && ( hEncoderConfig->ivas_format == ISM_FORMAT ) && !( st_ivas->ism_mode == ISM_MODE_DISC && hEncoderConfig->nchan_inp == 1 ) && !( st_ivas->ism_mode == ISM_MODE_PARAM && ( hEncoderConfig->nchan_inp == 3 || hEncoderConfig->nchan_inp == 4 ) ) ) { return IVAS_ERROR( IVAS_ERR_UNKNOWN, "DTX is not supported in this IVAS format and element mode." ); @@ -1001,7 +1003,6 @@ static int16_t getInputBufferSize( return (int16_t) ( st_ivas->hEncoderConfig->input_Fs * st_ivas->hEncoderConfig->nchan_inp / FRAMES_PER_SEC ); } -#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS /*---------------------------------------------------------------------* * IVAS_ENC_GetNumInChannels() * @@ -1026,7 +1027,6 @@ ivas_error IVAS_ENC_GetNumInChannels( return IVAS_ERR_OK; } -#endif /*---------------------------------------------------------------------* @@ -1545,11 +1545,11 @@ static ivas_error printConfigInfo_enc( { if ( hEncoderConfig->ivas_total_brate <= ACELP_32k && hEncoderConfig->nchan_inp > 2 ) { - fprintf( stdout, "IVAS format: Param-ISm (%i streams)\n", hEncoderConfig->nchan_inp ); + fprintf( stdout, "IVAS format: Param-ISM (%i streams)\n", hEncoderConfig->nchan_inp ); } else { - fprintf( stdout, "IVAS format: ISm (%i streams)\n", hEncoderConfig->nchan_inp ); + fprintf( stdout, "IVAS format: ISM (%i streams)\n", hEncoderConfig->nchan_inp ); } } else if ( hEncoderConfig->ivas_format == SBA_FORMAT ) @@ -1992,7 +1992,6 @@ static ivas_error sanitizeBandwidth( static ivas_error sanitizeBitrateISM( const ENCODER_CONFIG_HANDLE hEncoderConfig ) { -#ifdef ISM_HIGHEST_BITRATE if ( hEncoderConfig->ivas_total_brate > IVAS_128k && hEncoderConfig->nchan_inp == 1 ) { return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too high bitrate for 1 ISM specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); @@ -2007,12 +2006,6 @@ static ivas_error sanitizeBitrateISM( { return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too high bitrate for 3 ISM specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); } -#else - if ( hEncoderConfig->ivas_total_brate > IVAS_256k ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too high bitrate for ISm specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); - } -#endif if ( hEncoderConfig->ivas_total_brate < IVAS_16k4 && hEncoderConfig->nchan_inp == 2 ) { @@ -2029,6 +2022,13 @@ static ivas_error sanitizeBitrateISM( return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too low bitrate for 4 ISM specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); } +#ifdef TD5 + if ( hEncoderConfig->ivas_total_brate < ISM_EXTENDED_METADATA_BRATE && hEncoderConfig->ism_extended_metadata_flag == 1 ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too low bitrate for extended metadata format specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); + } +#endif + return IVAS_ERR_OK; } @@ -2284,8 +2284,14 @@ static void init_encoder_config( hEncoderConfig->var_SID_rate_flag = 1; hEncoderConfig->mc_input_setup = MC_LS_SETUP_INVALID; hEncoderConfig->stereo_dmx_evs = 0; +#ifdef NCHAN_ISM_PARAMETER + hEncoderConfig->nchan_ism = 0; +#endif hEncoderConfig->sba_order = 0; hEncoderConfig->sba_planar = 0; +#ifdef TD5 + hEncoderConfig->ism_extended_metadata_flag = 0; +#endif #ifdef DEBUGGING hEncoderConfig->stereo_mode_cmdl = 0; hEncoderConfig->force = -1; diff --git a/lib_enc/lib_enc.h b/lib_enc/lib_enc.h index 7430822642..37fd4b4dee 100644 --- a/lib_enc/lib_enc.h +++ b/lib_enc/lib_enc.h @@ -180,7 +180,12 @@ ivas_error IVAS_ENC_ConfigureForObjects( const bool max_bwidth_user, /* i : shows if bandwidth limitation was set by the user (true) or if default bandwidth was used (false) */ const IVAS_ENC_BANDWIDTH maxBandwidth, /* i : bandwidth limitation */ const IVAS_ENC_DTX_CONFIG dtxConfig, /* i : configuration of DTX, can by set to default by using IVAS_ENC_GetDefaultDtxConfig() */ +#ifdef TD5 + const uint16_t numObjects, /* i : number of objects to be encoded */ + const bool ism_extended_metadata /* i : Extended metadata used (true/false), where extended metadata includes radius and orientation */ +#else const uint16_t numObjects /* i : number of objects to be encoded */ +#endif ); /*! r: error code */ @@ -298,13 +303,11 @@ ivas_error IVAS_ENC_GetDelay( int16_t *delay /* o : encoder delay */ ); -#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS /*! r: encoder error code */ ivas_error IVAS_ENC_GetNumInChannels( const IVAS_ENC_HANDLE hIvasEnc, /* i/o: IVAS encoder handle */ int16_t *numInChannels /* o : total number of samples expected in the input buffer for current encoder configuration */ ); -#endif /*! r: encoder error code */ ivas_error IVAS_ENC_GetInputBufferSize( diff --git a/lib_enc/pre_proc.c b/lib_enc/pre_proc.c index 300cb79787..bbeba48a16 100644 --- a/lib_enc/pre_proc.c +++ b/lib_enc/pre_proc.c @@ -219,7 +219,12 @@ void pre_proc( * NB/WB/SWB/FB bandwidth detector *----------------------------------------------------------------*/ - bw_detect( st, st->input, NULL, enerBuffer ); + bw_detect( st, st->input, NULL, enerBuffer +#ifdef FIX_MDCT_BASED_BWD + , + 0 +#endif + ); /*----------------------------------------------------------------* * Noise energy down-ward update and total noise energy estimation diff --git a/lib_enc/rst_enc.c b/lib_enc/rst_enc.c index 2f19c41665..3a20418759 100644 --- a/lib_enc/rst_enc.c +++ b/lib_enc/rst_enc.c @@ -84,15 +84,11 @@ void CNG_reset_enc( set_f( voice_factors, 1.0, NB_SUBFR16k ); -#ifdef PARAM_ISM_DTX_CNG if ( st->hTdCngEnc != NULL ) { -#endif /* Reset active frame counter */ st->hTdCngEnc->act_cnt2 = 0; -#ifdef PARAM_ISM_DTX_CNG } -#endif /* deactivate bass post-filter */ st->bpf_off = 1; diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index c37ed76dc7..ec7fb594d1 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -51,20 +51,11 @@ * Indice *------------------------------------------------------------------------------------------*/ -#ifdef IND_LIST_DYN -typedef struct -{ - int16_t id; /* id of the indice */ - uint16_t value; /* value of the quantized indice */ - int16_t nb_bits; /* number of bits used for the quantization of the indice */ -} Indice, *INDICE_HANDLE; -#else typedef struct { uint16_t value; /* value of the quantized indice */ int16_t nb_bits; /* number of bits used for the quantization of the indice */ } Indice; -#endif /*----------------------------------------------------------------------------------* * Bitstream structure @@ -72,16 +63,11 @@ typedef struct typedef struct bitstream_enc_data_structure { -#ifdef IND_LIST_DYN - int16_t nb_ind_tot; /* total number of indices already written */ -#endif int16_t nb_bits_tot; /* total number of bits already written */ Indice *ind_list; /* list of indices */ -#ifndef IND_LIST_DYN - int16_t next_ind; /* pointer to the next empty slot in the list of indices */ - int16_t last_ind; /* last written indice */ -#endif - int16_t max_num_indices; /* maximum number of indices in the list */ + int16_t next_ind; /* pointer to the next empty slot in the list of indices */ + int16_t last_ind; /* last written indice */ + } BSTR_ENC_DATA, *BSTR_ENC_HANDLE; /*----------------------------------------------------------------------------------* diff --git a/lib_enc/tcx_utils_enc.c b/lib_enc/tcx_utils_enc.c index 2dd5340992..ba709f0158 100644 --- a/lib_enc/tcx_utils_enc.c +++ b/lib_enc/tcx_utils_enc.c @@ -1486,19 +1486,11 @@ void ProcessIGF( } else { -#ifdef IND_LIST_DYN - pBsStart = hBstr->nb_ind_tot; -#else pBsStart = hBstr->next_ind; -#endif IGFEncWriteBitstream( hIGFEnc, hBstr, &hIGFEnc->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag ); -#ifdef IND_LIST_DYN - bsBits = hBstr->nb_ind_tot - pBsStart; -#else bsBits = hBstr->next_ind - pBsStart; -#endif IGFEncConcatenateBitstream( hIGFEnc, bsBits, hBstr ); } @@ -1578,19 +1570,11 @@ void ProcessStereoIGF( else { hBstr = sts[ch]->hBstr; -#ifdef IND_LIST_DYN - pBsStart = hBstr->nb_ind_tot; -#else pBsStart = hBstr->next_ind; -#endif IGFEncWriteBitstream( hIGFEnc[ch], hBstr, &hIGFEnc[ch]->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag ); -#ifdef IND_LIST_DYN - bsBits = hBstr->nb_ind_tot - pBsStart; -#else bsBits = hBstr->next_ind - pBsStart; -#endif IGFEncConcatenateBitstream( hIGFEnc[ch], bsBits, hBstr ); } } diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index caf9a562d5..c4941b610c 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -147,1225 +147,6 @@ static ivas_error ivas_hrtf_close( return IVAS_ERR_OK; } - -#ifndef FIX_197_CREND_INTERFACE -/*------------------------------------------------------------------------- - * ivas_crend_init_from_rom() - * - * Allocate and initialize crend renderer handle - *------------------------------------------------------------------------*/ - -ivas_error ivas_crend_init_from_rom( - Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ -) -{ - int16_t i, j, tmp; - int32_t output_Fs; - AUDIO_CONFIG intern_config; - HRTFS_HANDLE hHrtf; - -#ifdef FIX_197_CREND_INTERFACE - hHrtf = st_ivas->hCrendWrapper->hHrtfCrend; -#else - hHrtf = st_ivas->hHrtf; -#endif - - output_Fs = st_ivas->hDecoderConfig->output_Fs; - - intern_config = st_ivas->intern_config; - - if ( intern_config == AUDIO_CONFIG_BINAURAL || intern_config == AUDIO_CONFIG_BINAURAL_ROOM ) - { - return IVAS_ERR_INTERNAL_FATAL; - } - - if ( hHrtf == NULL ) - { - if ( ivas_hrtf_open( &hHrtf ) != IVAS_ERR_OK ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for HRTF handle" ); - } - } - - hHrtf->max_num_ir = audioCfg2channels( intern_config ); - - if ( hHrtf->max_num_ir <= 0 ) - { - return IVAS_ERR_INTERNAL_FATAL; - } - - /* Do all error checks up front so that the nested if later is easier */ - if ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV && st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Encountered unsupported renderer type" ); - } - - if ( intern_config != AUDIO_CONFIG_5_1 && intern_config != AUDIO_CONFIG_5_1_2 && intern_config != AUDIO_CONFIG_5_1_4 && - intern_config != AUDIO_CONFIG_7_1 && intern_config != AUDIO_CONFIG_7_1_4 && - intern_config != AUDIO_CONFIG_FOA && intern_config != AUDIO_CONFIG_HOA2 && intern_config != AUDIO_CONFIG_HOA3 ) - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Encountered unsupported transport config in Crend" ); - } - - if ( ( ( st_ivas->hRenderConfig != NULL ) && !st_ivas->hRenderConfig->roomAcoustics.use_brir ) || ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV ) ) - { - if ( intern_config == AUDIO_CONFIG_5_1 || intern_config == AUDIO_CONFIG_5_1_2 || intern_config == AUDIO_CONFIG_5_1_4 || - intern_config == AUDIO_CONFIG_7_1 || intern_config == AUDIO_CONFIG_7_1_4 ) - { - hHrtf->max_num_ir -= 1; /* subtract LFE */ - hHrtf->gain_lfe = GAIN_LFE; - - if ( output_Fs == 48000 ) - { - hHrtf->latency_s = CRendBin_Combined_HRIR_latency_s; - - hHrtf->max_num_iterations = CRendBin_Combined_HRIR_max_num_iterations_48kHz; - hHrtf->index_frequency_max_diffuse = CRendBin_Combined_HRIR_index_frequency_max_diffuse_48kHz; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_HRIR_num_iterations_diffuse_48kHz[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_48kHz[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_Combined_HRIR_coeff_diffuse_re_48kHz[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_Combined_HRIR_coeff_diffuse_im_48kHz[j]; - } - } - else if ( output_Fs == 32000 ) - { - hHrtf->latency_s = CRendBin_Combined_HRIR_latency_s; - - hHrtf->max_num_iterations = CRendBin_Combined_HRIR_max_num_iterations_32kHz; - hHrtf->index_frequency_max_diffuse = CRendBin_Combined_HRIR_index_frequency_max_diffuse_32kHz; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_HRIR_num_iterations_diffuse_32kHz[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_32kHz[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_Combined_HRIR_coeff_diffuse_re_32kHz[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_Combined_HRIR_coeff_diffuse_im_32kHz[j]; - } - } - else if ( output_Fs == 16000 ) - { - hHrtf->latency_s = CRendBin_Combined_HRIR_latency_s; - - hHrtf->max_num_iterations = CRendBin_Combined_HRIR_max_num_iterations_16kHz; - hHrtf->index_frequency_max_diffuse = CRendBin_Combined_HRIR_index_frequency_max_diffuse_16kHz; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_HRIR_num_iterations_diffuse_16kHz[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_16kHz[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_Combined_HRIR_coeff_diffuse_re_16kHz[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_Combined_HRIR_coeff_diffuse_im_16kHz[j]; - } - } - else - { - return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Encountered Unsupported sampling rate in Crend" ); - } - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - if ( intern_config == AUDIO_CONFIG_5_1 ) - { - tmp = channelIndex_CICP6[i]; - } - else if ( intern_config == AUDIO_CONFIG_7_1 ) - { - tmp = channelIndex_CICP12[i]; - } - else if ( intern_config == AUDIO_CONFIG_5_1_2 ) - { - tmp = channelIndex_CICP14[i]; - } - else if ( intern_config == AUDIO_CONFIG_5_1_4 ) - { - tmp = channelIndex_CICP16[i]; - } - else if ( intern_config == AUDIO_CONFIG_7_1_4 ) - { - tmp = channelIndex_CICP19[i]; - } - else - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: Channel configuration not specified!\n\n" ); - } - - if ( output_Fs == 48000 ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz[tmp]; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations[i][j] = CRendBin_Combined_HRIR_num_iterations_48kHz[tmp][j]; - hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_HRIR_pIndex_frequency_max_48kHz[tmp][j]; - hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_HRIR_coeff_re_48kHz[tmp][j]; - hHrtf->pOut_to_bin_im[i][j] = CRendBin_Combined_HRIR_coeff_im_48kHz[tmp][j]; - } - } - else if ( output_Fs == 32000 ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz[tmp]; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations[i][j] = CRendBin_Combined_HRIR_num_iterations_32kHz[tmp][j]; - hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_HRIR_pIndex_frequency_max_32kHz[tmp][j]; - hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_HRIR_coeff_re_32kHz[tmp][j]; - hHrtf->pOut_to_bin_im[i][j] = CRendBin_Combined_HRIR_coeff_im_32kHz[tmp][j]; - } - } - else if ( output_Fs == 16000 ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz[tmp]; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations[i][j] = CRendBin_Combined_HRIR_num_iterations_16kHz[tmp][j]; - hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_HRIR_pIndex_frequency_max_16kHz[tmp][j]; - hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_HRIR_coeff_re_16kHz[tmp][j]; - hHrtf->pOut_to_bin_im[i][j] = CRendBin_Combined_HRIR_coeff_im_16kHz[tmp][j]; - } - } - else - { - return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Encountered Unsupported sampling rate in Crend" ); - } - } - } - else if ( intern_config == AUDIO_CONFIG_FOA || intern_config == AUDIO_CONFIG_HOA2 || intern_config == AUDIO_CONFIG_HOA3 ) - { - if ( output_Fs == 48000 ) - { - hHrtf->latency_s = CRendBin_HOA3_HRIR_latency_s; - - hHrtf->max_num_iterations = CRendBin_HOA3_HRIR_max_num_iterations_48kHz; - hHrtf->index_frequency_max_diffuse = CRendBin_HOA3_HRIR_index_frequency_max_diffuse_48kHz; - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz[i]; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_48kHz[i][j]; - hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_48kHz[i][j]; - hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_48kHz[i][j]; - hHrtf->pOut_to_bin_im[i][j] = CRendBin_HOA3_HRIR_coeff_im_48kHz[i][j]; - } - } - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = CRendBin_HOA3_HRIR_num_iterations_diffuse_48kHz[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_48kHz[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_HOA3_HRIR_coeff_diffuse_re_48kHz[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_HOA3_HRIR_coeff_diffuse_im_48kHz[j]; - } - } - else if ( output_Fs == 32000 ) - { - hHrtf->latency_s = CRendBin_HOA3_HRIR_latency_s; - - hHrtf->max_num_iterations = CRendBin_HOA3_HRIR_max_num_iterations_32kHz; - hHrtf->index_frequency_max_diffuse = CRendBin_HOA3_HRIR_index_frequency_max_diffuse_32kHz; - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz[i]; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_32kHz[i][j]; - hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_32kHz[i][j]; - hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_32kHz[i][j]; - hHrtf->pOut_to_bin_im[i][j] = CRendBin_HOA3_HRIR_coeff_im_32kHz[i][j]; - } - } - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = CRendBin_HOA3_HRIR_num_iterations_diffuse_32kHz[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_32kHz[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_HOA3_HRIR_coeff_diffuse_re_32kHz[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_HOA3_HRIR_coeff_diffuse_im_32kHz[j]; - } - } - else if ( output_Fs == 16000 ) - { - hHrtf->latency_s = CRendBin_HOA3_HRIR_latency_s; - - hHrtf->max_num_iterations = CRendBin_HOA3_HRIR_max_num_iterations_16kHz; - hHrtf->index_frequency_max_diffuse = CRendBin_HOA3_HRIR_index_frequency_max_diffuse_16kHz; - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz[i]; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_16kHz[i][j]; - hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_16kHz[i][j]; - hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_16kHz[i][j]; - hHrtf->pOut_to_bin_im[i][j] = CRendBin_HOA3_HRIR_coeff_im_16kHz[i][j]; - } - } - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = CRendBin_HOA3_HRIR_num_iterations_diffuse_16kHz[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_16kHz[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_HOA3_HRIR_coeff_diffuse_re_16kHz[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_HOA3_HRIR_coeff_diffuse_im_16kHz[j]; - } - } - else - { - return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Encountered Unsupported sampling rate in Crend" ); - } - } - } - else if ( ( ( st_ivas->hRenderConfig != NULL ) && st_ivas->hRenderConfig->roomAcoustics.use_brir ) || ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) - { - if ( intern_config == AUDIO_CONFIG_5_1 || intern_config == AUDIO_CONFIG_5_1_2 || intern_config == AUDIO_CONFIG_5_1_4 || - intern_config == AUDIO_CONFIG_7_1 || intern_config == AUDIO_CONFIG_7_1_4 ) - { - hHrtf->max_num_ir -= 1; /* subtract LFE */ - hHrtf->gain_lfe = GAIN_LFE; - - if ( output_Fs == 48000 ) - { - hHrtf->latency_s = CRendBin_Combined_BRIR_latency_s; - - hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_48kHz; - hHrtf->index_frequency_max_diffuse = CRendBin_Combined_BRIR_index_frequency_max_diffuse_48kHz; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_BRIR_num_iterations_diffuse_48kHz[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_48kHz[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_Combined_BRIR_coeff_diffuse_re_48kHz[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_Combined_BRIR_coeff_diffuse_im_48kHz[j]; - } - } - else if ( output_Fs == 32000 ) - { - hHrtf->latency_s = CRendBin_Combined_BRIR_latency_s; - - hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_32kHz; - hHrtf->index_frequency_max_diffuse = CRendBin_Combined_BRIR_index_frequency_max_diffuse_32kHz; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_BRIR_num_iterations_diffuse_32kHz[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_32kHz[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_Combined_BRIR_coeff_diffuse_re_32kHz[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_Combined_BRIR_coeff_diffuse_im_32kHz[j]; - } - } - else if ( output_Fs == 16000 ) - { - hHrtf->latency_s = CRendBin_Combined_BRIR_latency_s; - - hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_16kHz; - hHrtf->index_frequency_max_diffuse = CRendBin_Combined_BRIR_index_frequency_max_diffuse_16kHz; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_BRIR_num_iterations_diffuse_16kHz[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_16kHz[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_Combined_BRIR_coeff_diffuse_re_16kHz[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_Combined_BRIR_coeff_diffuse_im_16kHz[j]; - } - } - else - { - return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Encountered Unsupported sampling rate in Crend" ); - } - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - if ( intern_config == AUDIO_CONFIG_5_1 ) - { - tmp = channelIndex_CICP6[i]; - } - else if ( intern_config == AUDIO_CONFIG_7_1 ) - { - tmp = channelIndex_CICP12[i]; - } - else if ( intern_config == AUDIO_CONFIG_5_1_2 ) - { - tmp = channelIndex_CICP14[i]; - } - else if ( intern_config == AUDIO_CONFIG_5_1_4 ) - { - tmp = channelIndex_CICP16[i]; - } - else if ( intern_config == AUDIO_CONFIG_7_1_4 ) - { - tmp = channelIndex_CICP19[i]; - } - else - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: Channel configuration not specified!\n\n" ); - } - - if ( output_Fs == 48000 ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz[tmp]; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_48kHz[tmp][j]; - hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_48kHz[tmp][j]; - hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_BRIR_coeff_re_48kHz[tmp][j]; - hHrtf->pOut_to_bin_im[i][j] = CRendBin_Combined_BRIR_coeff_im_48kHz[tmp][j]; - } - } - else if ( output_Fs == 32000 ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[tmp]; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_32kHz[tmp][j]; - hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_32kHz[tmp][j]; - hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_BRIR_coeff_re_32kHz[tmp][j]; - hHrtf->pOut_to_bin_im[i][j] = CRendBin_Combined_BRIR_coeff_im_32kHz[tmp][j]; - } - } - else if ( output_Fs == 16000 ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[tmp]; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_16kHz[tmp][j]; - hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_16kHz[tmp][j]; - hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_BRIR_coeff_re_16kHz[tmp][j]; - hHrtf->pOut_to_bin_im[i][j] = CRendBin_Combined_BRIR_coeff_im_16kHz[tmp][j]; - } - } - else - { - return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Encountered Unsupported sampling rate in Crend" ); - } - } - } - else if ( intern_config == AUDIO_CONFIG_FOA || intern_config == AUDIO_CONFIG_HOA2 || intern_config == AUDIO_CONFIG_HOA3 ) - { - if ( output_Fs == 48000 ) - { - hHrtf->latency_s = CRendBin_HOA3_HRIR_latency_s; - - hHrtf->max_num_iterations = CRendBin_HOA3_HRIR_max_num_iterations_48kHz; - hHrtf->index_frequency_max_diffuse = CRendBin_HOA3_HRIR_index_frequency_max_diffuse_48kHz; - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz[i]; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_48kHz[i][j]; - hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_48kHz[i][j]; - hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_48kHz[i][j]; - hHrtf->pOut_to_bin_im[i][j] = CRendBin_HOA3_HRIR_coeff_im_48kHz[i][j]; - } - } - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = CRendBin_HOA3_HRIR_num_iterations_diffuse_48kHz[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_48kHz[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_HOA3_HRIR_coeff_diffuse_re_48kHz[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_HOA3_HRIR_coeff_diffuse_im_48kHz[j]; - } - } - else if ( output_Fs == 32000 ) - { - hHrtf->latency_s = CRendBin_HOA3_HRIR_latency_s; - - hHrtf->max_num_iterations = CRendBin_HOA3_HRIR_max_num_iterations_32kHz; - hHrtf->index_frequency_max_diffuse = CRendBin_HOA3_HRIR_index_frequency_max_diffuse_32kHz; - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz[i]; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_32kHz[i][j]; - hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_32kHz[i][j]; - hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_32kHz[i][j]; - hHrtf->pOut_to_bin_im[i][j] = CRendBin_HOA3_HRIR_coeff_im_32kHz[i][j]; - } - } - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = CRendBin_HOA3_HRIR_num_iterations_diffuse_32kHz[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_32kHz[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_HOA3_HRIR_coeff_diffuse_re_32kHz[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_HOA3_HRIR_coeff_diffuse_im_32kHz[j]; - } - } - else if ( output_Fs == 16000 ) - { - hHrtf->latency_s = CRendBin_HOA3_HRIR_latency_s; - - hHrtf->max_num_iterations = CRendBin_HOA3_HRIR_max_num_iterations_16kHz; - hHrtf->index_frequency_max_diffuse = CRendBin_HOA3_HRIR_index_frequency_max_diffuse_16kHz; - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz[i]; - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_16kHz[i][j]; - hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_16kHz[i][j]; - hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_16kHz[i][j]; - hHrtf->pOut_to_bin_im[i][j] = CRendBin_HOA3_HRIR_coeff_im_16kHz[i][j]; - } - } - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = CRendBin_HOA3_HRIR_num_iterations_diffuse_16kHz[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_16kHz[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = CRendBin_HOA3_HRIR_coeff_diffuse_re_16kHz[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = CRendBin_HOA3_HRIR_coeff_diffuse_im_16kHz[j]; - } - } - else - { - return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Encountered Unsupported sampling rate in Crend" ); - } - } - else - { - return IVAS_ERROR( IVAS_ERR_INTERNAL, "Unsupported intern_config type in Crend" ); - } - } - else - { - return IVAS_ERROR( IVAS_ERR_INTERNAL, "Unsupported renderer type in Crend" ); - } - -#ifdef FIX_197_CREND_INTERFACE - st_ivas->hCrendWrapper->hHrtfCrend = hHrtf; -#else - st_ivas->hHrtf = hHrtf; -#endif - - return IVAS_ERR_OK; -} -#endif - -#ifndef FIX_197_CREND_INTERFACE -/*------------------------------------------------------------------------- - * ivas_crend_init_from_hrtf_handle() - * - * Allocate and initialize Crend HRTF handle from external file - *------------------------------------------------------------------------*/ - -ivas_error ivas_crend_init_from_hrtf_handle( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - HRTFS_HANDLE hrtf ) -{ - int16_t i, j, as_lfe_filter; - const int16_t *hchannelIndex = NULL; - AUDIO_CONFIG transport_config; - - if ( st_ivas == NULL ) - { - return IVAS_ERR_INTERNAL; - } - - if ( hrtf == NULL ) - { - return IVAS_ERR_INVALID_HRTF; - } - - if ( st_ivas->hHrtf != NULL ) - { - ivas_hrtf_close( &st_ivas->hHrtf ); - } - - if ( ivas_hrtf_open( &( st_ivas->hHrtf ) ) != IVAS_ERR_OK ) - { - return IVAS_ERR_INTERNAL; - } - - if ( st_ivas->hHrtf != NULL ) - { - st_ivas->hHrtf->latency_s = hrtf->latency_s; - // st_ivas->hHrtf->max_num_ir->max_ir_len = hrtf->max_ir_len; - st_ivas->hHrtf->max_num_iterations = hrtf->max_num_iterations; - st_ivas->hHrtf->gain_lfe = hrtf->gain_lfe; - // st_ivas->hHrtf->crend_hr_gain_foa_to_bin = hrtf->crend_hr_gain_foa_to_bin; - st_ivas->hHrtf->max_num_ir = 0; - st_ivas->hIntSetup.nchan_out_woLFE = 0; - st_ivas->hIntSetup.num_lfe = 0; - st_ivas->hIntSetup.nchan_out_woLFE = 0; - - transport_config = st_ivas->intern_config == AUDIO_CONFIG_INVALID ? st_ivas->transport_config : st_ivas->intern_config; - - switch ( transport_config ) - { - case AUDIO_CONFIG_5_1: - st_ivas->hHrtf->max_num_ir = 5; - st_ivas->hHrtf->gain_lfe = GAIN_LFE; - st_ivas->hIntSetup.nchan_out_woLFE = st_ivas->hHrtf->max_num_ir; - st_ivas->hIntSetup.num_lfe = 1; - hchannelIndex = (const int16_t *) &channelIndex_CICP6; - break; - case AUDIO_CONFIG_7_1: - st_ivas->hHrtf->max_num_ir = 7; - st_ivas->hHrtf->gain_lfe = GAIN_LFE; - st_ivas->hIntSetup.nchan_out_woLFE = st_ivas->hHrtf->max_num_ir; - st_ivas->hIntSetup.num_lfe = 1; - hchannelIndex = (const int16_t *) &channelIndex_CICP12; - break; - case AUDIO_CONFIG_5_1_2: - st_ivas->hHrtf->max_num_ir = 7; - st_ivas->hHrtf->gain_lfe = GAIN_LFE; - st_ivas->hIntSetup.nchan_out_woLFE = st_ivas->hHrtf->max_num_ir; - st_ivas->hIntSetup.num_lfe = 1; - hchannelIndex = (const int16_t *) &channelIndex_CICP14; - break; - case AUDIO_CONFIG_5_1_4: - st_ivas->hHrtf->max_num_ir = 9; - st_ivas->hHrtf->gain_lfe = GAIN_LFE; - st_ivas->hIntSetup.nchan_out_woLFE = st_ivas->hHrtf->max_num_ir; - st_ivas->hIntSetup.num_lfe = 1; - hchannelIndex = (const int16_t *) &channelIndex_CICP16; - break; - case AUDIO_CONFIG_7_1_4: - st_ivas->hHrtf->max_num_ir = 11; - st_ivas->hHrtf->gain_lfe = GAIN_LFE; - st_ivas->hIntSetup.nchan_out_woLFE = st_ivas->hHrtf->max_num_ir; - st_ivas->hIntSetup.num_lfe = 1; - hchannelIndex = (const int16_t *) &channelIndex_CICP19; - break; - case AUDIO_CONFIG_FOA: - st_ivas->hIntSetup.ambisonics_order = 1; - st_ivas->hHrtf->max_num_ir = 4; - break; - case AUDIO_CONFIG_HOA2: - st_ivas->hIntSetup.ambisonics_order = 2; - st_ivas->hHrtf->max_num_ir = 9; - break; - case AUDIO_CONFIG_HOA3: - st_ivas->hIntSetup.ambisonics_order = 3; - st_ivas->hHrtf->max_num_ir = 16; - break; - default: - break; - } - - as_lfe_filter = 0; - if ( ( st_ivas->hHrtf->max_num_ir != hrtf->max_num_ir ) && ( st_ivas->hHrtf->max_num_ir + 1 == hrtf->max_num_ir ) ) - { - as_lfe_filter = 1; - hchannelIndex = NULL; - } - - if ( st_ivas->hHrtf->max_num_ir == 0 ) - { - return IVAS_ERR_INTERNAL; - } - - for ( i = 0; i < st_ivas->hHrtf->max_num_ir; i++ ) - { - int16_t tmp = i; - if ( hchannelIndex != NULL ) - { - tmp = hchannelIndex[i]; - } - if ( as_lfe_filter ) - { - if ( tmp > 2 ) - { - tmp++; - } - } - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - st_ivas->hHrtf->pOut_to_bin_re[i][j] = hrtf->pOut_to_bin_re[tmp][j]; - st_ivas->hHrtf->pOut_to_bin_im[i][j] = hrtf->pOut_to_bin_im[tmp][j]; - st_ivas->hHrtf->num_iterations[i][j] = hrtf->num_iterations[tmp][j]; - st_ivas->hHrtf->pIndex_frequency_max[i][j] = hrtf->pIndex_frequency_max[tmp][j]; - } - st_ivas->hHrtf->inv_diffuse_weight[i] = hrtf->inv_diffuse_weight[tmp]; - } - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - st_ivas->hHrtf->pOut_to_bin_diffuse_re[j] = hrtf->pOut_to_bin_diffuse_re[j]; - st_ivas->hHrtf->pOut_to_bin_diffuse_im[j] = hrtf->pOut_to_bin_diffuse_im[j]; - st_ivas->hHrtf->num_iterations_diffuse[j] = hrtf->num_iterations_diffuse[j]; - st_ivas->hHrtf->pIndex_frequency_max_diffuse[j] = hrtf->pIndex_frequency_max_diffuse[j]; - } - st_ivas->hHrtf->index_frequency_max_diffuse = hrtf->index_frequency_max_diffuse; - } - return IVAS_ERR_OK; -} - -/*------------------------------------------------------------------------- - * ivas_crend_init_from_setofhrtf() - * - * Allocate and initialize crend renderer handle - *------------------------------------------------------------------------*/ - -ivas_error ivas_crend_init_from_setofhrtf( - Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ -) -{ - ivas_error error; - AUDIO_CONFIG transport_config; - - transport_config = st_ivas->intern_config == AUDIO_CONFIG_INVALID ? st_ivas->transport_config : st_ivas->intern_config; - switch ( transport_config ) - { - case AUDIO_CONFIG_5_1: - case AUDIO_CONFIG_5_1_2: - case AUDIO_CONFIG_5_1_4: - case AUDIO_CONFIG_7_1: - case AUDIO_CONFIG_7_1_4: - if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) - { - if ( ( error = ivas_crend_init_from_hrtf_handle( st_ivas, st_ivas->hSetOfHRTF->hHRTF_brir_combined ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - if ( ( error = ivas_crend_init_from_hrtf_handle( st_ivas, st_ivas->hSetOfHRTF->hHRTF_hrir_combined ) ) != IVAS_ERR_OK ) - { - return error; - } - } - break; - case AUDIO_CONFIG_FOA: - case AUDIO_CONFIG_HOA2: - case AUDIO_CONFIG_HOA3: - if ( ( error = ivas_crend_init_from_hrtf_handle( st_ivas, st_ivas->hSetOfHRTF->hHRTF_hrir_hoa3 ) ) != IVAS_ERR_OK ) - { - return error; - } - break; - default: - return IVAS_ERR_INTERNAL; - } - - return IVAS_ERR_OK; -} - -#endif - -#ifndef FIX_197_CREND_INTERFACE -/*------------------------------------------------------------------------- - * ivas_crend_open() - * - * Allocate and initialize Crend renderer handle - *------------------------------------------------------------------------*/ - -ivas_error ivas_crend_open( - Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ -) -{ - int16_t i, subframe_length; - int16_t max_total_ir_len; - HRTFS_HANDLE hHrtf; - CREND_HANDLE hCrend; - ivas_error error; - - error = IVAS_ERR_OK; - subframe_length = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ) / MAX_PARAM_SPATIAL_SUBFRAMES; - - if ( ( st_ivas->hHrtf == NULL ) && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) - { - if ( st_ivas->hSetOfHRTF != NULL ) - { - if ( ( error = ivas_crend_init_from_setofhrtf( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - if ( ( error = ivas_crend_init_from_rom( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - } - } - - if ( ( hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for renderer handle" ); - } - - hCrend->lfe_delay_line = NULL; - - for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) - { - hCrend->freq_buffer_re[i] = NULL; - hCrend->freq_buffer_im[i] = NULL; - } - - for ( i = 0; i < BINAURAL_CHANNELS; i++ ) - { - hCrend->prev_out_buffer[i] = NULL; - } - - hCrend->freq_buffer_re_diffuse = NULL; - hCrend->freq_buffer_im_diffuse = NULL; - hCrend->hReverb = NULL; - hCrend->delay_line_rw_index = 0; - hCrend->diffuse_delay_line_rw_index = 0; - hCrend->hTrack = NULL; - hCrend->m_fYaw = 0; - hCrend->m_fPitch = 0; - hCrend->m_fRoll = 0; - - hHrtf = st_ivas->hHrtf; - - if ( ( hHrtf != NULL ) && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) - { - max_total_ir_len = hHrtf->max_num_iterations * subframe_length; - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - if ( ( hCrend->freq_buffer_re[i] = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); - } - set_f( hCrend->freq_buffer_re[i], 0, max_total_ir_len ); - - if ( ( hCrend->freq_buffer_im[i] = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); - } - set_f( hCrend->freq_buffer_im[i], 0, max_total_ir_len ); - } - - for ( i = 0; i < BINAURAL_CHANNELS; i++ ) - { - if ( ( hCrend->prev_out_buffer[i] = (float *) malloc( sizeof( float ) * subframe_length ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); - } - set_f( hCrend->prev_out_buffer[i], 0, subframe_length ); - } - - max_total_ir_len = hHrtf->num_iterations_diffuse[0] * subframe_length; - - if ( max_total_ir_len > 0 ) - { - if ( ( hCrend->freq_buffer_re_diffuse = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); - } - set_f( hCrend->freq_buffer_re_diffuse, 0, max_total_ir_len ); - - if ( ( hCrend->freq_buffer_im_diffuse = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); - } - set_f( hCrend->freq_buffer_im_diffuse, 0, max_total_ir_len ); - } - else - { - hCrend->freq_buffer_re_diffuse = NULL; - hCrend->freq_buffer_im_diffuse = NULL; - } - - max_total_ir_len = (int16_t) ( hHrtf->latency_s * st_ivas->hDecoderConfig->output_Fs + 0.5f ) + subframe_length; - if ( max_total_ir_len > 0 ) - { - if ( ( hCrend->lfe_delay_line = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); - } - set_f( hCrend->lfe_delay_line, 0, max_total_ir_len ); - } - else - { - hCrend->lfe_delay_line = NULL; - } - - if ( st_ivas->hDecoderConfig->Opt_Headrotation ) - { - if ( ( hCrend->hTrack = (ivas_orient_trk_state_t *) malloc( sizeof( ivas_orient_trk_state_t ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Orientation tracking" ); - } - - ivas_orient_trk_Init( hCrend->hTrack ); - } - else - { - hCrend->hTrack = NULL; - } - - if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM && st_ivas->ivas_format == MC_FORMAT && st_ivas->hDecoderConfig->Opt_Headrotation ) - { - if ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth, st_ivas->hIntSetup.ls_elevation, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - if ( ( ( st_ivas->hRenderConfig != NULL ) && st_ivas->hRenderConfig->roomAcoustics.late_reverb_on ) ) - { - if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), st_ivas->intern_config, hHrtf, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - hCrend->hReverb = NULL; - } - - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtf->latency_s * 1000000000.f ); - } - - st_ivas->hCrend = hCrend; - - return error; -} -#endif - -#ifndef FIX_197_CREND_INTERFACE - -/*------------------------------------------------------------------------- - * ivas_crend_close() - * - * Deallocate Crend renderer handle - *------------------------------------------------------------------------*/ - -ivas_error ivas_crend_close( - Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ -) -{ - int16_t i; - - if ( st_ivas->hHrtf != NULL ) - { - ivas_hrtf_close( &st_ivas->hHrtf ); - } - - if ( st_ivas->hCrend != NULL ) - { - if ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD ) - { - for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) - { - if ( st_ivas->hCrend->freq_buffer_re[i] != NULL ) - { - free( st_ivas->hCrend->freq_buffer_re[i] ); - st_ivas->hCrend->freq_buffer_re[i] = NULL; - } - if ( st_ivas->hCrend->freq_buffer_im[i] != NULL ) - { - free( st_ivas->hCrend->freq_buffer_im[i] ); - st_ivas->hCrend->freq_buffer_im[i] = NULL; - } - } - - for ( i = 0; i < BINAURAL_CHANNELS; i++ ) - { - if ( st_ivas->hCrend->prev_out_buffer[i] != NULL ) - { - free( st_ivas->hCrend->prev_out_buffer[i] ); - st_ivas->hCrend->prev_out_buffer[i] = NULL; - } - } - - if ( st_ivas->hCrend->lfe_delay_line != NULL ) - { - free( st_ivas->hCrend->lfe_delay_line ); - st_ivas->hCrend->lfe_delay_line = NULL; - } - - if ( st_ivas->hCrend->freq_buffer_re_diffuse != NULL ) - { - free( st_ivas->hCrend->freq_buffer_re_diffuse ); - st_ivas->hCrend->freq_buffer_re_diffuse = NULL; - } - - if ( st_ivas->hCrend->freq_buffer_im_diffuse != NULL ) - { - free( st_ivas->hCrend->freq_buffer_im_diffuse ); - st_ivas->hCrend->freq_buffer_im_diffuse = NULL; - } - - if ( st_ivas->hCrend->hTrack != NULL ) - { - free( st_ivas->hCrend->hTrack ); - st_ivas->hCrend->hTrack = NULL; - } - } - - ivas_reverb_close( &st_ivas->hCrend->hReverb ); - - free( st_ivas->hCrend ); - st_ivas->hCrend = NULL; - } - - return IVAS_ERR_OK; -} -#endif - -#ifndef FIX_197_CREND_INTERFACE - -/*-----------------------------------------------------------------------------------------* - * Function ivas_crend_convolver() - * - * Convolver block - *-----------------------------------------------------------------------------------------*/ - -static ivas_error ivas_crend_convolver( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float pcm_in[][L_FRAME48k], - float pcm_out[][L_FRAME48k], - const int16_t i_ts ) -{ - float *pIn; - float *pFreq_buf_re; - float *pFreq_buf_im; - float *pFreq_filt_re; - float *pFreq_filt_im; - int16_t i, j, k, m, nchan_out, subframe_length, nchan_intern, idx_in; - float pOut[L_FRAME48k * 2]; - float tmp_out_re[L_FRAME48k], tmp_out_im[L_FRAME48k]; - int16_t offset, offset_in, offset_diffuse; - int32_t output_Fs; - - nchan_intern = audioCfg2channels( st_ivas->intern_config ); - nchan_out = st_ivas->hDecoderConfig->nchan_out; - output_Fs = st_ivas->hDecoderConfig->output_Fs; - subframe_length = (int16_t) ( output_Fs / FRAMES_PER_SEC ) / MAX_PARAM_SPATIAL_SUBFRAMES; - - offset = st_ivas->hCrend->delay_line_rw_index * subframe_length; /* subframe_length * ( st_ivas->hHrtf->max_num_iterations - 1 ); */ - offset_diffuse = st_ivas->hCrend->diffuse_delay_line_rw_index * subframe_length; /* subframe_length *( st_ivas->hHrtf->num_iterations_diffuse[0] - 1 ); */ - - if ( st_ivas->hHrtf->num_iterations_diffuse[0] > 0 ) - { - set_zero( &st_ivas->hCrend->freq_buffer_re_diffuse[offset_diffuse], subframe_length ); - set_zero( &st_ivas->hCrend->freq_buffer_im_diffuse[offset_diffuse], subframe_length ); - } - - i = 0; - for ( idx_in = 0; idx_in < nchan_intern; idx_in++ ) - { - pIn = &pcm_in[idx_in][i_ts * subframe_length]; - if ( st_ivas->hIntSetup.index_lfe[0] != idx_in ) - { - if ( st_ivas->hHrtf->num_iterations_diffuse[0] > 0 ) - { - pFreq_buf_re = &st_ivas->hCrend->freq_buffer_re_diffuse[offset_diffuse]; - pFreq_buf_im = &st_ivas->hCrend->freq_buffer_im_diffuse[offset_diffuse]; - pFreq_filt_re = &st_ivas->hCrend->freq_buffer_re[i][offset]; - pFreq_filt_im = &st_ivas->hCrend->freq_buffer_im[i][offset]; - - for ( k = 0; k < st_ivas->hHrtf->index_frequency_max_diffuse; k++ ) - { - pFreq_buf_re[k] += pFreq_filt_re[k] * st_ivas->hHrtf->inv_diffuse_weight[i]; - pFreq_buf_im[k] += pFreq_filt_im[k] * st_ivas->hHrtf->inv_diffuse_weight[i]; - } - } - - pFreq_buf_re = &st_ivas->hCrend->freq_buffer_re[i][offset]; - pFreq_buf_im = &st_ivas->hCrend->freq_buffer_im[i][offset]; - - ivas_mdft( pIn, pFreq_buf_re, pFreq_buf_im, subframe_length, subframe_length ); - i++; - } - } - - for ( j = 0; j < nchan_out; j++ ) - { - set_zero( tmp_out_re, subframe_length ); - set_zero( tmp_out_im, subframe_length ); - - i = 0; - for ( idx_in = 0; idx_in < nchan_intern; idx_in++ ) - { - if ( idx_in != st_ivas->hIntSetup.index_lfe[0] ) - { - offset = 0; - for ( m = 0; m < st_ivas->hHrtf->num_iterations[i][j]; m++ ) - { - offset_in = ( st_ivas->hCrend->delay_line_rw_index + st_ivas->hHrtf->max_num_iterations - st_ivas->hHrtf->num_iterations[i][j] + m + 1 ); - offset_in = offset_in % ( st_ivas->hHrtf->max_num_iterations ); - offset_in = offset_in * subframe_length; - pFreq_buf_re = &st_ivas->hCrend->freq_buffer_re[i][offset_in]; - pFreq_buf_im = &st_ivas->hCrend->freq_buffer_im[i][offset_in]; - pFreq_filt_re = &st_ivas->hHrtf->pOut_to_bin_re[i][j][offset]; - pFreq_filt_im = &st_ivas->hHrtf->pOut_to_bin_im[i][j][offset]; - - for ( k = 0; k < st_ivas->hHrtf->pIndex_frequency_max[i][j][m]; k++ ) - { - tmp_out_re[k] += pFreq_buf_re[k] * pFreq_filt_re[k] - pFreq_buf_im[k] * pFreq_filt_im[k]; - tmp_out_im[k] += pFreq_buf_re[k] * pFreq_filt_im[k] + pFreq_buf_im[k] * pFreq_filt_re[k]; - } - offset = offset + k; - } - i++; - } - } - - offset = 0; - for ( m = 0; m < st_ivas->hHrtf->num_iterations_diffuse[j]; m++ ) - { - offset_diffuse = ( st_ivas->hCrend->diffuse_delay_line_rw_index + m + 1 ); - offset_diffuse = offset_diffuse % st_ivas->hHrtf->num_iterations_diffuse[0]; - offset_diffuse = offset_diffuse * subframe_length; - pFreq_buf_re = &st_ivas->hCrend->freq_buffer_re_diffuse[offset_diffuse]; - pFreq_buf_im = &st_ivas->hCrend->freq_buffer_im_diffuse[offset_diffuse]; - pFreq_filt_re = &st_ivas->hHrtf->pOut_to_bin_diffuse_re[j][offset]; - pFreq_filt_im = &st_ivas->hHrtf->pOut_to_bin_diffuse_im[j][offset]; - - for ( k = 0; k < st_ivas->hHrtf->pIndex_frequency_max_diffuse[j][m]; k++ ) - { - tmp_out_re[k] += pFreq_buf_re[k] * pFreq_filt_re[k] - pFreq_buf_im[k] * pFreq_filt_im[k]; - tmp_out_im[k] += pFreq_buf_re[k] * pFreq_filt_im[k] + pFreq_buf_im[k] * pFreq_filt_re[k]; - } - offset = offset + k; - } - - ivas_imdft( tmp_out_re, tmp_out_im, pOut, subframe_length ); - - pFreq_buf_re = &pcm_out[j][i_ts * subframe_length]; - for ( k = 0; k < subframe_length; k++ ) - { - pFreq_buf_re[k] = pOut[k] + st_ivas->hCrend->prev_out_buffer[j][k]; - st_ivas->hCrend->prev_out_buffer[j][k] = pOut[k + subframe_length]; - } - } - - st_ivas->hCrend->delay_line_rw_index++; - st_ivas->hCrend->delay_line_rw_index = st_ivas->hCrend->delay_line_rw_index % ( st_ivas->hHrtf->max_num_iterations ); - if ( st_ivas->hHrtf->num_iterations_diffuse[0] > 0 ) - { - st_ivas->hCrend->diffuse_delay_line_rw_index++; - st_ivas->hCrend->diffuse_delay_line_rw_index = st_ivas->hCrend->diffuse_delay_line_rw_index % ( st_ivas->hHrtf->num_iterations_diffuse[0] ); - } - - return IVAS_ERR_OK; -} -#endif - -#ifndef FIX_197_CREND_INTERFACE - -/*-----------------------------------------------------------------------------------------* - * Function ivas_crend_process() - * - * Process call for IVAS Crend renderer - *-----------------------------------------------------------------------------------------*/ - -ivas_error ivas_crend_process( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float output[][L_FRAME48k] /* i/o: input/output audio channels */ -) -{ - int16_t i, nchan_out, output_frame; - int16_t subframe_len, subframe_idx; - float pcm_tmp[BINAURAL_CHANNELS][L_FRAME48k]; - AUDIO_CONFIG intern_config; - ivas_error error; - - push_wmops( "ivas_crend_process" ); - - intern_config = st_ivas->intern_config; - nchan_out = st_ivas->hDecoderConfig->nchan_out; - output_frame = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); - subframe_len = output_frame / MAX_PARAM_SPATIAL_SUBFRAMES; - - for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) - { - if ( st_ivas->hDecoderConfig->Opt_Headrotation && st_ivas->hHeadTrackData && st_ivas->hHeadTrackData->num_quaternions >= 0 ) - { - /* Orientation tracking */ - if ( st_ivas->hCrend->hTrack != NULL ) - { - if ( st_ivas->hDecoderConfig->orientation_tracking == IVAS_ORIENT_TRK_AVG ) - { - ivas_orient_trk_SetTrackingType( st_ivas->hCrend->hTrack, OTR_TRACKING_AVG_ORIENT ); - } - else - { - ivas_orient_trk_SetTrackingType( st_ivas->hCrend->hTrack, OTR_TRACKING_REF_ORIENT ); - } - - /* get current subframe quaternion and convert to euler angles */ - Quat2Euler( st_ivas->hHeadTrackData->Quaternions[subframe_idx], &( st_ivas->hCrend->m_fYaw ), &( st_ivas->hCrend->m_fPitch ), &( st_ivas->hCrend->m_fRoll ) ); - ivas_orient_trk_SetAbsoluteOrientation( st_ivas->hCrend->hTrack, st_ivas->hCrend->m_fYaw, st_ivas->hCrend->m_fPitch, st_ivas->hCrend->m_fRoll ); - ivas_orient_trk_Process( st_ivas->hCrend->hTrack ); - ivas_orient_trk_GetTrackedOrientation( st_ivas->hCrend->hTrack, &( st_ivas->hCrend->m_fYaw ), &( st_ivas->hCrend->m_fPitch ), &( st_ivas->hCrend->m_fRoll ) ); - } - - /* Rotation in SHD for: - MC with elevation (5_1_2 / 5_1_4 / 7_1_4) -> BINAURAL - SBA SPAR -> BINAURAL or BINAURAL_ROOM - */ - if ( intern_config == AUDIO_CONFIG_FOA || intern_config == AUDIO_CONFIG_HOA2 || intern_config == AUDIO_CONFIG_HOA3 ) - { - rotateFrame_shd( st_ivas->hHeadTrackData, output, subframe_len, st_ivas->hIntSetup, subframe_idx ); - } - /* Rotation in SD for MC -> BINAURAL_ROOM */ - else if ( st_ivas->ivas_format != ISM_FORMAT && st_ivas->hIntSetup.is_loudspeaker_setup ) - { - rotateFrame_sd( st_ivas->hHeadTrackData, output, subframe_len, st_ivas->hIntSetup, st_ivas->hEFAPdata, subframe_idx ); - } - } - - if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) - { - if ( ( intern_config == AUDIO_CONFIG_FOA ) || ( intern_config == AUDIO_CONFIG_HOA2 ) || ( intern_config == AUDIO_CONFIG_HOA3 ) || - ( intern_config == AUDIO_CONFIG_5_1 ) || ( intern_config == AUDIO_CONFIG_7_1 ) || - ( intern_config == AUDIO_CONFIG_5_1_2 ) || ( intern_config == AUDIO_CONFIG_5_1_4 ) || ( intern_config == AUDIO_CONFIG_7_1_4 ) ) - { - ivas_crend_convolver( st_ivas, output, pcm_tmp, subframe_idx ); - - if ( st_ivas->hCrend->hReverb != NULL ) - { - if ( ( error = ivas_reverb_process( st_ivas->hCrend->hReverb, intern_config, 1, output, pcm_tmp, subframe_idx ) ) != IVAS_ERR_OK ) - { - return error; - } - } - } - else - { - return IVAS_ERR_INVALID_INPUT_FORMAT; - } - } - else - { - return IVAS_ERR_INTERNAL_FATAL; - } - } - - /* move to output */ - for ( i = 0; i < nchan_out; i++ ) - { - mvr2r( pcm_tmp[i], output[i], output_frame ); - } - - pop_wmops(); - - return IVAS_ERR_OK; -} -#endif - - /*------------------------------------------------------------------------- * initCrend_from_rom() * @@ -1416,17 +197,10 @@ static ivas_error ivas_rend_initCrend( /* set BRIR flag */ use_brir = false; -#ifdef FIX_197_CREND_INTERFACE if ( ( ( hRendCfg != NULL ) && hRendCfg->roomAcoustics.use_brir ) || ( ( hRendCfg == NULL ) && ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) ) ) { use_brir = true; } -#else - if ( ( hRendCfg != NULL && hRendCfg->roomAcoustics.use_brir ) || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) - { - use_brir = true; - } -#endif if ( ( error = getAudioConfigNumChannels( inConfig, &nchan_in ) ) != IVAS_ERR_OK ) @@ -1893,8 +667,6 @@ static ivas_error ivas_rend_initCrend( return IVAS_ERR_OK; } -#ifdef FIX_197_CREND_INTERFACE -#ifdef FIX_329_ENABLE_TD_RENDERER_REVERB_MC /*------------------------------------------------------------------------- * ivas_rend_initCrendWrapper() * @@ -1950,8 +722,6 @@ ivas_error ivas_rend_initCrendWrapper( return IVAS_ERR_OK; } -#endif -#endif /*------------------------------------------------------------------------- * ivas_rend_openCrend() * @@ -1959,15 +729,11 @@ ivas_error ivas_rend_initCrendWrapper( *------------------------------------------------------------------------*/ ivas_error ivas_rend_openCrend( -#ifdef FIX_197_CREND_INTERFACE CREND_WRAPPER_HANDLE *pCrend, -#else - CREND_WRAPPER *pCrend, -#endif const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, -#ifdef FIX_197_CREND_INTERFACE +#ifndef FIX_I109_ORIENTATION_TRACKING int16_t Opt_Headrotation, #endif HRTFS_CREND_HANDLE hSetOfHRTF, @@ -1981,35 +747,14 @@ ivas_error ivas_rend_openCrend( ivas_error error; error = IVAS_ERR_OK; -#ifdef FIX_197_CREND_INTERFACE -#ifdef FIX_329_ENABLE_TD_RENDERER_REVERB_MC if ( ( error = ivas_rend_initCrendWrapper( pCrend ) ) != IVAS_ERR_OK ) { return error; } hCrend = ( *pCrend )->hCrend; -#else - if ( pCrend == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend Wrapper\n" ); - } - - if ( *pCrend == NULL ) - { - if ( ( *pCrend = (CREND_WRAPPER_HANDLE) malloc( sizeof( CREND_WRAPPER ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend Wrapper\n" ); - } - ( *pCrend )->binaural_latency_ns = 0; - ( *pCrend )->hCrend = NULL; - ( *pCrend )->hHrtfCrend = NULL; - } -#endif -#endif subframe_length = (int16_t) ( output_Fs / FRAMES_PER_SEC ) / MAX_PARAM_SPATIAL_SUBFRAMES; -#ifdef FIX_197_CREND_INTERFACE if ( ( *pCrend )->hHrtfCrend == NULL ) { if ( ( error = ivas_rend_initCrend( *pCrend, inConfig, outConfig, hRendCfg, hSetOfHRTF, output_Fs ) ) != IVAS_ERR_OK ) @@ -2017,53 +762,8 @@ ivas_error ivas_rend_openCrend( return error; } } -#else - if ( pCrend->hHrtfCrend == NULL ) - { - if ( ( error = ivas_rend_initCrend( pCrend, inConfig, outConfig, hRendCfg, hSetOfHRTF, output_Fs ) ) != IVAS_ERR_OK ) - { - return error; - } - } -#endif - -#ifndef FIX_329_ENABLE_TD_RENDERER_REVERB_MC - - if ( ( hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for renderer handle" ); - } - - hCrend->lfe_delay_line = NULL; - - for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) - { - hCrend->freq_buffer_re[i] = NULL; - hCrend->freq_buffer_im[i] = NULL; - } - - for ( i = 0; i < BINAURAL_CHANNELS; i++ ) - { - hCrend->prev_out_buffer[i] = NULL; - } - - hCrend->freq_buffer_re_diffuse = NULL; - hCrend->freq_buffer_im_diffuse = NULL; - hCrend->hReverb = NULL; - hCrend->delay_line_rw_index = 0; - hCrend->diffuse_delay_line_rw_index = 0; - hCrend->hTrack = NULL; - hCrend->m_fYaw = 0; - hCrend->m_fPitch = 0; - hCrend->m_fRoll = 0; -#endif - -#ifdef FIX_197_CREND_INTERFACE hHrtf = ( *pCrend )->hHrtfCrend; -#else - hHrtf = pCrend->hHrtfCrend; -#endif if ( hHrtf != NULL ) { @@ -2128,35 +828,10 @@ ivas_error ivas_rend_openCrend( { hCrend->lfe_delay_line = NULL; } -#ifdef FIX_197_CREND_INTERFACE - if ( Opt_Headrotation ) -#else - if ( false ) /* TODO tmu : check renderer headrotation flag */ -#endif - { - if ( ( hCrend->hTrack = (ivas_orient_trk_state_t *) malloc( sizeof( ivas_orient_trk_state_t ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Orientation tracking" ); - } - - ivas_orient_trk_Init( hCrend->hTrack ); - } - else - { - hCrend->hTrack = NULL; - } if ( ( hRendCfg != NULL ) && ( hRendCfg->roomAcoustics.late_reverb_on ) ) { - if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), - inConfig, -#ifdef FIX_197_CREND_INTERFACE - ( *pCrend )->hHrtfCrend, -#else - pCrend->hHrtfCrend, -#endif - hRendCfg, - output_Fs ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), inConfig, ( *pCrend )->hHrtfCrend, hRendCfg, output_Fs ) ) != IVAS_ERR_OK ) { return error; } @@ -2166,45 +841,27 @@ ivas_error ivas_rend_openCrend( hCrend->hReverb = NULL; } -#ifdef FIX_197_CREND_INTERFACE ( *pCrend )->binaural_latency_ns = (int32_t) ( ( *pCrend )->hHrtfCrend->latency_s * 1000000000.f ); -#else - pCrend->binaural_latency_ns = (int32_t) ( pCrend->hHrtfCrend->latency_s * 1000000000.f ); -#endif } -#ifdef FIX_197_CREND_INTERFACE ( *pCrend )->hCrend = hCrend; -#else - pCrend->hCrend = hCrend; -#endif return IVAS_ERR_OK; } + /*------------------------------------------------------------------------- * ivas_crend_close() * * Deallocate Crend renderer handle *------------------------------------------------------------------------*/ -#ifdef FIX_197_CREND_INTERFACE void ivas_rend_closeCrend( CREND_WRAPPER_HANDLE *pCrend ) -#else -ivas_error ivas_rend_closeCrend( - CREND_WRAPPER *pCrend ) -#endif { int16_t i; -#ifdef FIX_197_CREND_INTERFACE - if ( pCrend == NULL ) - { - return; - } - - if ( *pCrend == NULL ) + if ( pCrend == NULL || *pCrend == NULL ) { return; } @@ -2270,72 +927,11 @@ ivas_error ivas_rend_closeCrend( free( *pCrend ); *pCrend = NULL; } - return; -#else - if ( pCrend->hHrtfCrend != NULL ) - { - ivas_hrtf_close( &pCrend->hHrtfCrend ); - } - - if ( pCrend->hCrend != NULL ) - { - - for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) - { - if ( pCrend->hCrend->freq_buffer_re[i] != NULL ) - { - free( pCrend->hCrend->freq_buffer_re[i] ); - pCrend->hCrend->freq_buffer_re[i] = NULL; - } - if ( pCrend->hCrend->freq_buffer_im[i] != NULL ) - { - free( pCrend->hCrend->freq_buffer_im[i] ); - pCrend->hCrend->freq_buffer_im[i] = NULL; - } - } - - for ( i = 0; i < BINAURAL_CHANNELS; i++ ) - { - if ( pCrend->hCrend->prev_out_buffer[i] != NULL ) - { - free( pCrend->hCrend->prev_out_buffer[i] ); - pCrend->hCrend->prev_out_buffer[i] = NULL; - } - } - - if ( pCrend->hCrend->lfe_delay_line != NULL ) - { - free( pCrend->hCrend->lfe_delay_line ); - pCrend->hCrend->lfe_delay_line = NULL; - } - - if ( pCrend->hCrend->freq_buffer_re_diffuse != NULL ) - { - free( pCrend->hCrend->freq_buffer_re_diffuse ); - pCrend->hCrend->freq_buffer_re_diffuse = NULL; - } - - if ( pCrend->hCrend->freq_buffer_im_diffuse != NULL ) - { - free( pCrend->hCrend->freq_buffer_im_diffuse ); - pCrend->hCrend->freq_buffer_im_diffuse = NULL; - } - - if ( pCrend->hCrend->hTrack != NULL ) - { - free( pCrend->hCrend->hTrack ); - pCrend->hCrend->hTrack = NULL; - } - ivas_reverb_close( &pCrend->hCrend->hReverb ); - - free( pCrend->hCrend ); - pCrend->hCrend = NULL; - } - return IVAS_ERR_OK; -#endif + return; } + /*-----------------------------------------------------------------------------------------* * Function ivas_crend_convolver() * @@ -2508,20 +1104,14 @@ ivas_error ivas_rend_crendProcess( const CREND_WRAPPER *pCrend, const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, -#ifdef FIX_197_CREND_INTERFACE DECODER_CONFIG_HANDLE hDecoderConfig, HEAD_TRACK_DATA_HANDLE hHeadTrackData, IVAS_OUTPUT_SETUP_HANDLE hIntSetup, EFAP_HANDLE hEFAPdata, -#endif float output[][L_FRAME48k], /* i/o: input/output audio channels */ const int32_t output_Fs ) { -#ifdef FIX_197_CREND_INTERFACE int16_t i, subframe_idx, output_frame, subframe_len; -#else - int16_t i, subframe_idx, output_frame; -#endif int16_t nchan_out; float pcm_tmp[BINAURAL_CHANNELS][L_FRAME48k]; AUDIO_CONFIG in_config; @@ -2535,11 +1125,7 @@ ivas_error ivas_rend_crendProcess( inRendConfig = getRendAudioConfigFromIvasAudioConfig( inConfig ); outRendConfig = getRendAudioConfigFromIvasAudioConfig( outConfig ); -#ifdef FIX_197_CREND_INTERFACE in_config = getIvasAudioConfigFromRendAudioConfig( inRendConfig ); -#else - in_config = rendAudioConfigToIvasAudioConfig( inRendConfig ); -#endif inConfigType = getAudioConfigType( inRendConfig ); @@ -2549,15 +1135,13 @@ ivas_error ivas_rend_crendProcess( } output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); -#ifdef FIX_197_CREND_INTERFACE subframe_len = output_frame / MAX_PARAM_SPATIAL_SUBFRAMES; -#endif for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { -#ifdef FIX_197_CREND_INTERFACE if ( hDecoderConfig && hDecoderConfig->Opt_Headrotation && hHeadTrackData && hHeadTrackData->num_quaternions >= 0 ) { /* Orientation tracking */ +#ifndef FIX_I109_ORIENTATION_TRACKING if ( pCrend->hCrend->hTrack != NULL ) { if ( hDecoderConfig->orientation_tracking == IVAS_ORIENT_TRK_AVG ) @@ -2580,6 +1164,7 @@ ivas_error ivas_rend_crendProcess( ivas_orient_trk_GetTrackedOrientation( pCrend->hCrend->hTrack, &( pCrend->hCrend->m_fYaw ), &( pCrend->hCrend->m_fPitch ), &( pCrend->hCrend->m_fRoll ) ); } +#endif /* Rotation in SHD for: MC with elevation (5_1_2 / 5_1_4 / 7_1_4) -> BINAURAL @@ -2595,7 +1180,6 @@ ivas_error ivas_rend_crendProcess( rotateFrame_sd( hHeadTrackData, output, subframe_len, *hIntSetup, hEFAPdata, subframe_idx ); } } -#endif if ( ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) || ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) ) { diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 020dd27cfa..58de4819e8 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -139,22 +139,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( set_zero( hBinaural->ChCrossImOutPrev, nBins ); hBinaural->renderStereoOutputInsteadOfBinaural = 0; -#ifdef FIX_107_5MS_SUBFRAME_RENDERING hBinaural->useSubframeMode = 1; -#else - if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->sba_mode == SBA_MODE_SPAR ) /* Use subframe-mode with SPAR, since the metadata is not in sync on a frame level */ - { - hBinaural->useSubframeMode = 1; - } - else - { -#ifdef DEBUGGING - hBinaural->useSubframeMode = st_ivas->hDecoderConfig->forceSubframeBinauralization; -#else - hBinaural->useSubframeMode = 0; /* Default to 20 ms mode. */ -#endif - } -#endif hBinaural->useTdDecorr = 0; if ( st_ivas->ivas_format == SBA_FORMAT ) @@ -299,7 +284,7 @@ void ivas_dirac_dec_close_binaural_data( DIRAC_DEC_BIN_HANDLE *hBinaural /* i/o: decoder DirAC binaural data handle */ ) { - if ( *hBinaural == NULL ) + if ( hBinaural == NULL || *hBinaural == NULL ) { return; } diff --git a/lib_rend/ivas_hrtf.c b/lib_rend/ivas_hrtf.c index b53c636932..2b1f16d025 100644 --- a/lib_rend/ivas_hrtf.c +++ b/lib_rend/ivas_hrtf.c @@ -116,7 +116,6 @@ void ivas_HRTF_CRend_binary_close( return; } - free( *hSetOfHRTF ); *hSetOfHRTF = NULL; @@ -202,38 +201,3 @@ void ivas_HRTF_parambin_binary_close( return; } - - -/*-----------------------------------------------------------------------* - * ivas_headTrack_open() - * - * Allocate and initialize Head-Tracking handle - *-----------------------------------------------------------------------*/ - -ivas_error ivas_headTrack_open( - HEAD_TRACK_DATA_HANDLE *hHeadTrackData /* o : head track handle */ -) -{ - int16_t i; - - /* Allocate Head-Tracking handle */ - if ( ( *hHeadTrackData = (HEAD_TRACK_DATA_HANDLE) malloc( sizeof( HEAD_TRACK_DATA ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for head-tracking memory\n" ) ); - } - - /* Initialization */ - ( *hHeadTrackData )->num_quaternions = 0; - ( *hHeadTrackData )->lrSwitchInterpVal = 0.0f; - ( *hHeadTrackData )->lrSwitchedCurrent = 0; - ( *hHeadTrackData )->lrSwitchedNext = 0; - - /* Initialise Rmat_prev to I, Rmat will be computed later */ - for ( i = 0; i < 3; i++ ) - { - set_zero( ( *hHeadTrackData )->Rmat_prev[i], 3 ); - ( *hHeadTrackData )->Rmat_prev[i][i] = 1.0f; - } - - return IVAS_ERR_OK; -} diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index a8be0b5ba3..67f73fab30 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -30,6 +30,7 @@ *******************************************************************************************************/ +#include "ivas_stat_rend.h" #include #include "options.h" #include "prot.h" @@ -47,6 +48,9 @@ *---------------------------------------------------------------------*/ static void TDREND_Clear_Update_flags( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd ); +#ifdef TD5 +static void angles_to_vec( const float radius, const float azimuth, const float elevation, float *vec ); +#endif /*---------------------------------------------------------------------* * ivas_td_binaural_open_unwrap() @@ -55,11 +59,14 @@ static void TDREND_Clear_Update_flags( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRe *---------------------------------------------------------------------*/ ivas_error ivas_td_binaural_open_unwrap( - TDREND_HRFILT_FiltSet_t **hHrtfTD, /* i/o: HR filter model (from file or NULL) */ - const int32_t output_Fs, /* i : Output sampling rate */ - const int16_t nchan_transport, /* i : Number of channels */ - const IVAS_FORMAT ivas_format, /* i : IVAS format (ISM/MC) */ - const AUDIO_CONFIG transport_config, /* i : Transport configuration */ + TDREND_HRFILT_FiltSet_t **hHrtfTD, /* i/o: HR filter model (from file or NULL) */ + const int32_t output_Fs, /* i : Output sampling rate */ + const int16_t nchan_transport, /* i : Number of channels */ + const IVAS_FORMAT ivas_format, /* i : IVAS format (ISM/MC) */ + const AUDIO_CONFIG transport_config, /* i : Transport configuration */ +#ifdef TD5 + const float *directivity, /* i : Directivity pattern (used for ISM) */ +#endif const IVAS_OUTPUT_SETUP hTransSetup, /* i : Loudspeaker layout */ BINAURAL_TD_OBJECT_RENDERER_HANDLE *hBinRendererTd, /* o : TD renderer handle */ int32_t *binaural_latency_ns /* i : Binauralization delay */ @@ -168,9 +175,13 @@ ivas_error ivas_td_binaural_open_unwrap( for ( nS = 0; nS < nchan_rend; nS++ ) { /* Set source positions according to loudspeaker layout */ +#ifdef TD5 + angles_to_vec( 1.0f, ls_azimuth[nS], ls_elevation[nS], Pos ); +#else Pos[0] = cosf( ls_elevation[nS] * PI_OVER_180 ) * cosf( ls_azimuth[nS] * PI_OVER_180 ); Pos[1] = cosf( ls_elevation[nS] * PI_OVER_180 ) * sinf( ls_azimuth[nS] * PI_OVER_180 ); Pos[2] = sinf( ls_elevation[nS] * PI_OVER_180 ); +#endif Dir[0] = 1.0f; Dir[1] = 0.0f; Dir[2] = 0.0f; @@ -186,6 +197,35 @@ ivas_error ivas_td_binaural_open_unwrap( TDREND_MIX_SRC_SetDirAtten( pBinRendTd, nS, DirAtten_p ); } } +#ifdef TD5 + if ( ivas_format == ISM_FORMAT ) + { + DirAtten_p = pBinRendTd->DirAtten_p; +#ifdef TD5_FIX_INVALID_MEMORY_ACCESS + if ( NULL == directivity ) + { + DirAtten_p->ConeInnerAngle = 360.0f; /* Front cone */ + DirAtten_p->ConeOuterAngle = 360.0f; /* Back cone */ + DirAtten_p->ConeOuterGain = 1.0f; /* Back attenuation */ + } + else + { + DirAtten_p->ConeInnerAngle = directivity[0]; + DirAtten_p->ConeOuterAngle = directivity[1]; + DirAtten_p->ConeOuterGain = directivity[2]; + } +#else + DirAtten_p->ConeInnerAngle = directivity[0]; + DirAtten_p->ConeOuterAngle = directivity[1]; + DirAtten_p->ConeOuterGain = directivity[2]; +#endif + + for ( nS = 0; nS < nchan_rend; nS++ ) + { + TDREND_MIX_SRC_SetDirAtten( pBinRendTd, nS, DirAtten_p ); + } + } +#endif *hBinRendererTd = pBinRendTd; *binaural_latency_ns = (int32_t) ( ( *hBinRendererTd )->HrFiltSet_p->latency_s * 1000000000.f ); @@ -227,30 +267,20 @@ void ivas_td_binaural_close( *---------------------------------------------------------------------*/ ivas_error ivas_td_binaural_renderer_unwrap( -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - REVERB_HANDLE hReverb, /* i : reverb handle */ -#else - RENDER_CONFIG_DATA *hRenderConfig, /* i : Renderer configuration */ - const int16_t ini_frame, /* i : Initialization frame counter */ -#ifdef FIX_197_CREND_INTERFACE - CREND_WRAPPER_HANDLE hCrendWrapper, /* i : Crend wrapper handle */ -#else - CREND_HANDLE hCrend, /* i : Crend handle */ -#endif -#endif - AUDIO_CONFIG transport_config, /* i : Transport configuration */ -#ifndef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - const int32_t output_Fs, /* i : Output sampling rate */ -#endif + const REVERB_HANDLE hReverb, /* i : Reverberator handle */ + const AUDIO_CONFIG transport_config, /* i : Transport configuration */ BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD binaural object renderer handle */ - const int16_t nchan_transport, /* i : Transport channels (ISms) */ + const int16_t num_src, /* i : number of sources to render */ const int16_t lfe_idx, /* i : LFE channel index */ - IVAS_FORMAT ivas_format, /* i : IVAS format */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ ISM_METADATA_HANDLE *hIsmMetaData, /* i : ISM metadata handle */ const int16_t Opt_Headrotation, /* i : Head rotation flag */ const IVAS_QUATERNION *Quaternions, /* i : Head tracking data per subframe */ - float output[][L_FRAME48k], /* i/o: SCE channels / Binaural synthesis */ - const int16_t output_frame /* i : output frame length */ +#ifdef TD5 + const IVAS_POSITION *Pos, /* i : Listener position data per subframe */ +#endif + float output[][L_FRAME48k], /* i/o: SCE channels / Binaural synthesis */ + const int16_t output_frame /* i : output frame length */ ) { int16_t subframe_length; @@ -259,68 +289,25 @@ ivas_error ivas_td_binaural_renderer_unwrap( ivas_error error; subframe_length = output_frame / MAX_PARAM_SPATIAL_SUBFRAMES; -#ifndef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - if ( hRenderConfig != NULL ) - { - - if ( hRenderConfig->roomAcoustics.late_reverb_on && ( ini_frame == 0 ) ) - { - ivas_reverb_open( -#ifdef FIX_197_CREND_INTERFACE - &hCrendWrapper->hCrend->hReverb, -#else - &hCrend->hReverb, -#endif - transport_config, - NULL, - hRenderConfig, - output_Fs ); - } - } -#endif /* Update object position(s) */ - TDREND_Update_object_positions( hBinRendererTd, nchan_transport, lfe_idx, ivas_format, hIsmMetaData, output ); + TDREND_Update_object_positions( hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, output ); for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { /* Update the listener's location/orientation */ - TDREND_Update_listener_orientation( hBinRendererTd, Opt_Headrotation, ( Quaternions != NULL ) ? &Quaternions[subframe_idx] : NULL ); - -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - if ( ( hReverb != NULL ) && ( hReverb->pConfig.roomAcoustics.late_reverb_on ) ) +#ifdef TD5 + TDREND_Update_listener_orientation( hBinRendererTd, Opt_Headrotation, ( Quaternions != NULL ) ? &Quaternions[subframe_idx] : NULL, ( Pos != NULL ) ? &Pos[subframe_idx] : NULL ); #else - if ( ( hRenderConfig != NULL ) && ( hRenderConfig->roomAcoustics.late_reverb_on ) ) + TDREND_Update_listener_orientation( hBinRendererTd, Opt_Headrotation, ( Quaternions != NULL ) ? &Quaternions[subframe_idx] : NULL ); #endif + + if ( hReverb != NULL && hReverb->pConfig.roomAcoustics.late_reverb_on ) { - if ( ( error = ivas_reverb_process( -#ifdef FIX_197_CREND_INTERFACE -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - hReverb, -#else - hCrendWrapper->hCrend->hReverb, -#endif -#else - hCrend->hReverb, -#endif - transport_config, 0, output, reverb_signal, subframe_idx ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_process( hReverb, transport_config, 0, output, reverb_signal, subframe_idx ) ) != IVAS_ERR_OK ) { return error; } - -#ifndef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - ivas_reverb_process( -#ifdef FIX_197_CREND_INTERFACE - hCrendWrapper->hCrend->hReverb, -#else - hCrend->hReverb, -#endif - transport_config, - 0, - output, - reverb_signal, - subframe_idx ); -#endif } /* Render subframe */ @@ -331,24 +318,12 @@ ivas_error ivas_td_binaural_renderer_unwrap( } -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - if ( ( hReverb != NULL ) && ( hReverb->pConfig.roomAcoustics.late_reverb_on ) ) + if ( hReverb != NULL && hReverb->pConfig.roomAcoustics.late_reverb_on ) { /* add reverb to rendered signals */ v_add( reverb_signal[0], output[0], output[0], output_frame ); v_add( reverb_signal[1], output[1], output[1], output_frame ); } -#else - if ( hRenderConfig != NULL ) /* Renderer Configuration not enabled in TD standalone renderer */ - { - if ( hRenderConfig->roomAcoustics.late_reverb_on ) - { - /* add reverb to rendered signals */ - v_add( reverb_signal[0], output[0], output[0], output_frame ); - v_add( reverb_signal[1], output[1], output[1], output_frame ); - } - } -#endif return IVAS_ERR_OK; } @@ -362,7 +337,7 @@ ivas_error ivas_td_binaural_renderer_unwrap( ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ - float output[][L_FRAME48k], /* i/o: ISm object synth / rendered output in 0,1 */ + float output[][L_FRAME48k], /* i/o: ISM object synth / rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ ) @@ -451,7 +426,7 @@ static void TDREND_Clear_Update_flags( void TDREND_Update_object_positions( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o : TD Renderer handle */ - const int16_t numSources, /* i : Number of sources to render */ + const int16_t num_src, /* i : number of sources to render */ const int16_t lfe_idx, /* i : Input LFE index */ const IVAS_FORMAT in_format, /* i : Format of input sources */ const ISM_METADATA_HANDLE *hIsmMetaData, /* i : Input metadata for ISM objects */ @@ -468,7 +443,7 @@ void TDREND_Update_object_positions( /* For each source, write the frame data to the source object*/ c_indx = 0; - for ( nS = 0; nS < numSources; nS++ ) + for ( nS = 0; nS < num_src; nS++ ) { if ( !( in_format == MC_FORMAT && nS == lfe_idx ) ) /* Skip LFE for MC */ { @@ -482,6 +457,10 @@ void TDREND_Update_object_positions( /* Update the source positions */ /* Source position and direction */ +#ifdef TD5 + angles_to_vec( hIsmMetaData[nS]->radius, hIsmMetaData[nS]->azimuth, hIsmMetaData[nS]->elevation, Pos ); + angles_to_vec( 1.0f, hIsmMetaData[nS]->yaw, hIsmMetaData[nS]->pitch, Dir ); +#else Pos[0] = cosf( hIsmMetaData[nS]->elevation * PI_OVER_180 ) * cosf( hIsmMetaData[nS]->azimuth * PI_OVER_180 ); Pos[1] = cosf( hIsmMetaData[nS]->elevation * PI_OVER_180 ) * sinf( hIsmMetaData[nS]->azimuth * PI_OVER_180 ); Pos[2] = sinf( hIsmMetaData[nS]->elevation * PI_OVER_180 ); @@ -489,6 +468,7 @@ void TDREND_Update_object_positions( Dir[1] = 0.0f; Dir[2] = 0.0f; +#endif /* Source directivity info */ DirAtten_p->ConeInnerAngle = 360.0f; DirAtten_p->ConeOuterAngle = 360.0f; @@ -515,19 +495,29 @@ void TDREND_Update_object_positions( void TDREND_Update_listener_orientation( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD Renderer handle */ const int16_t headRotEnabled, /* i : Headrotation flag */ - const IVAS_QUATERNION *headPosition /* i : Head Position */ +#ifdef TD5 + const IVAS_QUATERNION *headPosition, /* i : Listener orientation */ + const IVAS_POSITION *Pos /* i : Listener Position */ +#else + const IVAS_QUATERNION *headPosition /* i : Head Position */ +#endif ) { +#ifndef TD5 float Pos[3]; +#endif float FrontVec[3]; float UpVec[3]; float Rmat[3][3]; - +#ifdef TD5 + float Pos_p[3]; +#else /* Update the listener's location/orientation */ /* Listener at the origin */ Pos[0] = 0.0f; Pos[1] = 0.0f; Pos[2] = 0.0f; +#endif if ( headRotEnabled ) { @@ -541,6 +531,12 @@ void TDREND_Update_listener_orientation( UpVec[0] = Rmat[2][0]; UpVec[1] = Rmat[2][1]; UpVec[2] = Rmat[2][2]; +#ifdef TD5 + /* Input position */ + Pos_p[0] = ( *Pos ).x; + Pos_p[1] = ( *Pos ).y; + Pos_p[2] = ( *Pos ).z; +#endif } else { @@ -552,10 +548,20 @@ void TDREND_Update_listener_orientation( UpVec[0] = 0.0f; UpVec[1] = 0.0f; UpVec[2] = 1.0f; +#ifdef TD5 + /* Listener at the origin */ + Pos_p[0] = 0.0f; + Pos_p[1] = 0.0f; + Pos_p[2] = 0.0f; +#endif } /* Set the listener position and orientation:*/ +#ifdef TD5 + TDREND_MIX_LIST_SetPos( hBinRendererTd, Pos_p ); +#else TDREND_MIX_LIST_SetPos( hBinRendererTd, Pos ); +#endif TDREND_MIX_LIST_SetOrient( hBinRendererTd, FrontVec, UpVec ); return; @@ -571,6 +577,9 @@ void TDREND_Update_listener_orientation( ivas_error ivas_td_binaural_open_ext( TDREND_WRAPPER *pTDRend, IVAS_REND_AudioConfig inConfig, +#ifdef TD5 + RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ +#endif LSSETUP_CUSTOM_STRUCT *customLsInput, const int32_t outFs ) { @@ -579,6 +588,9 @@ ivas_error ivas_td_binaural_open_ext( IVAS_FORMAT ivas_format; IVAS_OUTPUT_SETUP hTransSetup; ivas_error error; +#ifdef TD5_FIX_INVALID_MEMORY_ACCESS + float *directivity = NULL; +#endif if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) { @@ -592,16 +604,25 @@ ivas_error ivas_td_binaural_open_ext( nchan_transport = customLsInput->num_spk; } -#ifdef FIX_197_CREND_INTERFACE transport_config = getIvasAudioConfigFromRendAudioConfig( inConfig ); -#else - transport_config = rendAudioConfigToIvasAudioConfig( inConfig ); -#endif ivas_format = ( getAudioConfigType( inConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) ? MC_FORMAT : ISM_FORMAT; hTransSetup.ls_azimuth = customLsInput->ls_azimuth; hTransSetup.ls_elevation = customLsInput->ls_elevation; +#ifdef TD5 +#ifdef TD5_FIX_INVALID_MEMORY_ACCESS + if ( NULL != hRendCfg ) + { + directivity = hRendCfg->directivity; + } + + return ivas_td_binaural_open_unwrap( &pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, directivity, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns ); +#else + return ivas_td_binaural_open_unwrap( &pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, hRendCfg->directivity, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns ); +#endif +#else return ivas_td_binaural_open_unwrap( &pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns ); +#endif } @@ -618,28 +639,19 @@ ivas_error ivas_td_binaural_renderer_ext( const LSSETUP_CUSTOM_STRUCT *customLsInput, /* i : Input custom loudspeaker layout */ const IVAS_REND_HeadRotData *headRotData, /* i : Input head positions */ const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */ -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - const REVERB_HANDLE reverb, /* i : reverb handle */ -#endif - const int16_t output_frame, /* i : output frame length */ - float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ + const REVERB_HANDLE hReverb, /* i : Reverberator handle */ + const int16_t output_frame, /* i : output frame length */ + float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ ) { ISM_METADATA_FRAME hIsmMetaDataFrame; ISM_METADATA_HANDLE hIsmMetaData[1]; int16_t lfe_idx; int16_t num_src; -#ifndef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - /* TODO tmu : pass down renderer config struct */ - // float reverb_signal[BINAURAL_CHANNELS][L_FRAME48k]; -#endif IVAS_FORMAT ivas_format; IVAS_REND_AudioConfigType inConfigType; AUDIO_CONFIG transport_config; ivas_error error; -#ifndef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - int32_t output_Fs; -#endif push_wmops( "ivas_td_binaural_renderer_ext" ); @@ -650,9 +662,7 @@ ivas_error ivas_td_binaural_renderer_ext( if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { ivas_format = MC_FORMAT; -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND transport_config = getIvasAudioConfigFromRendAudioConfig( inConfig ); -#endif if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = getAudioConfigNumChannels( inConfig, &num_src ) ) != IVAS_ERR_OK ) @@ -670,38 +680,51 @@ ivas_error ivas_td_binaural_renderer_ext( { ivas_format = ISM_FORMAT; num_src = 1; -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND transport_config = AUDIO_CONFIG_ISM1; -#endif hIsmMetaData[0] = &hIsmMetaDataFrame; hIsmMetaData[0]->azimuth = currentPos->azimuth; hIsmMetaData[0]->elevation = currentPos->elevation; +#ifdef TD5 + hIsmMetaData[0]->yaw = currentPos->yaw; + hIsmMetaData[0]->pitch = currentPos->pitch; + hIsmMetaData[0]->radius = currentPos->radius; +#endif } -#ifndef FIX_330_ENABLE_TD_RENDERER_REVERB_REND -#ifdef FIX_197_CREND_INTERFACE - transport_config = getIvasAudioConfigFromRendAudioConfig( inConfig ); + if ( ( error = ivas_td_binaural_renderer_unwrap( hReverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, headRotData->headRotEnabled, + ( headRotData != NULL ) ? headRotData->headPositions : NULL, +#ifdef TD5 + ( headRotData != NULL ) ? headRotData->Pos : NULL, output, output_frame ) ) != IVAS_ERR_OK ) #else - transport_config = rendAudioConfigToIvasAudioConfig( inConfig ); -#endif - output_Fs = output_frame * 50; + output, output_frame ) ) != IVAS_ERR_OK ) #endif -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - if ( ( error = ivas_td_binaural_renderer_unwrap( reverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, headRotData->headRotEnabled, - ( headRotData != NULL ) ? headRotData->headPositions : NULL, output, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } -#else - if ( ( error = error = ivas_td_binaural_renderer_unwrap( NULL, 1, NULL, transport_config, output_Fs, pTDRend->hBinRendererTd, num_src, lfe_idx, - ivas_format, hIsmMetaData, headRotData->headRotEnabled, ( headRotData != NULL ) ? headRotData->headPositions : NULL, - output, output_frame ) ) != IVAS_ERR_OK ) { return error; } -#endif pop_wmops(); return IVAS_ERR_OK; } + +#ifdef TD5 +/*---------------------------------------------------------------------* + * angles_to_vec() + * + * Convert azimuth and elevation angles to position/orientation vector + *---------------------------------------------------------------------*/ + +static void angles_to_vec( + const float radius, /* i : radius */ + const float azimuth, /* i : Azimuth angle */ + const float elevation, /* i : Elevation angle */ + float *vec /* o : Pos/Dir vector */ +) +{ + vec[0] = radius * cosf( elevation * PI_OVER_180 ) * cosf( azimuth * PI_OVER_180 ); + vec[1] = radius * cosf( elevation * PI_OVER_180 ) * sinf( azimuth * PI_OVER_180 ); + vec[2] = radius * sinf( elevation * PI_OVER_180 ); + + return; +} +#endif diff --git a/lib_rend/ivas_objectRenderer_hrFilt.c b/lib_rend/ivas_objectRenderer_hrFilt.c index 0220b48145..d28abdba30 100644 --- a/lib_rend/ivas_objectRenderer_hrFilt.c +++ b/lib_rend/ivas_objectRenderer_hrFilt.c @@ -69,10 +69,21 @@ ivas_error TDREND_REND_RenderSourceHRFilt( { float LeftOutputFrame[L_SPATIAL_SUBFR_48k]; float RightOutputFrame[L_SPATIAL_SUBFR_48k]; +#ifdef TD5 + float Gain; + + Gain = ( *Src_p->SrcRend_p->DirGain_p ) * ( *Src_p->SrcRend_p->DistGain_p ); +#endif TDREND_Apply_ITD( Src_p->InputFrame_p, LeftOutputFrame, RightOutputFrame, &Src_p->previtd, Src_p->itd, Src_p->mem_itd, subframe_length ); +#ifdef TD5 + TDREND_firfilt( LeftOutputFrame, Src_p->hrf_left_prev, hrf_left_delta, intp_count, Src_p->mem_hrf_left, subframe_length, Src_p->filterlength, Gain ); + TDREND_firfilt( RightOutputFrame, Src_p->hrf_right_prev, hrf_right_delta, intp_count, Src_p->mem_hrf_right, subframe_length, Src_p->filterlength, Gain ); +#else TDREND_firfilt( LeftOutputFrame, Src_p->hrf_left_prev, hrf_left_delta, intp_count, Src_p->mem_hrf_left, subframe_length, Src_p->filterlength ); TDREND_firfilt( RightOutputFrame, Src_p->hrf_right_prev, hrf_right_delta, intp_count, Src_p->mem_hrf_right, subframe_length, Src_p->filterlength ); +#endif + /* Copy to accumulative output frame */ v_add( LeftOutputFrame, output_buf[0], output_buf[0], subframe_length ); v_add( RightOutputFrame, output_buf[1], output_buf[1], subframe_length ); diff --git a/lib_rend/ivas_objectRenderer_sfx.c b/lib_rend/ivas_objectRenderer_sfx.c index 005025827b..72493b0501 100644 --- a/lib_rend/ivas_objectRenderer_sfx.c +++ b/lib_rend/ivas_objectRenderer_sfx.c @@ -182,6 +182,7 @@ static void sincResample( const float *p_sinc_forward; const float *p_sinc_backward; + /* Compute fractional time step */ t_step = (float) ( length_in ) / (float) ( length_out ); t_frac = 0; @@ -234,7 +235,12 @@ void TDREND_firfilt( const int16_t intp_count, /* i : interpolation count */ float *mem, /* i/o: filter memory */ const int16_t subframe_length, /* i : Length of signal */ - const int16_t filterlength /* i : Filter length */ +#ifdef TD5 + const int16_t filterlength, /* i : Filter length */ + const float Gain /* i : Gain */ +#else + const int16_t filterlength /* i : Filter length */ +#endif ) { float buffer[SFX_SPAT_BIN_MAX_FILTER_LENGTH - 1 + L_SUBFRAME5MS_48k]; @@ -260,7 +266,11 @@ void TDREND_firfilt( { tmp += ( *p_filter++ ) * ( *p_tmp-- ); } +#ifdef TD5 + signal[i] = tmp * Gain; +#else signal[i] = tmp; +#endif if ( i < intp_count ) { diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index d524228812..2a13efc24c 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -266,6 +266,9 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( TDREND_MIX_Listener_t *Listener_p; TDREND_HRFILT_FiltSet_t *HrFiltSet_p; float ListRelPos[3], ListRelDist; +#ifdef TD5 + float ListRelPosAbs[3]; /* Relative position, ignoring orientation of listener */ +#endif float Azim, Elev; float hrf_left[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; float hrf_right[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; @@ -287,14 +290,22 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( break; case TDREND_POSTYPE_ABSOLUTE: /* Absolute position */ +#ifdef TD5 + TDREND_SPATIAL_VecMapToNewCoordSystem( SrcSpatial_p->Pos_p, Listener_p->Pos, Listener_p->Front, Listener_p->Up, Listener_p->Right, ListRelPos, ListRelPosAbs ); +#else TDREND_SPATIAL_VecMapToNewCoordSystem( SrcSpatial_p->Pos_p, Listener_p->Pos, Listener_p->Front, Listener_p->Up, Listener_p->Right, ListRelPos ); +#endif break; default: /* Illegal position type */ #ifdef DEBUGGING printf( "Warning! TDREND_SRC_REND_UpdateFiltersFromSpatialParams: Invalid position type. Assuming absolute position!\n" ); #endif /* Assume absolute position */ +#ifdef TD5 + TDREND_SPATIAL_VecMapToNewCoordSystem( SrcSpatial_p->Pos_p, Listener_p->Pos, Listener_p->Front, Listener_p->Up, Listener_p->Right, ListRelPos, ListRelPosAbs ); +#else TDREND_SPATIAL_VecMapToNewCoordSystem( SrcSpatial_p->Pos_p, Listener_p->Pos, Listener_p->Front, Listener_p->Up, Listener_p->Right, ListRelPos ); +#endif break; } @@ -320,7 +331,11 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( *SrcRend_p->DirGain_p = 1.0f; if ( SrcSpatial_p->DirAttenEnabled ) { +#ifdef TD5 + *SrcRend_p->DirGain_p = TDREND_SRC_SPATIAL_GetDirGain( &SrcSpatial_p->DirAtten, SrcSpatial_p->Front_p, ListRelPosAbs ); +#else *SrcRend_p->DirGain_p = TDREND_SRC_SPATIAL_GetDirGain( &SrcSpatial_p->DirAtten, SrcSpatial_p->Front_p, ListRelPos ); +#endif } /* Distance gain */ diff --git a/lib_rend/ivas_objectRenderer_vec.c b/lib_rend/ivas_objectRenderer_vec.c index c3a780c725..f17d769821 100644 --- a/lib_rend/ivas_objectRenderer_vec.c +++ b/lib_rend/ivas_objectRenderer_vec.c @@ -111,9 +111,22 @@ void TDREND_SPATIAL_VecMapToNewCoordSystem( const float *DirVec_p, /* i : Direction vector */ const float *UpVec_p, /* i : Up vector */ const float *RightVec_p, /* i : Right vector */ - float *MappedVec_p /* o : Transformed vector */ +#ifdef TD5 + float *MappedVec_p, /* o : Transformed vector */ + float *LisRelPosAbs /* o : Transformed vector ignoring orientation */ +#else + float *MappedVec_p /* o : Transformed vector */ +#endif ) { +#ifdef TD5 + v_sub( Vec_p, TranslVec_p, LisRelPosAbs, 3 ); + /* Evalute the relative Vec in the coordinates of the Orientation vectors, */ + /* which form an orthonormal basis */ + MappedVec_p[0] = dotp( LisRelPosAbs, DirVec_p, 3 ); + MappedVec_p[1] = dotp( LisRelPosAbs, RightVec_p, 3 ); + MappedVec_p[2] = dotp( LisRelPosAbs, UpVec_p, 3 ); +#else float RelVec[3]; /* Evaluate Vec relative to the new origin given by TranslVec */ @@ -124,7 +137,7 @@ void TDREND_SPATIAL_VecMapToNewCoordSystem( MappedVec_p[0] = dotp( RelVec, DirVec_p, 3 ); MappedVec_p[1] = dotp( RelVec, RightVec_p, 3 ); MappedVec_p[2] = dotp( RelVec, UpVec_p, 3 ); - +#endif return; } diff --git a/lib_rend/ivas_orient_trk.c b/lib_rend/ivas_orient_trk.c index 4eec8ecd56..af71cbf543 100644 --- a/lib_rend/ivas_orient_trk.c +++ b/lib_rend/ivas_orient_trk.c @@ -30,6 +30,7 @@ *******************************************************************************************************/ +#include "common_api_types.h" #include #include "options.h" #include "ivas_prot.h" @@ -49,15 +50,332 @@ #define MAX_TRACKED_ANGLE_AVG_ORIENT PI_OVER_2 #define MAX_TRACKED_ANGLE_REF_ORIENT EVS_PI - -/* TODO relate to frame rate - assumed here 50Hz, i.e. 20ms frame length */ -#define OTR_UPDATE_RATE ( 50.0f ) /* rate of the Process() calls [Hz]; 1x per IVAS frame */ +#define OTR_UPDATE_RATE (float) FRAMES_PER_SEC /* rate of the Process() calls [Hz]; 1x per IVAS frame */ /*------------------------------------------------------------------------------------------* * Local functions *------------------------------------------------------------------------------------------*/ +#ifdef FIX_I109_ORIENTATION_TRACKING +/*------------------------------------------------------------------------------------------* + * IdentityQuaternion() + * + * + *------------------------------------------------------------------------------------------*/ + +static IVAS_QUATERNION IdentityQuaternion( + void ) +{ + IVAS_QUATERNION q; + + q.w = 1.0f; + q.x = q.y = q.z = 0.0f; + + return q; +} + + +/*------------------------------------------------------------------------------------------* + * QuaternionProduct() + * + * Quaternion product + *------------------------------------------------------------------------------------------*/ + +static void QuaternionProduct( + const IVAS_QUATERNION q1, + const IVAS_QUATERNION q2, + IVAS_QUATERNION *const r ) +{ + IVAS_QUATERNION tmp; + tmp.w = q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z; + tmp.x = q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y; + tmp.y = q1.w * q2.y - q1.x * q2.z + q1.y * q2.w + q1.z * q2.x; + tmp.z = q1.w * q2.z + q1.x * q2.y - q1.y * q2.x + q1.z * q2.w; + + *r = tmp; + + return; +} + +/*------------------------------------------------------------------------------------------* + * QuaternionDotProduct() + * + * Quaternion dot product + *------------------------------------------------------------------------------------------*/ + +static float QuaternionDotProduct( + const IVAS_QUATERNION q1, + const IVAS_QUATERNION q2 ) +{ + return q1.x * q2.x + q1.y * q2.y + q1.z * q2.z + q1.w * q2.w; +} + + +/*------------------------------------------------------------------------------------------* + * QuaternionDivision() + * + * Divides a quaternion by a scalar + *------------------------------------------------------------------------------------------*/ + +static void QuaternionDivision( + const IVAS_QUATERNION q, + const float d, + IVAS_QUATERNION *const r ) +{ + r->w = q.w / d; + r->x = q.x / d; + r->y = q.y / d; + r->z = q.z / d; + + return; +} + + +/*------------------------------------------------------------------------------------------* + * QuaternionNormalize() + * + * Normalizes a quaternion + *------------------------------------------------------------------------------------------*/ + +static void QuaternionNormalize( + const IVAS_QUATERNION q, + IVAS_QUATERNION *const r ) +{ + QuaternionDivision( q, sqrtf( QuaternionDotProduct( q, q ) ), r ); + + return; +} + + +/*------------------------------------------------------------------------------------------* + * QuaternionSlerp() + * + * Computes a spherical linear interpolation between two quaternions + *------------------------------------------------------------------------------------------*/ + +static void QuaternionSlerp( + const IVAS_QUATERNION q1, + const IVAS_QUATERNION q2, + const float t, + IVAS_QUATERNION *const r ) +{ + float angle, denom, s, s2; + + s = QuaternionDotProduct( q1, q2 ); + + if ( fabsf( s ) >= 1.0f ) + { + *r = q2; + return; + } + + angle = acosf( s ); + denom = sinf( angle ); + + s = sinf( ( 1 - t ) * angle ); + s2 = sinf( t * angle ); + r->x = ( q1.x * s + q2.x * s2 ) / denom; + r->y = ( q1.y * s + q2.y * s2 ) / denom; + r->z = ( q1.z * s + q2.z * s2 ) / denom; + r->w = ( q1.w * s + q2.w * s2 ) / denom; + + QuaternionNormalize( *r, r ); + + return; +} + + +/*------------------------------------------------------------------------------------------* + * QuaternionConjugate() + * + * Computes a quaternion conjugate + *------------------------------------------------------------------------------------------*/ + +static void QuaternionConjugate( + const IVAS_QUATERNION q, + IVAS_QUATERNION *const r ) +{ + r->w = q.w; + r->x = -q.x; + r->y = -q.y; + r->z = -q.z; + + return; +} + + +/*------------------------------------------------------------------------------------------* + * QuaternionAngle() + * + * Computes an angle between two quaternions + *------------------------------------------------------------------------------------------*/ + +static float QuaternionAngle( + const IVAS_QUATERNION q1, + const IVAS_QUATERNION q2 ) +{ + IVAS_QUATERNION q12; + float angle; + + QuaternionConjugate( q1, &q12 ); + QuaternionProduct( q12, q2, &q12 ); + angle = 2.0f * atan2f( sqrtf( q12.x * q12.x + q12.y * q12.y + q12.z * q12.z ), q12.w ); + + return angle; +} + + +/*------------------------------------------------------------------------------------------* + * QuaternionInverse() + * + * Computes an inverse quaternion + *------------------------------------------------------------------------------------------*/ + +static void QuaternionInverse( + const IVAS_QUATERNION q, + IVAS_QUATERNION *const r ) +{ + float dot_product; + + dot_product = QuaternionDotProduct( q, q ); + QuaternionConjugate( q, r ); + QuaternionDivision( *r, dot_product, r ); + + return; +} + + +#ifdef OTR_REFERENCE_VECTOR_TRACKING +/*------------------------------------------------------------------------------------------* + * VectorSubtract() + * + * Computes the difference of two vectors + *------------------------------------------------------------------------------------------*/ + +static IVAS_VECTOR3 VectorSubtract( + const IVAS_VECTOR3 p1, + const IVAS_VECTOR3 p2 ) +{ + IVAS_VECTOR3 result; + + result.x = p1.x - p2.x; + result.y = p1.y - p2.y; + result.z = p1.z - p2.z; + + return result; +} + + +/*------------------------------------------------------------------------------------------* + * VectorCrossProduct() + * + * Computes the cross product of two vectors + *------------------------------------------------------------------------------------------*/ + +static IVAS_VECTOR3 VectorCrossProduct( + const IVAS_VECTOR3 p1, + const IVAS_VECTOR3 p2 ) +{ + IVAS_VECTOR3 result; + result.x = p1.y * p2.z - p1.z * p2.y; + result.y = p1.z * p2.x - p1.x * p2.z; + result.z = p1.x * p2.y - p1.y * p2.x; + + return result; +} + + +/*------------------------------------------------------------------------------------------* + * VectorDotProduct( + * + * Computes the dot product of two vectors + *------------------------------------------------------------------------------------------*/ + +static float VectorDotProduct( + const IVAS_VECTOR3 p1, + const IVAS_VECTOR3 p2 ) +{ + return p1.x * p2.x + p1.y * p2.y + p1.z * p2.z; +} + + +/*------------------------------------------------------------------------------------------* + * VectorLength() + * + * Computes the length of a vector + *------------------------------------------------------------------------------------------*/ + +static float VectorLength( + const IVAS_VECTOR3 p ) +{ + return sqrtf( p.x * p.x + p.y * p.y + p.z * p.z ); +} + + +/*------------------------------------------------------------------------------------------* + * VectorNormalize() + * + * Normalizes a vector + *------------------------------------------------------------------------------------------*/ + +static IVAS_VECTOR3 VectorNormalize( + const IVAS_VECTOR3 p ) +{ + IVAS_VECTOR3 result; + + const float length = VectorLength( p ); + + result.x = p.x / length; + result.y = p.y / length; + result.z = p.z / length; + + return result; +} + + +/*------------------------------------------------------------------------------------------* + * VectorRotationToQuaternion() + * + * Computes a quaternion representing the rotation from vector p1 to vector p2 + *------------------------------------------------------------------------------------------*/ + +static void VectorRotationToQuaternion( + const IVAS_VECTOR3 p1, + const IVAS_VECTOR3 p2, + IVAS_QUATERNION *const r ) +{ + float dot_product; + IVAS_VECTOR3 cross_product, p1_normalized, p2_normalized; + + p1_normalized = VectorNormalize( p1 ); + p2_normalized = VectorNormalize( p2 ); + cross_product = VectorCrossProduct( p1_normalized, p2_normalized ); + dot_product = VectorDotProduct( p1_normalized, p2_normalized ); + + if ( dot_product < -0.999999 ) + { + /* happens when the p1 vector is parallel to p2, but direction is flipped */ + r->w = 0.0f; + r->x = 0.0f; + r->y = 0.0f; + r->z = 1.0f; + } + else + { + /* all regular cases */ + r->x = cross_product.x; + r->y = cross_product.y; + r->z = cross_product.z; + r->w = 1.0f + dot_product; + } + + QuaternionNormalize( *r, r ); + + return; +} +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ +#else static float ClipAngle( const float angle, const float min_angle, @@ -95,6 +413,7 @@ static float ClipAngle( return result; } +#endif /*-------------------------------------------------------------------* * ivas_orient_trk_Init() @@ -102,11 +421,27 @@ static float ClipAngle( * *-------------------------------------------------------------------*/ +#ifdef FIX_I109_ORIENTATION_TRACKING +ivas_error ivas_orient_trk_Init( +#else void ivas_orient_trk_Init( - ivas_orient_trk_state_t *pOTR ) +#endif + ivas_orient_trk_state_t *pOTR ) /* i/o : orientation tracker handle */ { +#ifdef FIX_I109_ORIENTATION_TRACKING + IVAS_QUATERNION identity; + + if ( pOTR == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + identity.w = 1.0f; + identity.x = identity.y = identity.z = 0.0f; +#else /* Track relative to a reference orientation */ pOTR->trackingType = OTR_TRACKING_REF_ORIENT; +#endif /* configuration parameters */ pOTR->centerAdaptationRate = 1.0f / 30.0f; @@ -116,6 +451,19 @@ void ivas_orient_trk_Init( /* initial adaptivity filter coefficient, will be auto-adapted */ pOTR->alpha = sinf( PI2 * pOTR->offCenterAdaptationRate / OTR_UPDATE_RATE ); /* start adaptation at off-center rate = fastest rate */ +#ifdef FIX_I109_ORIENTATION_TRACKING +#ifdef OTR_REFERENCE_VECTOR_TRACKING + pOTR->trkRot = identity; +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ + pOTR->absAvgRot = identity; + /* Use frontal and horiontal orientation as reference orientation, unless/until overridden */ + pOTR->refRot = identity; + + /* set safe default tracking mode */ + pOTR->trackingType = OTR_TRACKING_NONE; + + return IVAS_ERR_OK; +#else pOTR->absYaw = 0.0f; pOTR->absPitch = 0.0f; pOTR->absRoll = 0.0f; @@ -135,6 +483,7 @@ void ivas_orient_trk_Init( pOTR->trkRoll = 0.0f; return; +#endif } @@ -144,16 +493,178 @@ void ivas_orient_trk_Init( * *-------------------------------------------------------------------*/ +#ifdef FIX_I109_ORIENTATION_TRACKING +ivas_error ivas_orient_trk_SetTrackingType( + ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ + const OTR_TRACKING_T trackingType /* i/o: orientation tracking type */ +) +{ + if ( pOTR == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + pOTR->trackingType = trackingType; + + return IVAS_ERR_OK; +} +#else void ivas_orient_trk_SetTrackingType( - ivas_orient_trk_state_t *pOTR, - const OTR_TRACKING_T trackingType ) + ivas_orient_trk_state_t *pOTR, /* i/o : orientation tracker handle */ + const OTR_TRACKING_T trackingType ) /* i/o : orientation tracking type */ { pOTR->trackingType = trackingType; +} +#endif - return; +#ifdef FIX_I109_ORIENTATION_TRACKING +/*-------------------------------------------------------------------* + * ivas_orient_trk_SetReferenceRotation() + * + * + *-------------------------------------------------------------------*/ + +ivas_error ivas_orient_trk_SetReferenceRotation( + ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ + const IVAS_QUATERNION refRot /* i : reference rotation */ +) +{ + if ( pOTR == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + /* check for Euler angle signaling */ + if ( refRot.w == -3.0f ) + { + Euler2Quat( deg2rad( refRot.x ), deg2rad( refRot.y ), deg2rad( refRot.z ), &pOTR->refRot ); + } + else + { + pOTR->refRot = refRot; + } + + return IVAS_ERR_OK; +} + + +/*-------------------------------------------------------------------* + * ivas_orient_trk_GetMainOrientation() + * + * + *-------------------------------------------------------------------*/ + +ivas_error ivas_orient_trk_GetMainOrientation( + ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ + IVAS_QUATERNION *pOrientation /* i/o: average/reference orientation */ +) +{ + if ( pOTR == NULL || pOrientation == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + switch ( pOTR->trackingType ) + { + case OTR_TRACKING_NONE: + *pOrientation = IdentityQuaternion(); + break; +#ifdef OTR_REFERENCE_VECTOR_TRACKING + case OTR_TRACKING_REF_VEC: + case OTR_TRACKING_REF_VEC_LEV: +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ + case OTR_TRACKING_REF_ORIENT: + *pOrientation = pOTR->refRot; + break; + case OTR_TRACKING_AVG_ORIENT: + *pOrientation = pOTR->absAvgRot; + break; + } + + return IVAS_ERR_OK; +} + + +/*-------------------------------------------------------------------* + * ivas_orient_trk_GetTrackedRotation() + * + * + *-------------------------------------------------------------------*/ + +ivas_error ivas_orient_trk_GetTrackedRotation( + ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ + IVAS_QUATERNION *pRotation /* i/o: processed rotation */ +) +{ + if ( pOTR == NULL || pRotation == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + *pRotation = pOTR->trkRot; + + return IVAS_ERR_OK; } +#ifdef OTR_REFERENCE_VECTOR_TRACKING +/*-------------------------------------------------------------------* + * ivas_orient_trk_SetReferenceVector() + * + * + *-------------------------------------------------------------------*/ + +ivas_error ivas_orient_trk_SetReferenceVector( + ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ + const IVAS_VECTOR3 listenerPos, /* i : Listener position */ + const IVAS_VECTOR3 refPos /* i : Reference position */ +) +{ + IVAS_VECTOR3 acousticFrontVector, ivasForwardVector; + IVAS_VECTOR3 listenerPosLevel, refPosLevel; + float acousticFrontVectorLength; + + if ( pOTR == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + switch ( pOTR->trackingType ) + { + case OTR_TRACKING_NONE: + case OTR_TRACKING_REF_ORIENT: + case OTR_TRACKING_AVG_ORIENT: + case OTR_TRACKING_REF_VEC: + acousticFrontVector = VectorSubtract( listenerPos, refPos ); + break; + case OTR_TRACKING_REF_VEC_LEV: + /* ignore the height difference between listener position and reference position */ + listenerPosLevel.z = refPosLevel.z = listenerPos.z; + listenerPosLevel.x = listenerPos.x; + listenerPosLevel.y = listenerPos.y; + refPosLevel.x = refPos.x; + refPosLevel.y = refPos.y; + acousticFrontVector = VectorSubtract( listenerPosLevel, refPosLevel ); + break; + default: + return IVAS_ERR_WRONG_PARAMS; + } + + acousticFrontVectorLength = VectorLength( acousticFrontVector ); + + /* if the length is zero, the user has entered insensible listener and reference positions */ + if ( acousticFrontVectorLength < 0.0001f ) + { + return IVAS_ERR_WRONG_PARAMS; + } + + ivasForwardVector.x = -1.0f; + ivasForwardVector.y = 0.0f; + ivasForwardVector.z = 0.0f; + VectorRotationToQuaternion( ivasForwardVector, acousticFrontVector, &pOTR->refRot ); + + return IVAS_ERR_OK; +} +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ +#else /*-------------------------------------------------------------------* * ivas_orient_trk_SetAbsoluteOrientation() * @@ -173,6 +684,7 @@ void ivas_orient_trk_SetAbsoluteOrientation( return; } +#endif /*-------------------------------------------------------------------* @@ -181,6 +693,99 @@ void ivas_orient_trk_SetAbsoluteOrientation( * *-------------------------------------------------------------------*/ +#ifdef FIX_I109_ORIENTATION_TRACKING +ivas_error ivas_orient_trk_Process( + ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ + IVAS_QUATERNION absRot, /* i : absolute head rotation */ + float updateRate, /* i : rotation update rate [Hz] */ + IVAS_QUATERNION *pTrkRot /* o : tracked rotation */ +) +{ + float normalizedOrientation; + float relativeOrientationRate; + float rateRange; + float cutoffFrequency; + float alpha = pOTR->alpha; + float ang; + ivas_error result; + + if ( pOTR == NULL || pTrkRot == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + result = IVAS_ERR_OK; + + switch ( pOTR->trackingType ) + { + case OTR_TRACKING_NONE: + pOTR->trkRot = absRot; + break; +#ifdef OTR_REFERENCE_VECTOR_TRACKING + case OTR_TRACKING_REF_VEC: + case OTR_TRACKING_REF_VEC_LEV: +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ + case OTR_TRACKING_REF_ORIENT: + /* Reset average orientation */ + pOTR->absAvgRot = absRot; + + /* Reset adaptation filter - start adaptation at center rate */ + pOTR->alpha = sinf( 2.0f * EVS_PI * pOTR->centerAdaptationRate / updateRate ); + + /* Compute relative orientation = (absolute orientation) - (reference orientation) */ + QuaternionInverse( pOTR->refRot, &pOTR->trkRot ); + QuaternionProduct( pOTR->trkRot, absRot, &pOTR->trkRot ); + break; + + case OTR_TRACKING_AVG_ORIENT: + /* Compute average (low-pass filtered) absolute orientation */ + QuaternionSlerp( pOTR->absAvgRot, absRot, alpha, &pOTR->absAvgRot ); + + /* Compute relative orientation = (absolute orientation) - (average absolute orientation) */ + QuaternionInverse( pOTR->absAvgRot, &pOTR->trkRot ); + QuaternionProduct( pOTR->trkRot, absRot, &pOTR->trkRot ); + + /* Adapt LPF constant based on orientation excursion relative to current mean: + - low cutoff (slow adaptation) for small excursions (around center) + - high cutoff (fast adaptation) for large excursions (off-center) + */ + ang = QuaternionAngle( absRot, pOTR->trkRot ); + normalizedOrientation = ang * ang; + + relativeOrientationRate = sqrtf( normalizedOrientation ) / pOTR->adaptationAngle; + /* 'if' assumed to perform comparison to 0 */ + if ( relativeOrientationRate > 1.0f ) + { + relativeOrientationRate = 1.0f; + } + + /* Compute range of the adaptation rate between center = lower rate and off-center = higher rate */ + rateRange = pOTR->offCenterAdaptationRate - pOTR->centerAdaptationRate; + /* 'if' assumed to perform comparison to 0 */ + if ( rateRange < 0.0f ) + { + rateRange = 0.0f; + } + + /* Compute adaptivity cutoff frequency: interpolate between minimum (center) and maximum (off-center) values */ + cutoffFrequency = pOTR->centerAdaptationRate + ( relativeOrientationRate * rateRange ); + + /* Compute filter coefficient corresponding to desired cutoff frequency */ + pOTR->alpha = sinf( 2.0f * EVS_PI * cutoffFrequency / updateRate ); + break; + default: + result = IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Non-supported orientation tracking adaptation type" ); + break; + } + + if ( result == IVAS_ERR_OK ) + { + *pTrkRot = pOTR->trkRot; + } + + return result; +} +#else ivas_error ivas_orient_trk_Process( ivas_orient_trk_state_t *pOTR ) { @@ -314,3 +919,4 @@ void ivas_orient_trk_GetTrackedOrientation( return; } +#endif diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 9e92e45d57..4c79280a86 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -54,11 +54,7 @@ ivas_error getAudioConfigNumChannels( int16_t *numChannels ); -#ifdef FIX_197_CREND_INTERFACE AUDIO_CONFIG getIvasAudioConfigFromRendAudioConfig( -#else -AUDIO_CONFIG rendAudioConfigToIvasAudioConfig( -#endif IVAS_REND_AudioConfig rendConfig ); IVAS_REND_AudioConfig getRendAudioConfigFromIvasAudioConfig( @@ -216,28 +212,18 @@ void ivas_HRTF_CRend_binary_close( *----------------------------------------------------------------------------------*/ ivas_error ivas_td_binaural_renderer_unwrap( -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - REVERB_HANDLE hReverb, /* i : reverb handle */ -#else - RENDER_CONFIG_DATA *hRenderConfig, /* i : Renderer configuration */ - const int16_t ini_frame, /* i : Initialization frame counter */ -#ifdef FIX_197_CREND_INTERFACE - CREND_WRAPPER_HANDLE hCrendWrapper, /* i : Crend wrapper handle */ -#else - CREND_HANDLE hCrend, /* i : Crend handle */ -#endif -#endif - AUDIO_CONFIG transport_config, /* i : Transport configuration */ -#ifndef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - const int32_t output_Fs, /* i : Output sampling rate */ -#endif + const REVERB_HANDLE hReverb, /* i : Reverberator handle */ + const AUDIO_CONFIG transport_config, /* i : Transport configuration */ BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD binaural object renderer handle */ - const int16_t nchan_transport, /* i : Transport channels (ISms) */ + const int16_t num_src, /* i : number of sources to render */ const int16_t lfe_idx, /* i : LFE channel index */ - IVAS_FORMAT ivas_format, /* i : IVAS format */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ ISM_METADATA_HANDLE *hIsmMetaData, /* i : ISM metadata handle */ const int16_t Opt_Headrotation, /* i : Head rotation flag */ const IVAS_QUATERNION *Quaternions, /* i : Head tracking data per subframe */ +#ifdef TD5 + const IVAS_POSITION *Pos, /* i : Listener position data per subframe */ +#endif float output[][L_FRAME48k], /* i/o: SCE channels / Binaural synthesis */ const int16_t output_frame /* i : output frame length */ ); @@ -248,9 +234,7 @@ ivas_error ivas_td_binaural_renderer_ext( const LSSETUP_CUSTOM_STRUCT *customLsInput, /* i : Input custom loudspeaker layout */ const IVAS_REND_HeadRotData *headRotData, /* i : Input head positions */ const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */ -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - const REVERB_HANDLE reverb, /* i : reverb handle */ -#endif + const REVERB_HANDLE hReverb, /* i : Reverberator handle */ const int16_t output_frame, /* i : output frame length */ float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ ); @@ -261,6 +245,9 @@ ivas_error ivas_td_binaural_open_unwrap( const int16_t nchan_transport, /* i : Number of channels */ const IVAS_FORMAT ivas_format, /* i : IVAS format (ISM/MC) */ const AUDIO_CONFIG transport_config, /* i : Transport configuration */ +#ifdef TD5 + const float *directivity, /* i : Directivity pattern (used for ISM) */ +#endif const IVAS_OUTPUT_SETUP hTransSetup, /* i : Loudspeaker layout */ BINAURAL_TD_OBJECT_RENDERER_HANDLE *hBinRendererTd, /* o : TD renderer handle */ int32_t *binaural_latency_ns /* i : Binauralization delay */ @@ -269,6 +256,9 @@ ivas_error ivas_td_binaural_open_unwrap( ivas_error ivas_td_binaural_open_ext( TDREND_WRAPPER *pTDRend, const IVAS_REND_AudioConfig inConfig, +#ifdef TD5 + RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ +#endif LSSETUP_CUSTOM_STRUCT *customLsInput, const int32_t output_Fs ); @@ -280,7 +270,7 @@ void ivas_td_binaural_close( ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ - float output[][L_FRAME48k], /* i/o: ISm object synth / rendered output in 0,1 */ + float output[][L_FRAME48k], /* i/o: ISM object synth / rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ ); @@ -288,12 +278,17 @@ ivas_error TDREND_GetMix( void TDREND_Update_listener_orientation( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD Renderer handle */ const int16_t headRotEnabled, /* i : Headrotation flag */ +#ifdef TD5 + const IVAS_QUATERNION *headPosition, /* i : Listener orientation */ + const IVAS_POSITION *Pos /* i : Listener Position */ +#else const IVAS_QUATERNION *headPosition /* i : Head Position */ +#endif ); void TDREND_Update_object_positions( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o : TD Renderer handle */ - const int16_t numSources, /* i : Number of sources to render */ + const int16_t num_src, /* i : number of sources to render */ const int16_t lfe_idx, /* i : Input LFE index */ const IVAS_FORMAT in_format, /* i : Format of input sources */ const ISM_METADATA_HANDLE *hIsmMetaData, /* i : Input metadata for ISM objects */ @@ -409,7 +404,12 @@ void TDREND_SPATIAL_VecMapToNewCoordSystem( const float *DirVec_p, /* i : Direction vector */ const float *UpVec_p, /* i : Up vector */ const float *RightVec_p, /* i : Right vector */ +#ifdef TD5 + float *MappedVec_p, /* o : Transformed vector */ + float *LisRelPosAbs /* o : Transformed vector ignoring orientation */ +#else float *MappedVec_p /* o : Transformed vector */ +#endif ); /*! r: Flag if the orientation has been updated */ @@ -475,7 +475,12 @@ void TDREND_firfilt( const int16_t intp_count, /* i : interpolation count */ float *mem, /* i/o: filter memory */ const int16_t subframe_length, /* i : Length of signal */ +#ifdef TD5 + const int16_t filterlength, /* i : Filter length */ + const float Gain /* i : Gain */ +#else const int16_t filterlength /* i : Filter length */ +#endif ); @@ -484,59 +489,35 @@ void TDREND_firfilt( *----------------------------------------------------------------------------------*/ ivas_error ivas_rend_openCrend( -#ifdef FIX_197_CREND_INTERFACE CREND_WRAPPER_HANDLE *pCrend, -#else - CREND_WRAPPER *pCrend, -#endif const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, -#ifdef FIX_197_CREND_INTERFACE +#ifndef FIX_I109_ORIENTATION_TRACKING int16_t Opt_Headrotation, #endif HRTFS_CREND_HANDLE hSetOfHRTF, const int32_t output_Fs ); -#ifdef FIX_197_CREND_INTERFACE void ivas_rend_closeCrend( CREND_WRAPPER_HANDLE *pCrend ); -#else -ivas_error ivas_rend_closeCrend( - CREND_WRAPPER *pCrend ); -#endif -#ifdef FIX_329_ENABLE_TD_RENDERER_REVERB_MC ivas_error ivas_rend_initCrendWrapper( CREND_WRAPPER_HANDLE *pCrend ); -#endif ivas_error ivas_rend_crendProcess( const CREND_WRAPPER *pCrend, const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, -#ifdef FIX_197_CREND_INTERFACE DECODER_CONFIG_HANDLE hDecoderConfig, HEAD_TRACK_DATA_HANDLE hHeadTrackData, IVAS_OUTPUT_SETUP_HANDLE hIntSetup, EFAP_HANDLE hEFAPdata, -#endif float output[][L_FRAME48k], /* i/o: input/output audio channels */ const int32_t output_Fs ); -#ifndef FIX_197_CREND_INTERFACE - -ivas_error ivas_crend_init_from_setofhrtf( - Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ -); - -ivas_error ivas_crend_init_from_hrtf_handle( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - HRTFS_HANDLE hrtf); - -#endif @@ -600,12 +581,12 @@ void ivas_reverb_close( ); ivas_error ivas_reverb_process( - REVERB_HANDLE hReverb, /* i/o: reverb state */ + const REVERB_HANDLE hReverb, /* i : Reverberator handle */ const AUDIO_CONFIG input_audio_config, /* i : reverb. input audio configuration */ const int16_t mix_signals, /* i : add reverb to output signal */ float pcm_in[][L_FRAME48k], /* i : the PCM audio to apply reverb on */ float pcm_out[][L_FRAME48k], /* o : the PCM audio with reverb applied */ - const int16_t i_ts + const int16_t i_ts /* i : subframe index */ ); void ivas_rev_delay_line_init( @@ -790,12 +771,29 @@ ivas_error ivas_headTrack_open( HEAD_TRACK_DATA_HANDLE *hHeadTrackData /* o : head track handle */ ); +#ifdef FIX_I109_ORIENTATION_TRACKING +void ivas_headTrack_close( + HEAD_TRACK_DATA_HANDLE *hHeadTrackData /* i/o: head track handle */ +); + +void Euler2Quat( + const float yaw, /* i : yaw (x) */ + const float pitch, /* i : pitch (y) */ + const float roll, /* i : roll (z) */ + IVAS_QUATERNION *quat /* o : quaternion describing the rotation */ +); + +float deg2rad( float degrees ); + +#else void Quat2Euler( - const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ - float *yaw, /* o : yaw */ - float *pitch, /* o : pitch */ - float *roll /* o : roll */ + const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ + float *yaw, /* o : yaw (z) */ + float *pitch, /* o : pitch (y) */ + float *roll /* o : roll (x) */ ); +#endif + void QuatToRotMat( const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ @@ -874,15 +872,57 @@ ivas_error ivas_render_config_init_from_rom( * Orientation tracking *----------------------------------------------------------------------------------*/ -void ivas_orient_trk_Init( - ivas_orient_trk_state_t *pOTR +#ifdef FIX_I109_ORIENTATION_TRACKING +ivas_error ivas_orient_trk_Init( +#else +void ivas_orient_trk_Init( +#endif + ivas_orient_trk_state_t *pOTR /* i/o: orientation tracker handle */ ); -void ivas_orient_trk_SetTrackingType( - ivas_orient_trk_state_t *pOTR, - const OTR_TRACKING_T trackingType +#ifdef FIX_I109_ORIENTATION_TRACKING +ivas_error ivas_orient_trk_SetTrackingType( +#else +void ivas_orient_trk_SetTrackingType( +#endif + ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ + const OTR_TRACKING_T trackingType /* i : orientation tracking type */ ); +#ifdef FIX_I109_ORIENTATION_TRACKING +ivas_error ivas_orient_trk_SetReferenceRotation( + ivas_orient_trk_state_t *pOTR, /* i/o: orientatoin trakcer handle */ + const IVAS_QUATERNION refRot /* i : reference rotation */ +); + +#ifdef OTR_REFERENCE_VECTOR_TRACKING +ivas_error ivas_orient_trk_SetReferenceVector( + ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ + const IVAS_VECTOR3 listenerPos, /* i : Listener position */ + const IVAS_VECTOR3 refPos /* i : Reference position */ +); +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ + +ivas_error ivas_orient_trk_GetMainOrientation( + ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ + IVAS_QUATERNION *pOrientation /* i/o: average/reference orientation */ +); + +ivas_error ivas_orient_trk_GetTrackedRotation( + ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ + IVAS_QUATERNION *pRotation /* i/o: processed rotation */ +); +#endif + +#ifdef FIX_I109_ORIENTATION_TRACKING +ivas_error ivas_orient_trk_Process( + ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ + IVAS_QUATERNION absRot, /* i : absolute head rotation */ + float updateRate, /* i : rotation update rate [Hz] */ + IVAS_QUATERNION *pTrkRot /* o : tracked rotation */ +); + +#else void ivas_orient_trk_SetAbsoluteOrientation( ivas_orient_trk_state_t *pOTR, const float yaw, @@ -891,7 +931,7 @@ void ivas_orient_trk_SetAbsoluteOrientation( ); ivas_error ivas_orient_trk_Process( - ivas_orient_trk_state_t *pOTR + ivas_orient_trk_state_t *pOTR ); void ivas_orient_trk_GetTrackedOrientation( @@ -900,6 +940,7 @@ void ivas_orient_trk_GetTrackedOrientation( float *pitch, float *roll ); +#endif /* clang-format on */ #endif /* IVAS_PROT_REND_H */ diff --git a/lib_rend/ivas_render_config.c b/lib_rend/ivas_render_config.c index ccee4ffe72..2fdbeff0eb 100644 --- a/lib_rend/ivas_render_config.c +++ b/lib_rend/ivas_render_config.c @@ -103,6 +103,7 @@ ivas_error ivas_render_config_init_from_rom( const int16_t room_flag_on /* i : room effect on/off flag */ ) { + if ( hRenderConfig == NULL || *hRenderConfig == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Unexpected null pointer while attempting to fill renderer configuration from ROM" ); @@ -125,5 +126,11 @@ ivas_error ivas_render_config_init_from_rom( mvr2r( ivas_reverb_default_RT60, ( *hRenderConfig )->roomAcoustics.pAcoustic_rt60, IVAS_REVERB_DEFAULT_N_BANDS ); mvr2r( ivas_reverb_default_DSR, ( *hRenderConfig )->roomAcoustics.pAcoustic_dsr, IVAS_REVERB_DEFAULT_N_BANDS ); +#ifdef TD5 + ( *hRenderConfig )->directivity[0] = 360.0f; /* Front cone */ + ( *hRenderConfig )->directivity[1] = 360.0f; /* Back cone */ + ( *hRenderConfig )->directivity[2] = 1.0f; /* Back attenuation */ +#endif + return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index 3911c36601..7dc05cff09 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -675,34 +675,34 @@ static ivas_error calc_jot_t60_coeffs( *-----------------------------------------------------------------------------------------*/ static ivas_error initialize_reverb_filters( - REVERB_HANDLE pState ) + REVERB_HANDLE hReverb ) { ivas_error error; error = IVAS_ERR_OK; /* init correlation and coloration filters */ - if ( ( error = ivas_reverb_t2f_f2t_init( &pState->fft_filter_ols, pState->fft_size, pState->fft_subblock_size ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_t2f_f2t_init( &hReverb->fft_filter_ols, hReverb->fft_size, hReverb->fft_subblock_size ) ) != IVAS_ERR_OK ) { return error; } - if ( ( error = ivas_reverb_fft_filter_init( &pState->fft_filter_correl_0, pState->fft_size ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_fft_filter_init( &hReverb->fft_filter_correl_0, hReverb->fft_size ) ) != IVAS_ERR_OK ) { return error; } - if ( ( error = ivas_reverb_fft_filter_init( &pState->fft_filter_correl_1, pState->fft_size ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_fft_filter_init( &hReverb->fft_filter_correl_1, hReverb->fft_size ) ) != IVAS_ERR_OK ) { return error; } - if ( ( error = ivas_reverb_fft_filter_init( &pState->fft_filter_color_0, pState->fft_size ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_fft_filter_init( &hReverb->fft_filter_color_0, hReverb->fft_size ) ) != IVAS_ERR_OK ) { return error; } - if ( ( error = ivas_reverb_fft_filter_init( &pState->fft_filter_color_1, pState->fft_size ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_fft_filter_init( &hReverb->fft_filter_color_1, hReverb->fft_size ) ) != IVAS_ERR_OK ) { return error; } @@ -718,13 +718,13 @@ static ivas_error initialize_reverb_filters( *-----------------------------------------------------------------------------------------*/ static ivas_error set_t60_filter( - REVERB_HANDLE pState, + REVERB_HANDLE hReverb, const uint16_t branch, const uint16_t nr_taps, const float coefA[], const float coefB[] ) { - if ( branch >= pState->nr_of_branches ) + if ( branch >= hReverb->nr_of_branches ) { return IVAS_ERR_INTERNAL; } @@ -734,7 +734,7 @@ static ivas_error set_t60_filter( return IVAS_ERR_INTERNAL; } - ivas_reverb_iir_filt_set( &( pState->t60[branch] ), nr_taps, coefA, coefB ); + ivas_reverb_iir_filt_set( &( hReverb->t60[branch] ), nr_taps, coefA, coefB ); return IVAS_ERR_OK; } @@ -747,16 +747,16 @@ static ivas_error set_t60_filter( *-----------------------------------------------------------------------------------------*/ static ivas_error set_feedback_delay( - REVERB_HANDLE pState, + REVERB_HANDLE hReverb, const uint16_t branch, const int16_t fb_delay ) { - if ( branch >= pState->nr_of_branches ) + if ( branch >= hReverb->nr_of_branches ) { return IVAS_ERR_INTERNAL; } - pState->delay_line[branch].Delay = fb_delay; + hReverb->delay_line[branch].Delay = fb_delay; return IVAS_ERR_OK; } @@ -769,19 +769,19 @@ static ivas_error set_feedback_delay( *-----------------------------------------------------------------------------------------*/ static ivas_error set_feedback_gain( - REVERB_HANDLE pState, + REVERB_HANDLE hReverb, const uint16_t branch, const float *pGain ) { uint16_t gain_idx; - if ( branch >= pState->nr_of_branches ) + if ( branch >= hReverb->nr_of_branches ) { return IVAS_ERR_INTERNAL; } - for ( gain_idx = 0; gain_idx < pState->nr_of_branches; gain_idx++ ) + for ( gain_idx = 0; gain_idx < hReverb->nr_of_branches; gain_idx++ ) { - pState->gain_matrix[branch][gain_idx] = pGain[gain_idx]; + hReverb->gain_matrix[branch][gain_idx] = pGain[gain_idx]; } return IVAS_ERR_OK; @@ -795,7 +795,7 @@ static ivas_error set_feedback_gain( *-----------------------------------------------------------------------------------------*/ static ivas_error set_correl_fft_filter( - REVERB_HANDLE pState, + REVERB_HANDLE hReverb, const uint16_t channel, rv_fftwf_type_complex *pSpectrum ) { @@ -806,11 +806,11 @@ static ivas_error set_correl_fft_filter( if ( channel == 0 ) { - ivas_reverb_fft_filter_ConvertFFTWF_2_FFTR( pSpectrum, pState->fft_filter_correl_0.fft_spectrum, pState->fft_filter_correl_0.fft_size ); + ivas_reverb_fft_filter_ConvertFFTWF_2_FFTR( pSpectrum, hReverb->fft_filter_correl_0.fft_spectrum, hReverb->fft_filter_correl_0.fft_size ); } else { - ivas_reverb_fft_filter_ConvertFFTWF_2_FFTR( pSpectrum, pState->fft_filter_correl_1.fft_spectrum, pState->fft_filter_correl_1.fft_size ); + ivas_reverb_fft_filter_ConvertFFTWF_2_FFTR( pSpectrum, hReverb->fft_filter_correl_1.fft_spectrum, hReverb->fft_filter_correl_1.fft_size ); } return IVAS_ERR_OK; @@ -824,7 +824,7 @@ static ivas_error set_correl_fft_filter( *-----------------------------------------------------------------------------------------*/ static ivas_error set_color_fft_filter( - REVERB_HANDLE pState, + REVERB_HANDLE hReverb, const uint16_t channel, rv_fftwf_type_complex *pSpectrum ) { @@ -835,11 +835,11 @@ static ivas_error set_color_fft_filter( if ( channel == 0 ) { - ivas_reverb_fft_filter_ConvertFFTWF_2_FFTR( pSpectrum, pState->fft_filter_color_0.fft_spectrum, pState->fft_filter_color_0.fft_size ); + ivas_reverb_fft_filter_ConvertFFTWF_2_FFTR( pSpectrum, hReverb->fft_filter_color_0.fft_spectrum, hReverb->fft_filter_color_0.fft_size ); } else { - ivas_reverb_fft_filter_ConvertFFTWF_2_FFTR( pSpectrum, pState->fft_filter_color_1.fft_spectrum, pState->fft_filter_color_1.fft_size ); + ivas_reverb_fft_filter_ConvertFFTWF_2_FFTR( pSpectrum, hReverb->fft_filter_color_1.fft_spectrum, hReverb->fft_filter_color_1.fft_size ); } return IVAS_ERR_OK; @@ -853,7 +853,7 @@ static ivas_error set_color_fft_filter( *-----------------------------------------------------------------------------------------*/ static ivas_error set_mixer_level( - REVERB_HANDLE pState, + REVERB_HANDLE hReverb, const uint16_t channel, const float level[] ) { @@ -863,9 +863,9 @@ static ivas_error set_mixer_level( return IVAS_ERR_INTERNAL; } - for ( branch_idx = 0; branch_idx < pState->nr_of_branches; branch_idx++ ) + for ( branch_idx = 0; branch_idx < hReverb->nr_of_branches; branch_idx++ ) { - pState->mixer[channel][branch_idx] = level[branch_idx]; + hReverb->mixer[channel][branch_idx] = level[branch_idx]; } return IVAS_ERR_OK; @@ -879,7 +879,7 @@ static ivas_error set_mixer_level( *-----------------------------------------------------------------------------------------*/ static void clear_buffers( - REVERB_HANDLE pState ) + REVERB_HANDLE hReverb ) { int16_t branch_idx; ivas_rev_iir_filter_t *iirFilter; @@ -887,15 +887,15 @@ static void clear_buffers( for ( branch_idx = 0; branch_idx < IVAS_REV_MAX_NR_BRANCHES; branch_idx++ ) { - delay_line = &( pState->delay_line[branch_idx] ); + delay_line = &( hReverb->delay_line[branch_idx] ); set_f( delay_line->pBuffer, 0, delay_line->MaxDelay ); delay_line->BufferPos = 0; - iirFilter = &( pState->t60[branch_idx] ); + iirFilter = &( hReverb->t60[branch_idx] ); set_f( iirFilter->pBuffer, 0, iirFilter->MaxTaps ); } - ivas_reverb_t2f_f2t_ClearHistory( &pState->fft_filter_ols ); + ivas_reverb_t2f_f2t_ClearHistory( &hReverb->fft_filter_ols ); return; } @@ -908,31 +908,31 @@ static void clear_buffers( *-----------------------------------------------------------------------------------------*/ static void set_fft_and_datablock_sizes( - REVERB_HANDLE pState, + REVERB_HANDLE hReverb, const int16_t subframe_len ) { - pState->full_block_size = subframe_len; + hReverb->full_block_size = subframe_len; if ( subframe_len == L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES ) { - pState->fft_size = IVAS_REVERB_FFT_SIZE_48K; - pState->num_fft_subblocks = IVAS_REVERB_FFT_N_SUBBLOCKS_48K; + hReverb->fft_size = IVAS_REVERB_FFT_SIZE_48K; + hReverb->num_fft_subblocks = IVAS_REVERB_FFT_N_SUBBLOCKS_48K; } else if ( subframe_len == L_FRAME32k / MAX_PARAM_SPATIAL_SUBFRAMES ) { - pState->fft_size = IVAS_REVERB_FFT_SIZE_32K; - pState->num_fft_subblocks = IVAS_REVERB_FFT_N_SUBBLOCKS_32K; + hReverb->fft_size = IVAS_REVERB_FFT_SIZE_32K; + hReverb->num_fft_subblocks = IVAS_REVERB_FFT_N_SUBBLOCKS_32K; } else if ( subframe_len == L_FRAME16k / MAX_PARAM_SPATIAL_SUBFRAMES ) { - pState->fft_size = IVAS_REVERB_FFT_SIZE_16K; - pState->num_fft_subblocks = IVAS_REVERB_FFT_N_SUBBLOCKS_16K; + hReverb->fft_size = IVAS_REVERB_FFT_SIZE_16K; + hReverb->num_fft_subblocks = IVAS_REVERB_FFT_N_SUBBLOCKS_16K; } else { assert( 0 ); /* unsupported block size */ } - pState->fft_subblock_size = subframe_len / pState->num_fft_subblocks; + hReverb->fft_subblock_size = subframe_len / hReverb->num_fft_subblocks; return; } @@ -1030,7 +1030,7 @@ static void set_reverb_acoustic_data( *-----------------------------------------------------------------------------------------*/ static ivas_error setup_FDN_branches( - REVERB_HANDLE pState, + REVERB_HANDLE hReverb, ivas_reverb_params_t *pParams ) { int16_t nr_coefs, branch_idx, channel_idx; @@ -1041,12 +1041,12 @@ static ivas_error setup_FDN_branches( /* initialize feedback branches */ for ( branch_idx = 0; branch_idx < IVAS_REV_MAX_NR_BRANCHES; branch_idx++ ) { - ivas_rev_delay_line_init( &( pState->delay_line[branch_idx] ), pState->loop_delay_buffer[branch_idx], init_loop_delay[branch_idx], pParams->pLoop_delays[branch_idx] ); - ivas_reverb_iir_filt_init( &( pState->t60[branch_idx] ), IVAS_REV_MAX_IIR_FILTER_LENGTH ); - pState->mixer[0][branch_idx] = 0.0f; - pState->mixer[1][branch_idx] = 0.0f; + ivas_rev_delay_line_init( &( hReverb->delay_line[branch_idx] ), hReverb->loop_delay_buffer[branch_idx], init_loop_delay[branch_idx], pParams->pLoop_delays[branch_idx] ); + ivas_reverb_iir_filt_init( &( hReverb->t60[branch_idx] ), IVAS_REV_MAX_IIR_FILTER_LENGTH ); + hReverb->mixer[0][branch_idx] = 0.0f; + hReverb->mixer[1][branch_idx] = 0.0f; } - clear_buffers( pState ); + clear_buffers( hReverb ); nr_coefs = pParams->t60_filter_order + 1; if ( IVAS_REV_MAX_IIR_FILTER_LENGTH < nr_coefs ) @@ -1060,17 +1060,17 @@ static ivas_error setup_FDN_branches( pCoef_a = &pParams->pT60_filter_coeff[2 * nr_coefs * branch_idx + nr_coefs]; pCoef_b = &pParams->pT60_filter_coeff[2 * nr_coefs * branch_idx]; - if ( ( error = set_t60_filter( pState, branch_idx, nr_coefs, pCoef_a, pCoef_b ) ) != IVAS_ERR_OK ) + if ( ( error = set_t60_filter( hReverb, branch_idx, nr_coefs, pCoef_a, pCoef_b ) ) != IVAS_ERR_OK ) { return error; } - if ( ( error = set_feedback_delay( pState, branch_idx, pParams->pLoop_delays[branch_idx] ) ) != IVAS_ERR_OK ) + if ( ( error = set_feedback_delay( hReverb, branch_idx, pParams->pLoop_delays[branch_idx] ) ) != IVAS_ERR_OK ) { return error; } - if ( ( error = set_feedback_gain( pState, branch_idx, &( pParams->pLoop_feedback_matrix[branch_idx * pParams->nr_loops] ) ) ) != IVAS_ERR_OK ) + if ( ( error = set_feedback_gain( hReverb, branch_idx, &( pParams->pLoop_feedback_matrix[branch_idx * pParams->nr_loops] ) ) ) != IVAS_ERR_OK ) { return error; } @@ -1079,7 +1079,7 @@ static ivas_error setup_FDN_branches( for ( channel_idx = 0; channel_idx < pParams->nr_outputs; channel_idx++ ) { - if ( ( error = set_mixer_level( pState, channel_idx, &( pParams->pLoop_extract_matrix[channel_idx * pParams->nr_loops] ) ) ) != IVAS_ERR_OK ) + if ( ( error = set_mixer_level( hReverb, channel_idx, &( pParams->pLoop_extract_matrix[channel_idx * pParams->nr_loops] ) ) ) != IVAS_ERR_OK ) { return error; } @@ -1175,7 +1175,6 @@ ivas_error ivas_reverb_open( /* set up reverb acoustic data on the basis of HRTF data and renderer config */ set_reverb_acoustic_data( ¶ms, input_audio_config, hHrtf, &hRenderConfig->roomAcoustics, subframe_len, nr_fc_input, nr_fc_fft_filter ); -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND /* set reverb acoustic configuration based on renderer config */ #ifdef DEBUGGING pState->pConfig.renderer_type_override = hRenderConfig->renderer_type_override; @@ -1184,7 +1183,6 @@ ivas_error ivas_reverb_open( pState->pConfig.roomAcoustics.use_brir = hRenderConfig->roomAcoustics.use_brir; pState->pConfig.roomAcoustics.late_reverb_on = hRenderConfig->roomAcoustics.late_reverb_on; pState->pConfig.roomAcoustics.nBands = hRenderConfig->roomAcoustics.nBands; -#endif /* set up input downmix */ pState->dmx_gain = calc_dmx_gain(); @@ -1312,27 +1310,27 @@ void ivas_reverb_close( *-----------------------------------------------------------------------------------------*/ static void post_fft_filter( - REVERB_HANDLE pState, + REVERB_HANDLE hReverb, float *p0, float *p1, float *pBuffer_0, float *pBuffer_1 ) { - if ( pState->do_corr_filter ) + if ( hReverb->do_corr_filter ) { - ivas_reverb_t2f_f2t_in( &pState->fft_filter_ols, p0, p1, pBuffer_0, pBuffer_1 ); - ivas_reverb_fft_filter_ComplexMul( &pState->fft_filter_correl_0, pBuffer_0 ); - ivas_reverb_fft_filter_ComplexMul( &pState->fft_filter_correl_1, pBuffer_1 ); - ivas_reverb_fft_filter_CrossMix( pBuffer_0, pBuffer_1, pState->fft_filter_correl_0.fft_size ); + ivas_reverb_t2f_f2t_in( &hReverb->fft_filter_ols, p0, p1, pBuffer_0, pBuffer_1 ); + ivas_reverb_fft_filter_ComplexMul( &hReverb->fft_filter_correl_0, pBuffer_0 ); + ivas_reverb_fft_filter_ComplexMul( &hReverb->fft_filter_correl_1, pBuffer_1 ); + ivas_reverb_fft_filter_CrossMix( pBuffer_0, pBuffer_1, hReverb->fft_filter_correl_0.fft_size ); } else { - ivas_reverb_t2f_f2t_in( &pState->fft_filter_ols, p0, p1, pBuffer_0, pBuffer_1 ); + ivas_reverb_t2f_f2t_in( &hReverb->fft_filter_ols, p0, p1, pBuffer_0, pBuffer_1 ); } - ivas_reverb_fft_filter_ComplexMul( &pState->fft_filter_color_0, pBuffer_0 ); - ivas_reverb_fft_filter_ComplexMul( &pState->fft_filter_color_1, pBuffer_1 ); - ivas_reverb_t2f_f2t_out( &pState->fft_filter_ols, pBuffer_0, pBuffer_1, p0, p1 ); + ivas_reverb_fft_filter_ComplexMul( &hReverb->fft_filter_color_0, pBuffer_0 ); + ivas_reverb_fft_filter_ComplexMul( &hReverb->fft_filter_color_1, pBuffer_1 ); + ivas_reverb_t2f_f2t_out( &hReverb->fft_filter_ols, pBuffer_0, pBuffer_1, p0, p1 ); return; } @@ -1345,14 +1343,14 @@ static void post_fft_filter( *-----------------------------------------------------------------------------------------*/ static void reverb_block( - REVERB_HANDLE pState, + REVERB_HANDLE hReverb, float *pInput, float *pOut0, float *pOut1 ) { - uint16_t nr_branches = pState->nr_of_branches; - uint16_t bsize = pState->full_block_size; + uint16_t nr_branches = hReverb->nr_of_branches; + uint16_t bsize = hReverb->full_block_size; uint16_t inner_bsize = INNER_BLK_SIZE; uint16_t i, j, k, ns, branch_idx, blk_idx, start_sample_idx; @@ -1384,12 +1382,12 @@ static void reverb_block( for ( i = 0; i < nr_branches; i++ ) { float *pOutput_i = &ppOutput[i][0]; - float mixer_0_i = pState->mixer[0][i]; - float mixer_1_i = pState->mixer[1][i]; + float mixer_0_i = hReverb->mixer[0][i]; + float mixer_1_i = hReverb->mixer[1][i]; /* output and feedback are same, get sample from delay line ... */ - ivas_rev_delay_line_get_sample_blk( &( pState->delay_line[i] ), inner_bsize, pTemp ); - ivas_reverb_iir_filt_2taps_feed_blk( &( pState->t60[i] ), inner_bsize, pTemp, ppOutput[i] ); + ivas_rev_delay_line_get_sample_blk( &( hReverb->delay_line[i] ), inner_bsize, pTemp ); + ivas_reverb_iir_filt_2taps_feed_blk( &( hReverb->t60[i] ), inner_bsize, pTemp, ppOutput[i] ); for ( ns = 0; ns < inner_bsize; ns++ ) { pO0[ns] += pOutput_i[ns] * mixer_0_i; /* mixer ch 0 */ @@ -1408,7 +1406,7 @@ static void reverb_block( for ( j = 0; j < nr_branches; j++ ) { - float gain_matrix_j_i = pState->gain_matrix[j][i]; + float gain_matrix_j_i = hReverb->gain_matrix[j][i]; float *pOutput = &ppOutput[j][0]; for ( ns = 0; ns < inner_bsize; ns++ ) { @@ -1416,15 +1414,15 @@ static void reverb_block( } } - ivas_rev_delay_line_feed_sample_blk( &( pState->delay_line[i] ), inner_bsize, pFeedback_input ); + ivas_rev_delay_line_feed_sample_blk( &( hReverb->delay_line[i] ), inner_bsize, pFeedback_input ); } } /* Applying FFT filter to each sub-frame */ - for ( blk_idx = 0; blk_idx < pState->num_fft_subblocks; blk_idx++ ) + for ( blk_idx = 0; blk_idx < hReverb->num_fft_subblocks; blk_idx++ ) { - start_sample_idx = blk_idx * pState->fft_subblock_size; - post_fft_filter( pState, pOut0 + start_sample_idx, pOut1 + start_sample_idx, pFFT_buf[0], pFFT_buf[1] ); + start_sample_idx = blk_idx * hReverb->fft_subblock_size; + post_fft_filter( hReverb, pOut0 + start_sample_idx, pOut1 + start_sample_idx, pFFT_buf[0], pFFT_buf[1] ); } return; @@ -1438,14 +1436,14 @@ static void reverb_block( *-----------------------------------------------------------------------------------------*/ static ivas_error downmix_input_block( - REVERB_HANDLE pState, + const REVERB_HANDLE hReverb, float pcm_in[][L_FRAME48k], const AUDIO_CONFIG input_audio_config, float *pPcm_out, const int16_t input_offset ) { int16_t i, s, nchan_transport; - float dmx_gain = pState->dmx_gain; + float dmx_gain = hReverb->dmx_gain; switch ( input_audio_config ) { @@ -1461,7 +1459,7 @@ static ivas_error downmix_input_block( case AUDIO_CONFIG_ISM4: { nchan_transport = audioCfg2channels( input_audio_config ); - for ( s = 0; s < pState->full_block_size; s++ ) + for ( s = 0; s < hReverb->full_block_size; s++ ) { float temp = pcm_in[0][input_offset + s]; for ( i = 1; i < nchan_transport; i++ ) @@ -1477,7 +1475,7 @@ static ivas_error downmix_input_block( case AUDIO_CONFIG_HOA2: case AUDIO_CONFIG_HOA3: { - for ( s = 0; s < pState->full_block_size; s++ ) + for ( s = 0; s < hReverb->full_block_size; s++ ) { pPcm_out[s] = dmx_gain * pcm_in[0][input_offset + s]; } @@ -1499,35 +1497,35 @@ static ivas_error downmix_input_block( *-----------------------------------------------------------------------------------------*/ static void predelay_block( - REVERB_HANDLE pState, + const REVERB_HANDLE hReverb, float *pInput, float *pOutput ) { uint16_t i, idx, n_samples, blk_size; - uint16_t max_blk_size = (uint16_t) pState->predelay_line.Delay; + uint16_t max_blk_size = (uint16_t) hReverb->predelay_line.Delay; if ( max_blk_size < 2 ) { if ( max_blk_size == 0 ) /* zero-length delay line: just copy the data from input to output */ { - for ( i = 0; i < pState->full_block_size; i++ ) + for ( i = 0; i < hReverb->full_block_size; i++ ) { pOutput[i] = pInput[i]; } } else /* 1-sample length delay line: feed the data sample-by-sample */ { - for ( i = 0; i < pState->full_block_size; i++ ) + for ( i = 0; i < hReverb->full_block_size; i++ ) { - pOutput[i] = ivas_rev_delay_line_get_sample( &( pState->predelay_line ) ); - ivas_rev_delay_line_feed_sample( &( pState->predelay_line ), pInput[i] ); + pOutput[i] = ivas_rev_delay_line_get_sample( &( hReverb->predelay_line ) ); + ivas_rev_delay_line_feed_sample( &( hReverb->predelay_line ), pInput[i] ); } } } else /* multiple-sample length delay line: use block processing */ { idx = 0; - n_samples = pState->full_block_size; + n_samples = hReverb->full_block_size; while ( n_samples > 0 ) { blk_size = n_samples; @@ -1535,8 +1533,8 @@ static void predelay_block( { blk_size = max_blk_size; } - ivas_rev_delay_line_get_sample_blk( &( pState->predelay_line ), blk_size, &pOutput[idx] ); - ivas_rev_delay_line_feed_sample_blk( &( pState->predelay_line ), blk_size, &pInput[idx] ); + ivas_rev_delay_line_get_sample_blk( &( hReverb->predelay_line ), blk_size, &pOutput[idx] ); + ivas_rev_delay_line_feed_sample_blk( &( hReverb->predelay_line ), blk_size, &pInput[idx] ); idx += blk_size; n_samples -= blk_size; } @@ -1553,7 +1551,7 @@ static void predelay_block( *-----------------------------------------------------------------------------------------*/ static void mix_output_block( - REVERB_HANDLE pState, + const REVERB_HANDLE hReverb, const float *pInL, const float *pInR, float *pOutL, @@ -1561,7 +1559,7 @@ static void mix_output_block( { uint16_t i; - for ( i = 0; i < pState->full_block_size; i++ ) + for ( i = 0; i < hReverb->full_block_size; i++ ) { pOutL[i] += pInL[i]; pOutR[i] += pInR[i]; @@ -1578,12 +1576,13 @@ static void mix_output_block( *-----------------------------------------------------------------------------------------*/ ivas_error ivas_reverb_process( - REVERB_HANDLE hReverb, /* i/o: reverb state */ + const REVERB_HANDLE hReverb, /* i : Reverberator handle */ const AUDIO_CONFIG input_audio_config, /* i : reverb. input audio configuration */ const int16_t mix_signals, /* i : add reverb to output signal */ float pcm_in[][L_FRAME48k], /* i : the PCM audio to apply reverb on */ float pcm_out[][L_FRAME48k], /* o : the PCM audio with reverb applied */ - const int16_t i_ts ) + const int16_t i_ts /* i : subframe index */ +) { float tmp0[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES], tmp1[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES], tmp2[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; ivas_error error; diff --git a/lib_rend/ivas_rom_TdBinauralRenderer.c b/lib_rend/ivas_rom_TdBinauralRenderer.c index 70daa6dff9..4b56fb4883 100644 --- a/lib_rend/ivas_rom_TdBinauralRenderer.c +++ b/lib_rend/ivas_rom_TdBinauralRenderer.c @@ -41,6 +41,7 @@ #include "ivas_cnst.h" #include "wmc_auto.h" +#define WMC_TOOL_SKIP /*------------------------------------------------------------------------- * TD Binaural rendering related ROM tables @@ -12456,4 +12457,6 @@ const uint32_t orange53_rom_ITD_elevBsShape[28] = { 0x3ebda12f,0x3f12f685,0x3f2aaaab, }; +#undef WMC_TOOL_SKIP + /* clang-format on */ diff --git a/lib_rend/ivas_rom_binauralRenderer.c b/lib_rend/ivas_rom_binauralRenderer.c index 763777ad28..9708bac83a 100644 --- a/lib_rend/ivas_rom_binauralRenderer.c +++ b/lib_rend/ivas_rom_binauralRenderer.c @@ -41,6 +41,8 @@ /* clang-format off */ +#define WMC_TOOL_SKIP + /*------------------------------------------------------------------------- * Binaural rendering related ROM tables *------------------------------------------------------------------------*/ @@ -44077,4 +44079,6 @@ const float parametricEarlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX] = 0.016350f, 0.042709f, 0.077337f, 0.066238f, 0.042046f, 0.020017f, 0.007896f, 0.002947f, 0.000932f, 0.000152f }; +#undef WMC_TOOL_SKIP + /* clang-format on */ diff --git a/lib_rend/ivas_rom_binaural_crend_head.c b/lib_rend/ivas_rom_binaural_crend_head.c index a57d780378..56a9a9ef53 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.c +++ b/lib_rend/ivas_rom_binaural_crend_head.c @@ -47,6 +47,7 @@ #include "cnst.h" #include "ivas_cnst.h" +#define WMC_TOOL_SKIP /********************** CRendBin_Combined_HRIR **********************/ #ifdef FIX_BINAURAL_DELAY_PRECISION @@ -6923,3 +6924,4 @@ const float CRendBin_Combined_BRIR_coeff_diffuse_im_16kHz[BINAURAL_CHANNELS][252 0.050578f, 0.012222f, 0.020049f, -0.020057f, -0.032135f, -0.002553f, -0.037541f, -0.023567f, -0.008392f, -0.012215f, 0.001644f, -0.001142f, 0.000540f, 0.001404f, -0.027979f, -0.022362f, -0.012091f, -0.022963f, 0.009075f, 0.010977f, -0.007069f, -0.000183f, -0.022228f, -0.001348f, 0.006548f, -0.003034f} }; +#undef WMC_TOOL_SKIP diff --git a/lib_rend/ivas_rom_rend.c b/lib_rend/ivas_rom_rend.c index 0dfdaf0d28..dd8ca99d80 100644 --- a/lib_rend/ivas_rom_rend.c +++ b/lib_rend/ivas_rom_rend.c @@ -104,7 +104,7 @@ const float diffuseFieldCoherenceDifferenceZ[BINAURAL_COHERENCE_DIFFERENCE_BINS] /*----------------------------------------------------------------------------------* - * TD ISm binaural renderer ROM tables + * TD ISM binaural renderer ROM tables *----------------------------------------------------------------------------------*/ const int16_t HRTF_MODEL_N_CPTS_VAR[HRTF_MODEL_N_SECTIONS] = diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 2622d02308..2a45c6d61a 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -30,6 +30,7 @@ *******************************************************************************************************/ +#include "ivas_cnst.h" #include #include #include "options.h" @@ -43,6 +44,83 @@ #include "wmc_auto.h" +/*-----------------------------------------------------------------------* + * ivas_headTrack_open() + * + * Allocate and initialize Head-Tracking handle + *-----------------------------------------------------------------------*/ + +ivas_error ivas_headTrack_open( + HEAD_TRACK_DATA_HANDLE *hHeadTrackData /* o : head track handle */ +) +{ + int16_t i; + ivas_error error; + + /* Allocate Head-Tracking handle */ + if ( ( *hHeadTrackData = (HEAD_TRACK_DATA_HANDLE) malloc( sizeof( HEAD_TRACK_DATA ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for head-tracking memory\n" ) ); + } + + /* Initialization */ + ( *hHeadTrackData )->num_quaternions = 0; + ( *hHeadTrackData )->lrSwitchInterpVal = 0.0f; + ( *hHeadTrackData )->lrSwitchedCurrent = 0; + ( *hHeadTrackData )->lrSwitchedNext = 0; +#ifdef FIX_I109_ORIENTATION_TRACKING + if ( ( ( *hHeadTrackData )->OrientationTracker = (ivas_orient_trk_state_t *) malloc( sizeof( ivas_orient_trk_state_t ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Orientation tracking" ); + } + + if ( ( error = ivas_orient_trk_Init( ( *hHeadTrackData )->OrientationTracker ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif + + /* Initialise Rmat_prev to I, Rmat will be computed later */ + for ( i = 0; i < 3; i++ ) + { + set_zero( ( *hHeadTrackData )->Rmat_prev[i], 3 ); + ( *hHeadTrackData )->Rmat_prev[i][i] = 1.0f; + } + + return IVAS_ERR_OK; +} + + +#ifdef FIX_I109_ORIENTATION_TRACKING +/*-----------------------------------------------------------------------* + * ivas_headTrack_close() + * + * Deallocate Head-Tracking handle + *-----------------------------------------------------------------------*/ + +void ivas_headTrack_close( + HEAD_TRACK_DATA_HANDLE *hHeadTrackData /* i/o: head track handle */ +) +{ + if ( hHeadTrackData == NULL || *hHeadTrackData == NULL ) + { + return; + } + + if ( ( *hHeadTrackData )->OrientationTracker != NULL ) + { + free( ( *hHeadTrackData )->OrientationTracker ); + ( *hHeadTrackData )->OrientationTracker = NULL; + } + + free( ( *hHeadTrackData ) ); + *hHeadTrackData = NULL; + + return; +} +#endif + + /*---------------------------------------------------------------------------------- * QuatToRotMat() * @@ -54,7 +132,21 @@ void QuatToRotMat( float Rmat[3][3] /* o : real-space rotation matrix for this rotation */ ) { +#ifdef FIX_I109_ORIENTATION_TRACKING + Rmat[0][0] = quat.w * quat.w + quat.x * quat.x - quat.y * quat.y - quat.z * quat.z; + Rmat[0][1] = 2.0f * ( quat.x * quat.y - quat.w * quat.z ); + Rmat[0][2] = 2.0f * ( quat.x * quat.z + quat.w * quat.y ); + + Rmat[1][0] = 2.0f * ( quat.x * quat.y + quat.w * quat.z ); + Rmat[1][1] = quat.w * quat.w - quat.x * quat.x + quat.y * quat.y - quat.z * quat.z; + Rmat[1][2] = 2.0f * ( quat.y * quat.z - quat.w * quat.x ); + + Rmat[2][0] = 2.0f * ( quat.x * quat.z - quat.w * quat.y ); + Rmat[2][1] = 2.0f * ( quat.y * quat.z + quat.w * quat.x ); + Rmat[2][2] = quat.w * quat.w - quat.x * quat.x - quat.y * quat.y + quat.z * quat.z; +#else float s1, s2, s3, c1, c2, c3; + #ifdef DEBUGGING /* PrintQuat( quat ); */ #endif @@ -63,7 +155,11 @@ void QuatToRotMat( * Euler angles instead of quaternions. In this case, all the w values must * be set to -3.0 in the trajectory file to signal switching to Euler angles. * The x,y, and z components of the quaternion are then interpreted as +#ifdef FIX_I109_ORIENTATION_TRACKING * yaw-pitch-roll. +#else // see below: "Euler angles in R_X(roll)*R_Y(pitch)*R_Z(yaw) convention" + * roll-pitch-yaw. +#endif */ if ( quat.w != -3.0 ) { @@ -108,21 +204,23 @@ void QuatToRotMat( Rmat[2][1] = c3 * s1 + c1 * s2 * s3; Rmat[2][2] = c1 * c2; } +#endif return; } +#ifndef FIX_I109_ORIENTATION_TRACKING /*------------------------------------------------------------------------- * Quat2Euler() * - * Quaternion handling: calculate corresponding Euler angles + * Quaternion handling: calculate corresponding Euler angles in radians *------------------------------------------------------------------------*/ void Quat2Euler( const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ - float *yaw, /* o : yaw */ - float *pitch, /* o : pitch */ - float *roll /* o : roll */ + float *yaw, /* o : yaw (z) */ + float *pitch, /* o : pitch (y) */ + float *roll /* o : roll (x) */ ) { if ( quat.w != -3.0 ) @@ -146,7 +244,57 @@ void Quat2Euler( return; } +#endif + +#ifdef FIX_I109_ORIENTATION_TRACKING +/*------------------------------------------------------------------------- + * Euler2Quat() + * + * Calculate corresponding Quaternion from Euler angles in radians + *------------------------------------------------------------------------*/ +void Euler2Quat( + const float yaw, /* i : yaw (x) */ + const float pitch, /* i : pitch (y) */ + const float roll, /* i : roll (z) */ + IVAS_QUATERNION *quat /* o : quaternion describing the rotation */ +) +{ + float cr = cosf( roll * 0.5f ); + float sr = sinf( roll * 0.5f ); + float cp = cosf( pitch * 0.5f ); + float sp = sinf( -pitch * 0.5f ); + float cy = cosf( yaw * 0.5f ); + float sy = sinf( yaw * 0.5f ); + + quat->w = cr * cp * cy - sr * sp * sy; + quat->x = sr * cp * cy + cr * sp * sy; + quat->y = cr * sp * cy - sr * cp * sy; + quat->z = cr * cp * sy + sr * sp * cy; + + return; +} + +/*------------------------------------------------------------------------- + * deg2rad() + * + * Converts degrees to normalized radians + *------------------------------------------------------------------------*/ +float deg2rad( + float degrees ) +{ + while ( degrees >= 180.0f ) + { + degrees = degrees - 360.0f; + } + while ( degrees <= -180.0f ) + { + degrees = degrees + 360.0f; + } + + return PI_OVER_180 * degrees; +} +#endif /*------------------------------------------------------------------------- * rotateAziEle() diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 586a43c4f8..13c6084b2d 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -221,39 +221,25 @@ typedef struct EFAP } EFAP, *EFAP_HANDLE; - /*----------------------------------------------------------------------------------* - * Head rotation data structure + * Orientation tracking structure *----------------------------------------------------------------------------------*/ -typedef struct -{ - int8_t headRotEnabled; - IVAS_QUATERNION headPositions[RENDERER_HEAD_POSITIONS_PER_FRAME]; - float crossfade[L_FRAME48k / RENDERER_HEAD_POSITIONS_PER_FRAME]; - -} IVAS_REND_HeadRotData; - -typedef struct ivas_binaural_head_track_struct +#ifdef FIX_I109_ORIENTATION_TRACKING +typedef struct ivas_orient_trk_state_t { - int16_t num_quaternions; - IVAS_QUATERNION Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES]; - float Rmat[3][3]; - float Rmat_prev[3][3]; - - uint8_t lrSwitchedNext; - uint8_t lrSwitchedCurrent; - float lrSwitchInterpVal; - - int16_t shd_rot_max_order; - -} HEAD_TRACK_DATA, *HEAD_TRACK_DATA_HANDLE; - + OTR_TRACKING_T trackingType; + float centerAdaptationRate; + float offCenterAdaptationRate; + float adaptationAngle; -/*----------------------------------------------------------------------------------* - * Orientation tracking structure - *----------------------------------------------------------------------------------*/ + float alpha; + IVAS_QUATERNION absAvgRot; /* average absolute orientation */ + IVAS_QUATERNION refRot; /* reference orientation */ + IVAS_QUATERNION trkRot; /* tracked rotation */ +} ivas_orient_trk_state_t; +#else typedef struct ivas_orient_trk_state_t { OTR_TRACKING_T trackingType; @@ -280,11 +266,52 @@ typedef struct ivas_orient_trk_state_t float trkRoll; } ivas_orient_trk_state_t; +#endif + +/*----------------------------------------------------------------------------------* + * Head rotation data structure + *----------------------------------------------------------------------------------*/ + +typedef struct +{ + int8_t headRotEnabled; + IVAS_QUATERNION headPositions[RENDERER_HEAD_POSITIONS_PER_FRAME]; +#ifdef TD5 + IVAS_POSITION Pos[RENDERER_HEAD_POSITIONS_PER_FRAME]; +#endif + float crossfade[L_FRAME48k / RENDERER_HEAD_POSITIONS_PER_FRAME]; +#ifdef FIX_I109_ORIENTATION_TRACKING + ivas_orient_trk_state_t *hOrientationTracker; +#endif + +} IVAS_REND_HeadRotData; + +typedef struct ivas_binaural_head_track_struct +{ + int16_t num_quaternions; + IVAS_QUATERNION Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES]; +#ifdef TD5 + IVAS_POSITION Pos[MAX_PARAM_SPATIAL_SUBFRAMES]; +#endif + float Rmat[3][3]; + float Rmat_prev[3][3]; + uint8_t lrSwitchedNext; + uint8_t lrSwitchedCurrent; + float lrSwitchInterpVal; + + int16_t shd_rot_max_order; +#ifdef FIX_I109_ORIENTATION_TRACKING + ivas_orient_trk_state_t *OrientationTracker; +#endif + +} HEAD_TRACK_DATA, *HEAD_TRACK_DATA_HANDLE; /*----------------------------------------------------------------------------------* * Reverberator structure *----------------------------------------------------------------------------------*/ +/* Reverberator structures */ + typedef struct ivas_roomAcoustics_t { @@ -306,6 +333,9 @@ typedef struct ivas_render_config_t ivas_renderTypeOverride renderer_type_override; #endif ivas_roomAcoustics_t roomAcoustics; +#ifdef TD5 + float directivity[3]; +#endif } RENDER_CONFIG_DATA, *RENDER_CONFIG_HANDLE; @@ -389,7 +419,7 @@ typedef struct ivas_reverb_state_t /*----------------------------------------------------------------------------------* - * TD ISm Object Renderer structure + * TD ISM Object Renderer structure *----------------------------------------------------------------------------------*/ typedef struct diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 574396ce0e..1dc1c1f956 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -30,12 +30,6 @@ *******************************************************************************************************/ -#include -#include -#include -#include -#include -#include #include "options.h" #include "lib_rend.h" #include "prot.h" @@ -121,14 +115,8 @@ typedef struct IVAS_REND_AudioObjectPosition currentPos; IVAS_REND_AudioObjectPosition previousPos; TDREND_WRAPPER tdRendWrapper; -#ifdef FIX_197_CREND_INTERFACE CREND_WRAPPER_HANDLE crendWrapper; -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - REVERB_HANDLE reverb; -#endif -#else - CREND_WRAPPER crendWrapper; -#endif + REVERB_HANDLE hReverb; rotation_matrix rot_mat_prev; } input_ism; @@ -153,14 +141,8 @@ typedef struct LSSETUP_CUSTOM_STRUCT customLsInput; EFAP_WRAPPER efapInWrapper; TDREND_WRAPPER tdRendWrapper; -#ifdef FIX_197_CREND_INTERFACE CREND_WRAPPER_HANDLE crendWrapper; -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - REVERB_HANDLE reverb; -#endif -#else - CREND_WRAPPER crendWrapper; -#endif + REVERB_HANDLE hReverb; rotation_gains rot_gains_prev; lfe_routing lfeRouting; } input_mc; @@ -169,11 +151,7 @@ typedef struct { input_base base; pan_matrix hoaDecMtx; -#ifdef FIX_197_CREND_INTERFACE CREND_WRAPPER_HANDLE crendWrapper; -#else - CREND_WRAPPER crendWrapper; -#endif rotation_gains rot_gains_prev; } input_sba; @@ -335,11 +313,7 @@ static int32_t limitRendererOutput( * *-------------------------------------------------------------------*/ -#ifdef FIX_197_CREND_INTERFACE AUDIO_CONFIG getIvasAudioConfigFromRendAudioConfig( -#else -AUDIO_CONFIG rendAudioConfigToIvasAudioConfig( -#endif IVAS_REND_AudioConfig rendConfig ) { switch ( rendConfig ) @@ -927,11 +901,16 @@ static ivas_error getEfapGains( return IVAS_ERR_OK; } +#ifdef FIX_I109_ORIENTATION_TRACKING +static ivas_error initHeadRotation( +#else static void initHeadRotation( +#endif IVAS_REND_HANDLE hIvasRend ) { int16_t i, crossfade_len; float tmp; + ivas_error error; /* Head rotation is enabled by default */ hIvasRend->headRotData.headRotEnabled = 1; @@ -950,8 +929,35 @@ static void initHeadRotation( hIvasRend->headRotData.headPositions[i] = quaternionInit(); } +#ifdef FIX_I109_ORIENTATION_TRACKING + if ( ( hIvasRend->headRotData.hOrientationTracker = (ivas_orient_trk_state_t *) malloc( sizeof( ivas_orient_trk_state_t ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Orientation tracking" ); + } + + if ( ( error = ivas_orient_trk_Init( hIvasRend->headRotData.hOrientationTracker ) ) != IVAS_ERR_OK ) + { + return error; + } + + return IVAS_ERR_OK; +#else + return; +#endif +} + +#ifdef FIX_I109_ORIENTATION_TRACKING +static void closeHeadRotation( + IVAS_REND_HANDLE hIvasRend ) +{ + if ( ( hIvasRend != NULL ) && ( hIvasRend->headRotData.hOrientationTracker != NULL ) ) + { + free( hIvasRend->headRotData.hOrientationTracker ); + } + return; } +#endif static void initRotMatrix( rotation_matrix rot_mat ) @@ -1011,6 +1017,11 @@ static IVAS_REND_AudioObjectPosition defaultObjectPosition( pos.azimuth = 0.0f; pos.elevation = 0.0f; +#ifdef TD5 + pos.radius = 1.0f; + pos.yaw = 0.0f; + pos.pitch = 0.0f; +#endif return pos; } @@ -1056,6 +1067,21 @@ static CREND_WRAPPER defaultCrendWrapper( return w; } +static bool isIoConfigPairSupported( + IVAS_REND_AudioConfig inConfig, + IVAS_REND_AudioConfig outConfig ) +{ + /* Rendering mono or stereo to binaural is not supported */ + if ( ( inConfig == IVAS_REND_AUDIO_CONFIG_MONO || inConfig == IVAS_REND_AUDIO_CONFIG_STEREO ) && + getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) + { + return false; + } + + /* If not returned so far, config pair is supported */ + return true; +} + static ivas_error setRendInputActiveIsm( void *input, const IVAS_REND_AudioConfig inConfig, @@ -1071,64 +1097,61 @@ static ivas_error setRendInputActiveIsm( rendCtx = inputIsm->base.ctx; outConfig = *rendCtx.pOutConfig; + if ( !isIoConfigPairSupported( inConfig, outConfig ) ) + { + return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; + } + initRendInputBase( &inputIsm->base, inConfig, id, rendCtx ); inputIsm->currentPos = defaultObjectPosition(); inputIsm->previousPos = defaultObjectPosition(); -#ifdef FIX_197_CREND_INTERFACE inputIsm->crendWrapper = NULL; -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - inputIsm->reverb = NULL; -#endif -#else - inputIsm->crendWrapper = defaultCrendWrapper(); -#endif + inputIsm->hReverb = NULL; inputIsm->tdRendWrapper = defaultTdRendWrapper(); initRotMatrix( inputIsm->rot_mat_prev ); error = IVAS_ERR_OK; if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL ) { +#ifdef TD5 + if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) +#endif { return error; } } else if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) { -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND if ( hRendCfg != NULL && hRendCfg->roomAcoustics.use_brir == 0 && hRendCfg->roomAcoustics.late_reverb_on ) { +#ifdef TD5 + if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) +#endif { return error; } - if ( ( error = ivas_reverb_open( &( inputIsm->reverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } } else { -#endif - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, -#ifdef FIX_197_CREND_INTERFACE - getIvasAudioConfigFromRendAudioConfig( outConfig ), -#else - rendAudioConfigToIvasAudioConfig( outConfig ), -#endif - hRendCfg, -#ifdef FIX_197_CREND_INTERFACE + if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), hRendCfg, +#ifndef FIX_I109_ORIENTATION_TRACKING 0, #endif NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND } -#endif } return IVAS_ERR_OK; @@ -1144,21 +1167,10 @@ static void clearInputIsm( initRendInputBase( &inputIsm->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx ); /* Free input's internal handles */ -#ifdef FIX_197_CREND_INTERFACE - if ( inputIsm->crendWrapper != NULL ) -#else - if ( inputIsm->crendWrapper.hCrend != NULL ) -#endif - { - ivas_rend_closeCrend( &inputIsm->crendWrapper ); - } -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - if ( inputIsm->reverb != NULL ) - { - ivas_reverb_close( &inputIsm->reverb ); - } -#endif + ivas_rend_closeCrend( &inputIsm->crendWrapper ); + + ivas_reverb_close( &inputIsm->hReverb ); if ( inputIsm->tdRendWrapper.hBinRendererTd != NULL ) { @@ -1216,6 +1228,8 @@ static void fillIdentityPanMatrix( { panMatrix[i][i] = 1.0f; } + + return; } static ivas_error initMcPanGainsWithIdentMatrix( @@ -1233,20 +1247,14 @@ static ivas_error initMcPanGainsWithConversionMapping( AUDIO_CONFIG ivasConfigIn, ivasConfigOut; int16_t i; -#ifdef FIX_197_CREND_INTERFACE ivasConfigIn = getIvasAudioConfigFromRendAudioConfig( inputMc->base.inConfig ); ivasConfigOut = getIvasAudioConfigFromRendAudioConfig( outConfig ); -#else - ivasConfigIn = rendAudioConfigToIvasAudioConfig( inputMc->base.inConfig ); - ivasConfigOut = rendAudioConfigToIvasAudioConfig( outConfig ); -#endif /* Find conversion mapping for current I/O config pair. * Stay with default panning matrix if conversion_matrix is NULL */ for ( i = 0; i < LS_SETUP_CONVERSION_NUM_MAPPINGS; ++i ) { - if ( ls_conversion_mapping[i].input_config == ivasConfigIn && - ls_conversion_mapping[i].output_config == ivasConfigOut ) + if ( ls_conversion_mapping[i].input_config == ivasConfigIn && ls_conversion_mapping[i].output_config == ivasConfigOut ) { /* Mapping found with valid matrix - copy */ if ( ls_conversion_mapping[i].conversion_matrix != NULL ) @@ -1802,21 +1810,9 @@ static ivas_error initMcBinauralRendering( inputMc->tdRendWrapper.hHrtfTD = NULL; } -#ifdef FIX_197_CREND_INTERFACE - if ( inputMc->crendWrapper != NULL ) -#else - if ( inputMc->crendWrapper.hCrend != NULL ) -#endif - { - ivas_rend_closeCrend( &inputMc->crendWrapper ); - } + ivas_rend_closeCrend( &inputMc->crendWrapper ); -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - if ( inputMc->reverb != NULL ) - { - ivas_reverb_close( &inputMc->reverb ); - } -#endif + ivas_reverb_close( &inputMc->hReverb ); if ( inputMc->efapInWrapper.hEfap != NULL ) { @@ -1843,32 +1839,27 @@ static ivas_error initMcBinauralRendering( // if ( initTDRend ) { +#ifdef TD5 + if ( ( error = ivas_td_binaural_open_ext( &inputMc->tdRendWrapper, inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_td_binaural_open_ext( &inputMc->tdRendWrapper, inConfig, &inputMc->customLsInput, outSampleRate ) ) != IVAS_ERR_OK ) +#endif { return error; } -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND if ( hRendCfg != NULL && hRendCfg->roomAcoustics.use_brir == 0 && hRendCfg->roomAcoustics.late_reverb_on ) { - if ( ( error = ivas_reverb_open( &( inputMc->reverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, outSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_open( &( inputMc->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, outSampleRate ) ) != IVAS_ERR_OK ) { return error; } } -#endif } { - if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, -#ifdef FIX_197_CREND_INTERFACE - ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) ? AUDIO_CONFIG_7_1_4 : getIvasAudioConfigFromRendAudioConfig( inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), -#else - ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) ? AUDIO_CONFIG_7_1_4 : rendAudioConfigToIvasAudioConfig( inConfig ), - rendAudioConfigToIvasAudioConfig( outConfig ), -#endif - hRendCfg, -#ifdef FIX_197_CREND_INTERFACE + if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) ? AUDIO_CONFIG_7_1_4 : getIvasAudioConfigFromRendAudioConfig( inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), hRendCfg, +#ifndef FIX_I109_ORIENTATION_TRACKING 0, #endif NULL, outSampleRate ) ) != IVAS_ERR_OK ) @@ -1895,7 +1886,7 @@ static lfe_routing defaultLfeRouting( const IVAS_REND_AudioConfig outConfig, const LSSETUP_CUSTOM_STRUCT customLsOut ) { - int32_t i; + int16_t i; lfe_routing routing; /* Set all output gains to zero, then route each input LFE consecutively to the next available output LFE. */ @@ -1962,18 +1953,17 @@ static ivas_error setRendInputActiveMc( rendCtx = inputMc->base.ctx; outConfig = *rendCtx.pOutConfig; + if ( !isIoConfigPairSupported( inConfig, outConfig ) ) + { + return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; + } + initRendInputBase( &inputMc->base, inConfig, id, rendCtx ); setZeroPanMatrix( inputMc->panGains ); inputMc->customLsInput = defaultCustomLs(); inputMc->tdRendWrapper = defaultTdRendWrapper(); -#ifdef FIX_197_CREND_INTERFACE inputMc->crendWrapper = NULL; -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - inputMc->reverb = NULL; -#endif -#else - inputMc->crendWrapper = defaultCrendWrapper(); -#endif + inputMc->hReverb = NULL; initRotGains( inputMc->rot_gains_prev ); inputMc->lfeRouting = defaultLfeRouting( inConfig, inputMc->customLsInput, outConfig, *inputMc->base.ctx.pCustomLsOut ); @@ -2008,21 +1998,9 @@ static void clearInputMc( efap_free_data( &inputMc->efapInWrapper.hEfap ); } -#ifdef FIX_197_CREND_INTERFACE - if ( inputMc->crendWrapper != NULL ) -#else - if ( inputMc->crendWrapper.hCrend != NULL ) -#endif - { - ivas_rend_closeCrend( &inputMc->crendWrapper ); - } + ivas_rend_closeCrend( &inputMc->crendWrapper ); -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - if ( inputMc->reverb != NULL ) - { - ivas_reverb_close( &inputMc->reverb ); - } -#endif + ivas_reverb_close( &inputMc->hReverb ); if ( inputMc->tdRendWrapper.hBinRendererTd != NULL ) { @@ -2060,11 +2038,7 @@ static ivas_error initSbaPanGainsForMcOut( case IVAS_REND_AUDIO_CONFIG_MONO: hOutSetup.ls_azimuth = ls_azimuth_CICP1; hOutSetup.ls_elevation = ls_elevation_CICP1; -#ifdef FIX_197_CREND_INTERFACE ivas_output_init( &hOutSetup, getIvasAudioConfigFromRendAudioConfig( outConfig ) ); -#else - ivas_output_init( &hOutSetup, rendAudioConfigToIvasAudioConfig( outConfig ) ); -#endif break; case IVAS_REND_AUDIO_CONFIG_STEREO: case IVAS_REND_AUDIO_CONFIG_5_1: @@ -2072,11 +2046,7 @@ static ivas_error initSbaPanGainsForMcOut( case IVAS_REND_AUDIO_CONFIG_5_1_2: case IVAS_REND_AUDIO_CONFIG_5_1_4: case IVAS_REND_AUDIO_CONFIG_7_1_4: -#ifdef FIX_197_CREND_INTERFACE ivas_output_init( &hOutSetup, getIvasAudioConfigFromRendAudioConfig( outConfig ) ); -#else - ivas_output_init( &hOutSetup, rendAudioConfigToIvasAudioConfig( outConfig ) ); -#endif break; case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM: ivas_ls_custom_setup( &hOutSetup, outSetupCustom ); @@ -2157,15 +2127,10 @@ static ivas_error updateSbaPanGains( { case IVAS_REND_AUDIO_CONFIG_BINAURAL: error = ivas_rend_openCrend( &inputSba->crendWrapper, -#ifdef FIX_197_CREND_INTERFACE getIvasAudioConfigFromRendAudioConfig( inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), -#else - rendAudioConfigToIvasAudioConfig( inConfig ), - rendAudioConfigToIvasAudioConfig( outConfig ), -#endif hRendCfg, -#ifdef FIX_197_CREND_INTERFACE +#ifndef FIX_I109_ORIENTATION_TRACKING 0, #endif NULL, @@ -2179,13 +2144,9 @@ static ivas_error updateSbaPanGains( error = ivas_rend_openCrend( &inputSba->crendWrapper, AUDIO_CONFIG_7_1_4, -#ifdef FIX_197_CREND_INTERFACE getIvasAudioConfigFromRendAudioConfig( outConfig ), -#else - rendAudioConfigToIvasAudioConfig( outConfig ), -#endif hRendCfg, -#ifdef FIX_197_CREND_INTERFACE +#ifndef FIX_I109_ORIENTATION_TRACKING 0, #endif NULL, @@ -2222,13 +2183,14 @@ static ivas_error setRendInputActiveSba( rendCtx = inputSba->base.ctx; outConfig = *rendCtx.pOutConfig; + if ( !isIoConfigPairSupported( inConfig, outConfig ) ) + { + return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; + } + initRendInputBase( &inputSba->base, inConfig, id, rendCtx ); setZeroPanMatrix( inputSba->hoaDecMtx ); -#ifdef FIX_197_CREND_INTERFACE inputSba->crendWrapper = NULL; -#else - inputSba->crendWrapper = defaultCrendWrapper(); -#endif initRotGains( inputSba->rot_gains_prev ); if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg ) ) != IVAS_ERR_OK ) @@ -2249,14 +2211,7 @@ static void clearInputSba( initRendInputBase( &inputSba->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx ); /* Free input's internal handles */ -#ifdef FIX_197_CREND_INTERFACE - if ( inputSba->crendWrapper != NULL ) -#else - if ( inputSba->crendWrapper.hCrend != NULL ) -#endif - { - ivas_rend_closeCrend( &inputSba->crendWrapper ); - } + ivas_rend_closeCrend( &inputSba->crendWrapper ); return; } @@ -2273,11 +2228,7 @@ static ivas_error initMasaDummyDecForMcOut( DecoderDummy *decDummy; decDummy = inputMasa->decDummy; -#ifdef FIX_197_CREND_INTERFACE output_config = getIvasAudioConfigFromRendAudioConfig( outConfig ); -#else - output_config = rendAudioConfigToIvasAudioConfig( outConfig ); -#endif decDummy->hDecoderConfig->output_config = output_config; decDummy->hDecoderConfig->ivas_total_brate = IVAS_512k; /* Todo Nokia: This is preventing initialization of 2TC as 1TC, should be fixed properly in ivas_dirac_dec_config() */ @@ -2314,9 +2265,6 @@ static ivas_error initMasaDummyDecForMcOut( { return error; } -#ifndef FIX_107_5MS_SUBFRAME_RENDERING - decDummy->hDiracDecBin->useSubframeMode = 0; /* Todo Nokia: This will disappear in later work but needs to be this now. */ -#endif } numCldfbAnalyses = decDummy->nchan_transport; @@ -2362,11 +2310,7 @@ static ivas_error initMasaDummyDecForSbaOut( decDummy = inputMasa->decDummy; -#ifdef FIX_197_CREND_INTERFACE output_config = getIvasAudioConfigFromRendAudioConfig( outConfig ); -#else - output_config = rendAudioConfigToIvasAudioConfig( outConfig ); -#endif decDummy->hDecoderConfig->output_config = output_config; decDummy->hDecoderConfig->ivas_total_brate = IVAS_512k; /* Todo Nokia: This is preventing initialization of 2TC as 1TC, should be fixed properly in ivas_dirac_dec_config() */ @@ -2433,11 +2377,7 @@ static ivas_error initMasaDummyDecForBinauralOut( decDummy = inputMasa->decDummy; -#ifdef FIX_197_CREND_INTERFACE output_config = getIvasAudioConfigFromRendAudioConfig( outConfig ); -#else - output_config = rendAudioConfigToIvasAudioConfig( outConfig ); -#endif decDummy->hDecoderConfig->output_config = output_config; output_config = decDummy->hDecoderConfig->output_config; @@ -2457,11 +2397,6 @@ static ivas_error initMasaDummyDecForBinauralOut( } decDummy->ivas_format = MASA_FORMAT; decDummy->transport_config = AUDIO_CONFIG_INVALID; -#ifndef REMOVE_FORCE_SUBFRAME_BIN -#ifdef DEBUGGING - decDummy->hDecoderConfig->forceSubframeBinauralization = 0; -#endif -#endif if ( ( error = ivas_dirac_dec_open( decDummy ) ) != IVAS_ERR_OK ) { @@ -2478,9 +2413,6 @@ static ivas_error initMasaDummyDecForBinauralOut( return error; } -#ifndef FIX_107_5MS_SUBFRAME_RENDERING - decDummy->hDiracDecBin->useSubframeMode = 0; /* Todo Nokia: This will disappear in later work but needs to be this now. */ -#endif for ( i = 0; i < BINAURAL_CHANNELS; i++ ) { @@ -2546,17 +2478,12 @@ static DecoderDummy *initDecoderDummy( decDummy = malloc( sizeof( DecoderDummy ) ); decDummy->hDecoderConfig = malloc( sizeof( DECODER_CONFIG ) ); decDummy->hDecoderConfig->output_Fs = sampleRate; - decDummy->hDecoderConfig->nchan_out = (int16_t) numOutChannels; + decDummy->hDecoderConfig->nchan_out = numOutChannels; decDummy->hDecoderConfig->Opt_Headrotation = 0; decDummy->hBinRenderer = NULL; decDummy->hEFAPdata = NULL; -#ifdef FIX_197_CREND_INTERFACE decDummy->hCrendWrapper = NULL; -#else - decDummy->hHrtf = NULL; - decDummy->hCrend = NULL; -#endif decDummy->hHrtfTD = NULL; decDummy->hSpar = NULL; decDummy->hoa_dec_mtx = NULL; @@ -2564,11 +2491,7 @@ static DecoderDummy *initDecoderDummy( decDummy->hMasa = NULL; decDummy->hDiracDecBin = NULL; decDummy->hQMetaData = NULL; -#ifdef FIX_197_CREND_INTERFACE decDummy->hDecoderConfig->output_config = getIvasAudioConfigFromRendAudioConfig( outConfig ); -#else - decDummy->hDecoderConfig->output_config = rendAudioConfigToIvasAudioConfig( outConfig ); -#endif decDummy->nchan_transport = numTransChannels; if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) @@ -2585,6 +2508,10 @@ static DecoderDummy *initDecoderDummy( decDummy->hHeadTrackData->lrSwitchInterpVal = 0.0f; decDummy->hHeadTrackData->lrSwitchedCurrent = 0; decDummy->hHeadTrackData->lrSwitchedNext = 0; +#ifdef FIX_I109_ORIENTATION_TRACKING + decDummy->hHeadTrackData->OrientationTracker = (ivas_orient_trk_state_t *) malloc( sizeof( ivas_orient_trk_state_t ) ); + ivas_orient_trk_Init( decDummy->hHeadTrackData->OrientationTracker ); +#endif } else { @@ -2624,13 +2551,18 @@ static ivas_error setRendInputActiveMasa( outConfig = *rendCtx.pOutConfig; (void) hRendCfg; /* Suppress warning */ + if ( !isIoConfigPairSupported( inConfig, outConfig ) ) + { + return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; + } + initRendInputBase( &inputMasa->base, inConfig, id, rendCtx ); if ( ( error = getAudioConfigNumChannels( inConfig, &numInChannels ) ) != IVAS_ERR_OK ) { return error; } - inputMasa->decDummy = initDecoderDummy( *rendCtx.pOutSampleRate, (int16_t) numInChannels, outConfig, 0 ); + inputMasa->decDummy = initDecoderDummy( *rendCtx.pOutSampleRate, numInChannels, outConfig, 0 ); inputMasa->metadataHasBeenFed = false; if ( ( error = updateMasaDummyDec( inputMasa, outConfig ) ) != IVAS_ERR_OK ) @@ -2657,8 +2589,15 @@ static void freeDecoderDummy( { free( pDecDummy->hDecoderConfig ); } + if ( pDecDummy->hHeadTrackData != NULL ) { +#ifdef FIX_I109_ORIENTATION_TRACKING + if ( pDecDummy->hHeadTrackData->OrientationTracker != NULL ) + { + free( pDecDummy->hHeadTrackData->OrientationTracker ); + } +#endif free( pDecDummy->hHeadTrackData ); } ivas_render_config_close( &pDecDummy->hRenderConfig ); @@ -2669,7 +2608,6 @@ static void freeDecoderDummy( if ( pDecDummy->cldfbAnaDec[i] != NULL ) { deleteCldfb( &( pDecDummy->cldfbAnaDec[i] ) ); - pDecDummy->cldfbAnaDec[i] = NULL; } } @@ -2678,16 +2616,11 @@ static void freeDecoderDummy( if ( pDecDummy->cldfbSynDec[i] != NULL ) { deleteCldfb( &( pDecDummy->cldfbSynDec[i] ) ); - pDecDummy->cldfbSynDec[i] = NULL; } } /* DirAC handle */ - if ( pDecDummy->hDirAC != NULL ) - { - ivas_dirac_dec_close( pDecDummy->hDirAC ); - pDecDummy->hDirAC = NULL; - } + ivas_dirac_dec_close( &( pDecDummy->hDirAC ) ); /* Qmetadata handle */ ivas_qmetadata_close( &pDecDummy->hQMetaData ); @@ -2734,10 +2667,7 @@ ivas_error IVAS_REND_Open( ivas_error error; int16_t numOutChannels; - /*-----------------------------------------------------------------* - * Validate function arguments - *-----------------------------------------------------------------*/ - + /* Validate function arguments */ if ( phIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -2782,7 +2712,14 @@ ivas_error IVAS_REND_Open( } /* Initialize headrotation data */ +#ifdef FIX_I109_ORIENTATION_TRACKING + if ( ( error = initHeadRotation( hIvasRend ) ) != IVAS_ERR_OK ) + { + return error; + } +#else initHeadRotation( hIvasRend ); +#endif /* Initialize EFAP */ if ( ( error = initEfap( &hIvasRend->efapOutWrapper, outConfig, &hIvasRend->customLsOut ) ) != IVAS_ERR_OK ) @@ -2794,14 +2731,8 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { initRendInputBase( &hIvasRend->inputsIsm[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) ); -#ifdef FIX_197_CREND_INTERFACE hIvasRend->inputsIsm[i].crendWrapper = NULL; -#else - hIvasRend->inputsIsm[i].crendWrapper.hCrend = NULL; -#endif -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - hIvasRend->inputsIsm[i].reverb = NULL; -#endif + hIvasRend->inputsIsm[i].hReverb = NULL; hIvasRend->inputsIsm[i].tdRendWrapper.hBinRendererTd = NULL; } @@ -2809,25 +2740,15 @@ ivas_error IVAS_REND_Open( { initRendInputBase( &hIvasRend->inputsMc[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) ); hIvasRend->inputsMc[i].efapInWrapper.hEfap = NULL; -#ifdef FIX_197_CREND_INTERFACE hIvasRend->inputsMc[i].crendWrapper = NULL; -#else - hIvasRend->inputsMc[i].crendWrapper.hCrend = NULL; -#endif -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - hIvasRend->inputsMc[i].reverb = NULL; -#endif + hIvasRend->inputsMc[i].hReverb = NULL; hIvasRend->inputsMc[i].tdRendWrapper.hBinRendererTd = NULL; } for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) { initRendInputBase( &hIvasRend->inputsSba[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) ); -#ifdef FIX_197_CREND_INTERFACE hIvasRend->inputsSba[i].crendWrapper = NULL; -#else - hIvasRend->inputsSba[i].crendWrapper.hCrend = NULL; -#endif } for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) @@ -2905,10 +2826,7 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( input_mc *inputMc; input_sba *inputSba; - /*-----------------------------------------------------------------* - * Validate function arguments - *-----------------------------------------------------------------*/ - + /* Validate function arguments */ if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -2990,10 +2908,7 @@ ivas_error IVAS_REND_NumOutChannels( { ivas_error error; - /*-----------------------------------------------------------------* - * Validate function arguments - *-----------------------------------------------------------------*/ - + /* Validate function arguments */ if ( hIvasRend == NULL || numOutChannels == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3216,10 +3131,7 @@ ivas_error IVAS_REND_AddInput( ivas_error ( *activateInput )( void *, IVAS_REND_AudioConfig, IVAS_REND_InputId, RENDER_CONFIG_DATA * ); int32_t inputIndex; - /*-----------------------------------------------------------------* - * Validate function arguments - *-----------------------------------------------------------------*/ - + /* Validate function arguments */ if ( hIvasRend == NULL || inputId == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3288,10 +3200,7 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( input_mc *inputMc; ivas_error error; - /*-----------------------------------------------------------------* - * Validate function arguments - *-----------------------------------------------------------------*/ - + /* Validate function arguments */ if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3357,10 +3266,7 @@ ivas_error IVAS_REND_SetInputGain( input_base *inputBase; ivas_error error; - /*-----------------------------------------------------------------* - * Validate function arguments - *-----------------------------------------------------------------*/ - + /* Validate function arguments */ if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3394,10 +3300,7 @@ ivas_error IVAS_REND_SetInputLfeMtx( input_mc *pInputMc; ivas_error error; - /*-----------------------------------------------------------------* - * Validate function arguments - *-----------------------------------------------------------------*/ - + /* Validate function arguments */ if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3448,10 +3351,7 @@ ivas_error IVAS_REND_SetInputLfePos( input_mc *pInputMc; ivas_error error; - /*-----------------------------------------------------------------* - * Validate function arguments - *-----------------------------------------------------------------*/ - + /* Validate function arguments */ if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3497,10 +3397,7 @@ ivas_error IVAS_REND_RemoveInput( ivas_error error; input_base *inputBase; - /*-----------------------------------------------------------------* - * Validate function arguments - *-----------------------------------------------------------------*/ - + /* Validate function arguments */ if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3548,10 +3445,7 @@ ivas_error IVAS_REND_GetInputNumChannels( ivas_error error; const input_base *pInput; - /*-----------------------------------------------------------------* - * Validate function arguments - *-----------------------------------------------------------------*/ - + /* Validate function arguments */ if ( hIvasRend == NULL || numChannels == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3590,10 +3484,7 @@ ivas_error IVAS_REND_GetDelay( int32_t latency_ns; int32_t max_latency_ns; - /*-----------------------------------------------------------------* - * Validate function arguments - *-----------------------------------------------------------------*/ - + /* Validate function arguments */ if ( hIvasRend == NULL || nSamples == NULL || timeScale == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3608,13 +3499,8 @@ ivas_error IVAS_REND_GetDelay( { if ( hIvasRend->inputsIsm[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) { -#ifdef FIX_197_CREND_INTERFACE latency_ns = max( ( hIvasRend->inputsIsm[i].crendWrapper != NULL ) ? hIvasRend->inputsIsm[i].crendWrapper->binaural_latency_ns : 0, hIvasRend->inputsIsm[i].tdRendWrapper.binaural_latency_ns ); -#else - latency_ns = max( hIvasRend->inputsIsm[i].crendWrapper.binaural_latency_ns, - hIvasRend->inputsIsm[i].tdRendWrapper.binaural_latency_ns ); -#endif max_latency_ns = max( max_latency_ns, latency_ns ); } } @@ -3623,13 +3509,8 @@ ivas_error IVAS_REND_GetDelay( { if ( hIvasRend->inputsMc[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) { -#ifdef FIX_197_CREND_INTERFACE latency_ns = max( ( hIvasRend->inputsMc[i].crendWrapper != NULL ) ? hIvasRend->inputsMc[i].crendWrapper->binaural_latency_ns : 0, hIvasRend->inputsMc[i].tdRendWrapper.binaural_latency_ns ); -#else - latency_ns = max( hIvasRend->inputsMc[i].crendWrapper.binaural_latency_ns, - hIvasRend->inputsMc[i].tdRendWrapper.binaural_latency_ns ); -#endif max_latency_ns = max( max_latency_ns, latency_ns ); } } @@ -3638,11 +3519,7 @@ ivas_error IVAS_REND_GetDelay( { if ( hIvasRend->inputsSba[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) { -#ifdef FIX_197_CREND_INTERFACE latency_ns = ( hIvasRend->inputsSba[i].crendWrapper != NULL ) ? hIvasRend->inputsSba[i].crendWrapper->binaural_latency_ns : 0; -#else - latency_ns = hIvasRend->inputsSba[i].crendWrapper.binaural_latency_ns; -#endif max_latency_ns = max( max_latency_ns, latency_ns ); } } @@ -3678,10 +3555,7 @@ ivas_error IVAS_REND_FeedInputAudio( input_base *inputBase; int16_t numInputChannels; - /*-----------------------------------------------------------------* - * Validate function arguments - *-----------------------------------------------------------------*/ - + /* Validate function arguments */ if ( hIvasRend == NULL || inputAudio.data == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3745,10 +3619,7 @@ ivas_error IVAS_REND_FeedInputObjectMetadata( input_ism *inputIsm; ivas_error error; - /*-----------------------------------------------------------------* - * Validate function arguments - *-----------------------------------------------------------------*/ - + /* Validate function arguments */ if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3789,10 +3660,7 @@ ivas_error IVAS_REND_FeedInputMasaMetadata( input_base *inputBase; input_masa *inputMasa; - /*-----------------------------------------------------------------* - * Validate function arguments - *-----------------------------------------------------------------*/ - + /* Validate function arguments */ if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3839,7 +3707,6 @@ ivas_error IVAS_REND_InitConfig( hIvasRend->rendererConfigEnabled = 0; } -#ifdef FIX_197_CREND_INTERFACE if ( rendererConfigEnabled ) { if ( ( error = ivas_render_config_open( &( hIvasRend->hRendererConfig ) ) ) != IVAS_ERR_OK ) @@ -3847,26 +3714,15 @@ ivas_error IVAS_REND_InitConfig( return error; } - if ( ivas_render_config_init_from_rom( &hIvasRend->hRendererConfig, hIvasRend->rendererConfigEnabled ) != IVAS_ERR_OK ) + if ( ( error = ivas_render_config_init_from_rom( &hIvasRend->hRendererConfig, hIvasRend->rendererConfigEnabled ) ) != IVAS_ERR_OK ) { - return IVAS_ERR_INTERNAL_FATAL; + return error; } } else { hIvasRend->hRendererConfig = NULL; } -#else - if ( ( error = ivas_render_config_open( &( hIvasRend->hRendererConfig ) ) ) != IVAS_ERR_OK ) - { - return error; - } - - if ( ivas_render_config_init_from_rom( &hIvasRend->hRendererConfig, hIvasRend->rendererConfigEnabled ) != IVAS_ERR_OK ) - { - return IVAS_ERR_INTERNAL_FATAL; - } -#endif return IVAS_ERR_OK; } @@ -3939,6 +3795,9 @@ int16_t IVAS_REND_FeedRenderConfig( } hRenderConfig = hIvasRend->hRendererConfig; +#ifdef TD5 + mvr2r( renderConfig.directivity, hRenderConfig->directivity, 3 ); +#endif #ifdef DEBUGGING hRenderConfig->renderer_type_override = RENDER_TYPE_OVERRIDE_NONE; if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_FASTCONV ) @@ -3971,16 +3830,21 @@ int16_t IVAS_REND_FeedRenderConfig( *-------------------------------------------------------------------*/ ivas_error IVAS_REND_SetHeadRotation( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ +#ifdef TD5 + const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME], /* i : head orientations for next rendering call */ + const IVAS_POSITION Pos[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : listener positions for next rendering call */ +#else const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : head positions for next rendering call */ +#endif ) { int16_t i; +#ifdef FIX_I109_ORIENTATION_TRACKING + IVAS_QUATERNION rotQuat; +#endif - /*-----------------------------------------------------------------* - * Validate function arguments - *-----------------------------------------------------------------*/ - + /* Validate function arguments */ if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3989,7 +3853,7 @@ ivas_error IVAS_REND_SetHeadRotation( if ( getAudioConfigType( hIvasRend->outputConfig ) != IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) { /* Head rotation can be set only with binaural output */ - return IVAS_ERR_METADATA_NOT_EXPECTED; + return IVAS_ERR_INVALID_OUTPUT_FORMAT; } if ( headRot == NULL ) @@ -4001,7 +3865,24 @@ ivas_error IVAS_REND_SetHeadRotation( hIvasRend->headRotData.headRotEnabled = 1; for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) { +#ifdef FIX_I109_ORIENTATION_TRACKING + /* check for Euler angle signaling */ + if ( headRot[i].w == -3.0f ) + { + Euler2Quat( deg2rad( headRot[i].x ), deg2rad( headRot[i].y ), deg2rad( headRot[i].z ), &rotQuat ); + } + else + { + rotQuat = headRot[i]; + } + + ivas_orient_trk_Process( hIvasRend->headRotData.hOrientationTracker, rotQuat, FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES, &hIvasRend->headRotData.headPositions[i] ); +#else hIvasRend->headRotData.headPositions[i] = headRot[i]; +#endif +#ifdef TD5 + hIvasRend->headRotData.Pos[i] = Pos[i]; +#endif } } @@ -4009,6 +3890,164 @@ ivas_error IVAS_REND_SetHeadRotation( } +#ifdef FIX_I109_ORIENTATION_TRACKING +/*-------------------------------------------------------------------* + * IVAS_REND_SetOrientationTrackingMode() + * + * + *-------------------------------------------------------------------*/ + +ivas_error IVAS_REND_SetOrientationTrackingMode( + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + const uint8_t otrMode /* i : Orientation tracking mode */ +) +{ + OTR_TRACKING_T mode; + ivas_error error; + + if ( hIvasRend == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + switch ( otrMode ) + { + case IVAS_ORIENT_TRK_AVG: + mode = OTR_TRACKING_AVG_ORIENT; + break; + case IVAS_ORIENT_TRK_REF: + mode = OTR_TRACKING_REF_ORIENT; + break; +#ifdef OTR_REFERENCE_VECTOR_TRACKING + case IVAS_ORIENT_TRK_REF_VEC: + mode = OTR_TRACKING_REF_VEC; + break; + case IVAS_ORIENT_TRK_REF_VEC_LEV: + mode = OTR_TRACKING_REF_VEC_LEV; + break; +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ + case IVAS_ORIENT_TRK_NONE: + default: + mode = OTR_TRACKING_NONE; + break; + } + + if ( ( error = ivas_orient_trk_SetTrackingType( hIvasRend->headRotData.hOrientationTracker, mode ) ) != IVAS_ERR_OK ) + { + return error; + } + + return IVAS_ERR_OK; +} + + +/*-------------------------------------------------------------------* + * IVAS_REND_SetReferenceRotation() + * + * + *-------------------------------------------------------------------*/ + +ivas_error IVAS_REND_SetReferenceRotation( + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + const IVAS_QUATERNION refRot /* i : Reference rotation */ +) +{ + ivas_error error; + + /* Validate function arguments */ + if ( hIvasRend == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + if ( ( error = ivas_orient_trk_SetReferenceRotation( hIvasRend->headRotData.hOrientationTracker, refRot ) ) != IVAS_ERR_OK ) + { + return error; + } + + return IVAS_ERR_OK; +} + + +/*-------------------------------------------------------------------* + * IVAS_REND_GetMainOrientation() + * + * + *-------------------------------------------------------------------*/ + +ivas_error IVAS_REND_GetMainOrientation( + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer for main orientation */ +) +{ + ivas_error error; + + if ( hIvasRend == NULL || pOrientation == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + if ( ( error = ivas_orient_trk_GetMainOrientation( hIvasRend->headRotData.hOrientationTracker, pOrientation ) ) != IVAS_ERR_OK ) + { + return error; + } + + return IVAS_ERR_OK; +} + + +/*-------------------------------------------------------------------* + * IVAS_REND_GetTrackedRotation() + * + * + *-------------------------------------------------------------------*/ + +ivas_error IVAS_REND_GetTrackedRotation( + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + IVAS_QUATERNION *pRotation /* i/o: Quaternion pointer processed rotation */ +) +{ + ivas_error error; + + if ( hIvasRend == NULL || pRotation == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + if ( ( error = ivas_orient_trk_GetTrackedRotation( hIvasRend->headRotData.hOrientationTracker, pRotation ) ) != IVAS_ERR_OK ) + { + return error; + } + + return IVAS_ERR_OK; +} + + +#ifdef OTR_REFERENCE_VECTOR_TRACKING +/*---------------------------------------------------------------------* + * IVAS_REND_SetReferenceVector( ) + * + * Sets a reference vector spanning from listenerPos to refPos. Only + * available in OTR_TRACKING_REF_VEC and OTR_TRACKING_REF_VEC_LEV modes. + *---------------------------------------------------------------------*/ + +ivas_error IVAS_REND_SetReferenceVector( + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + const IVAS_VECTOR3 listenerPos, /* i : Listener position */ + const IVAS_VECTOR3 refPos /* i : Reference position */ +) +{ + if ( hIvasRend == NULL || hIvasRend->headRotData.hOrientationTracker == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + return ivas_orient_trk_SetReferenceVector( hIvasRend->headRotData.hOrientationTracker, listenerPos, refPos ); +} +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ +#endif + + /*-------------------------------------------------------------------* * Local functions *-------------------------------------------------------------------*/ @@ -4145,7 +4184,7 @@ static ivas_error rotateFrameMc( /* initialize gains to passthrough */ for ( ch_in = 0; ch_in < nchan; ch_in++ ) { - set_zero( gains[ch_in], (int16_t) nchan ); + set_zero( gains[ch_in], nchan ); gains[ch_in][ch_in] = 1.f; } @@ -4284,7 +4323,18 @@ static ivas_error rotateFrameSba( ( 1 - headRotData->crossfade[i] ) * gains_prev[n][m] * ( *readPtr ); } } +#ifdef FIX_376_SBA_ROTATE + /* write back the result */ + for ( n = m1; n < m2; n++ ) + { + writePtr = getSmplPtr( outAudio, n, subframe_idx * subframe_len + i ); + ( *writePtr ) = tmpRot[n - m1]; + } + m1 = m2; + m2 += 2 * ( l + 1 ) + 1; +#endif } +#ifndef FIX_376_SBA_ROTATE /* write back the result */ for ( n = m1; n < m2; n++ ) { @@ -4293,6 +4343,7 @@ static ivas_error rotateFrameSba( } m1 = m2; m2 += 2 * ( l + 1 ) + 1; +#endif } /*unoptimized code for reference (full matrix multiplication)*/ @@ -4339,9 +4390,7 @@ static ivas_error renderIsmToBinaural( NULL, ismInput->base.ctx.pHeadRotData, &ismInput->currentPos, -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - ismInput->reverb, -#endif + ismInput->hReverb, outAudio.config.numSamplesPerChannel, tmpTDRendBuffer ) ) != IVAS_ERR_OK ) { @@ -4364,11 +4413,7 @@ static ivas_error renderIsmToBinauralRoom( int16_t subframe_idx, subframe_len; int16_t tmp; rotation_matrix Rmat; -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; -#else - float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; -#endif IVAS_QUATERNION quat; ivas_error error; pan_vector currentPanGains; @@ -4382,8 +4427,7 @@ static ivas_error renderIsmToBinauralRoom( headRotData = ismInput->base.ctx.pHeadRotData; rotatedPos = defaultObjectPosition(); -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - if ( ismInput->reverb != NULL && ismInput->reverb->pConfig.roomAcoustics.use_brir == 0 && ismInput->reverb->pConfig.roomAcoustics.late_reverb_on == 1 && headRotData->headRotEnabled ) + if ( ismInput->hReverb != NULL && ismInput->hReverb->pConfig.roomAcoustics.use_brir == 0 && ismInput->hReverb->pConfig.roomAcoustics.late_reverb_on == 1 && headRotData->headRotEnabled ) { copyBufferTo2dArray( ismInput->base.inputBuffer, tmpRendBuffer ); @@ -4393,21 +4437,16 @@ static ivas_error renderIsmToBinauralRoom( NULL, ismInput->base.ctx.pHeadRotData, &ismInput->currentPos, -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - ismInput->reverb, -#endif + ismInput->hReverb, outAudio.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) { return error; } -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND accumulate2dArrayToBuffer( tmpRendBuffer, &outAudio ); -#endif } else { -#endif if ( headRotData->headRotEnabled ) { @@ -4479,43 +4518,18 @@ static ivas_error renderIsmToBinauralRoom( renderBufferChannelLerp( ismInput->base.inputBuffer, 0, currentPanGains, previousPanGains, tmpMcBuffer ); -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND copyBufferTo2dArray( tmpMcBuffer, tmpRendBuffer ); -#else - copyBufferTo2dArray( tmpMcBuffer, tmpCrendBuffer ); -#endif - - if ( ( error = ivas_rend_crendProcess( -#ifdef FIX_197_CREND_INTERFACE - ismInput->crendWrapper, -#else - &ismInput->crendWrapper, -#endif - AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM, -#ifdef FIX_197_CREND_INTERFACE - NULL, NULL, NULL, NULL, -#endif -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - tmpRendBuffer, -#else - tmpCrendBuffer, -#endif - *ismInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( ismInput->crendWrapper, AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM, + NULL, NULL, NULL, NULL, tmpRendBuffer, *ismInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND accumulate2dArrayToBuffer( tmpRendBuffer, &outAudio ); -#else - accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); -#endif free( tmpMcBuffer.data ); -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND } -#endif pop_wmops(); return IVAS_ERR_OK; @@ -4594,6 +4608,7 @@ static ivas_error renderIsmToSba( { return error; } + if ( ( error = getAmbisonicsOrder( outConfig, &ambiOrderOut ) ) != IVAS_ERR_OK ) { return error; @@ -4648,7 +4663,6 @@ static ivas_error renderInputIsm( /* Apply input gain to new audio */ v_multc( inAudio.data, ismInput->base.gain, inAudio.data, inAudio.config.numSamplesPerChannel * inAudio.config.numChannels ); - switch ( getAudioConfigType( outConfig ) ) { case IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED: @@ -4772,21 +4786,12 @@ static ivas_error renderMcToBinaural( headRotEnabled = mcInput->base.ctx.pHeadRotData->headRotEnabled; inConfig = mcInput->base.inConfig; - if ( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) || - ( headRotEnabled && ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ) ) + if ( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) || ( headRotEnabled && ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ) ) { copyBufferTo2dArray( mcInput->base.inputBuffer, tmpRendBuffer ); - if ( ( error = ivas_td_binaural_renderer_ext( &mcInput->tdRendWrapper, - mcInput->base.inConfig, - &mcInput->customLsInput, - mcInput->base.ctx.pHeadRotData, - NULL, -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - mcInput->reverb, -#endif - mcInput->base.inputBuffer.config.numSamplesPerChannel, - tmpRendBuffer ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_td_binaural_renderer_ext( &mcInput->tdRendWrapper, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, NULL, + mcInput->hReverb, mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) { return error; } @@ -4800,13 +4805,8 @@ static ivas_error renderMcToBinaural( tmpRotBuffer.data = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); set_zero( tmpRotBuffer.data, tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels ); - if ( ( error = rotateFrameMc( mcInput->base.inputBuffer, - mcInput->base.inConfig, - mcInput->customLsInput, - mcInput->base.ctx.pHeadRotData, - mcInput->rot_gains_prev, - mcInput->efapInWrapper.hEfap, - tmpRotBuffer ) ) != IVAS_ERR_OK ) + if ( ( error = rotateFrameMc( mcInput->base.inputBuffer, mcInput->base.inConfig, mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, + mcInput->rot_gains_prev, mcInput->efapInWrapper.hEfap, tmpRotBuffer ) ) != IVAS_ERR_OK ) { return error; } @@ -4820,16 +4820,8 @@ static ivas_error renderMcToBinaural( } /* call CREND */ - if ( ( error = ivas_rend_crendProcess( -#ifdef FIX_197_CREND_INTERFACE - mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, -#else - &mcInput->crendWrapper, - rendAudioConfigToIvasAudioConfig( mcInput->base.inConfig ), - rendAudioConfigToIvasAudioConfig( outConfig ), -#endif - tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), + NULL, NULL, NULL, NULL, tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } @@ -4853,105 +4845,59 @@ static ivas_error renderMcToBinauralRoom( const IVAS_REND_AudioConfig outConfig, IVAS_REND_AudioBuffer outAudio ) { -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND int8_t headRotEnabled; float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; IVAS_REND_AudioConfig inConfig; -#else - float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; -#endif ivas_error error; IVAS_REND_AudioBuffer tmpRotBuffer; push_wmops( "renderMcToBinauralRoom" ); -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND headRotEnabled = mcInput->base.ctx.pHeadRotData->headRotEnabled; inConfig = mcInput->base.inConfig; - if ( ( mcInput->reverb != NULL && mcInput->reverb->pConfig.roomAcoustics.use_brir == 0 && mcInput->reverb->pConfig.roomAcoustics.late_reverb_on == 1 ) && ( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) || ( headRotEnabled && ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ) ) ) + if ( ( mcInput->hReverb != NULL && mcInput->hReverb->pConfig.roomAcoustics.use_brir == 0 && mcInput->hReverb->pConfig.roomAcoustics.late_reverb_on == 1 ) && ( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) || ( headRotEnabled && ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ) ) ) { copyBufferTo2dArray( mcInput->base.inputBuffer, tmpRendBuffer ); - if ( ( error = ivas_td_binaural_renderer_ext( &mcInput->tdRendWrapper, - mcInput->base.inConfig, - &mcInput->customLsInput, - mcInput->base.ctx.pHeadRotData, - NULL, - mcInput->reverb, - mcInput->base.inputBuffer.config.numSamplesPerChannel, - tmpRendBuffer ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_td_binaural_renderer_ext( &mcInput->tdRendWrapper, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, + NULL, mcInput->hReverb, mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) { return error; } } else { - /* apply rotation */ if ( headRotEnabled ) -#else - /* apply rotation */ - if ( mcInput->base.ctx.pHeadRotData->headRotEnabled ) -#endif { tmpRotBuffer = mcInput->base.inputBuffer; tmpRotBuffer.data = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); set_zero( tmpRotBuffer.data, tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels ); - if ( ( error = rotateFrameMc( mcInput->base.inputBuffer, - mcInput->base.inConfig, - mcInput->customLsInput, - mcInput->base.ctx.pHeadRotData, - mcInput->rot_gains_prev, - mcInput->efapInWrapper.hEfap, - tmpRotBuffer ) ) != IVAS_ERR_OK ) + if ( ( error = rotateFrameMc( mcInput->base.inputBuffer, mcInput->base.inConfig, mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, + mcInput->rot_gains_prev, mcInput->efapInWrapper.hEfap, tmpRotBuffer ) ) != IVAS_ERR_OK ) { return error; } -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND copyBufferTo2dArray( tmpRotBuffer, tmpRendBuffer ); -#else - copyBufferTo2dArray( tmpRotBuffer, tmpCrendBuffer ); -#endif free( tmpRotBuffer.data ); } else { -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND copyBufferTo2dArray( mcInput->base.inputBuffer, tmpRendBuffer ); -#else - copyBufferTo2dArray( mcInput->base.inputBuffer, tmpCrendBuffer ); -#endif } /* call CREND */ - if ( ( error = ivas_rend_crendProcess( -#ifdef FIX_197_CREND_INTERFACE - mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, -#else - &mcInput->crendWrapper, - rendAudioConfigToIvasAudioConfig( mcInput->base.inConfig ), - rendAudioConfigToIvasAudioConfig( outConfig ), -#endif -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND - tmpRendBuffer, -#else - tmpCrendBuffer, -#endif - *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), + NULL, NULL, NULL, NULL, tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } -#ifdef FIX_330_ENABLE_TD_RENDERER_REVERB_REND } - accumulate2dArrayToBuffer( tmpRendBuffer, &outAudio ); -#else - accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); -#endif + accumulate2dArrayToBuffer( tmpRendBuffer, &outAudio ); /* TODO tmu : needs delay compensation */ if ( ( error = renderLfeToBinaural( mcInput, outAudio ) ) != IVAS_ERR_OK ) @@ -5005,7 +4951,7 @@ static ivas_error renderMcCustomLsToBinauralRoom( return error; } - tmpMcBuffer.config.numChannels = (int16_t) tmp; + tmpMcBuffer.config.numChannels = tmp; tmpMcBuffer.data = malloc( tmpMcBuffer.config.numSamplesPerChannel * tmpMcBuffer.config.numChannels * sizeof( float ) ); set_zero( tmpMcBuffer.data, tmpMcBuffer.config.numSamplesPerChannel * tmpMcBuffer.config.numChannels ); @@ -5017,15 +4963,8 @@ static ivas_error renderMcCustomLsToBinauralRoom( copyBufferTo2dArray( tmpMcBuffer, tmpCrendBuffer ); /* call CREND */ - if ( ( error = ivas_rend_crendProcess( -#ifdef FIX_197_CREND_INTERFACE - mcInput->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, NULL, NULL, NULL, -#else - &mcInput->crendWrapper, - AUDIO_CONFIG_7_1_4, - rendAudioConfigToIvasAudioConfig( outConfig ), -#endif - tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, NULL, NULL, NULL, + tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } @@ -5253,15 +5192,8 @@ static ivas_error renderSbaToBinaural( } /* call CREND */ - if ( ( error = ivas_rend_crendProcess( -#ifdef FIX_197_CREND_INTERFACE - sbaInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( sbaInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, NULL, NULL, NULL, -#else - &sbaInput->crendWrapper, - rendAudioConfigToIvasAudioConfig( sbaInput->base.inConfig ), - rendAudioConfigToIvasAudioConfig( outConfig ), -#endif - tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( sbaInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), + NULL, NULL, NULL, NULL, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } @@ -5316,7 +5248,7 @@ static ivas_error renderSbaToBinauralRoom( return error; } - tmpMcBuffer.config.numChannels = (int16_t) tmp; + tmpMcBuffer.config.numChannels = tmp; tmpMcBuffer.data = malloc( tmpMcBuffer.config.numSamplesPerChannel * tmpMcBuffer.config.numChannels * sizeof( float ) ); set_zero( tmpMcBuffer.data, tmpMcBuffer.config.numChannels * tmpMcBuffer.config.numSamplesPerChannel ); @@ -5329,16 +5261,8 @@ static ivas_error renderSbaToBinauralRoom( copyBufferTo2dArray( tmpMcBuffer, tmpCrendBuffer ); /* call CREND */ - if ( ( error = ivas_rend_crendProcess( -#ifdef FIX_197_CREND_INTERFACE - sbaInput->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, -#else - &sbaInput->crendWrapper, - AUDIO_CONFIG_7_1_4, - rendAudioConfigToIvasAudioConfig( outConfig ), -#endif - tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), + NULL, NULL, NULL, NULL, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } @@ -5586,7 +5510,7 @@ static ivas_error renderActiveInputsMasa( IVAS_REND_HANDLE hIvasRend, IVAS_REND_AudioBuffer outAudio ) { - int32_t i; + int16_t i; input_masa *pCurrentInput; ivas_error error; @@ -5622,10 +5546,7 @@ ivas_error IVAS_REND_GetSamples( ivas_error error; int16_t numOutChannels; - /*-----------------------------------------------------------------* - * Validate function arguments - *-----------------------------------------------------------------*/ - + /* Validate function arguments */ if ( hIvasRend == NULL || outAudio.data == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -5703,10 +5624,7 @@ void IVAS_REND_Close( uint16_t i; IVAS_REND_HANDLE hIvasRend; - /*-----------------------------------------------------------------* - * Validate function arguments - *-----------------------------------------------------------------*/ - + /* Validate function arguments */ if ( phIvasRend == NULL || *phIvasRend == NULL ) { return; @@ -5741,6 +5659,10 @@ void IVAS_REND_Close( ivas_limiter_close( &hIvasRend->hLimiter ); +#ifdef FIX_I109_ORIENTATION_TRACKING + closeHeadRotation( hIvasRend ); +#endif + free( hIvasRend ); *phIvasRend = NULL; diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 6db5fd91dc..b313bea5c1 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -244,8 +244,43 @@ int16_t IVAS_REND_FeedRenderConfig( ivas_error IVAS_REND_SetHeadRotation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ +#ifdef TD5 + const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME], /* i : head orientations for next rendering call */ + const IVAS_POSITION Pos[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : listener positions for next rendering call */ +#else const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : head positions for next rendering call */ +#endif +); + +#ifdef FIX_I109_ORIENTATION_TRACKING +ivas_error IVAS_REND_SetOrientationTrackingMode( + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + const uint8_t otrMode /* i : Orientation tracking mode */ +); + +ivas_error IVAS_REND_SetReferenceRotation( + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + const IVAS_QUATERNION refRot /* i : Reference rotation */ +); + +ivas_error IVAS_REND_GetMainOrientation( + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer for main orientation */ +); + +ivas_error IVAS_REND_GetTrackedRotation( + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + IVAS_QUATERNION *pRotation /* i/o: Quaternion pointer for processed rotation */ +); + +#ifdef OTR_REFERENCE_VECTOR_TRACKING +ivas_error IVAS_REND_SetReferenceVector( + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + const IVAS_VECTOR3 listenerPos, /* i : Listener position */ + const IVAS_VECTOR3 refPos /* i : Reference position */ ); +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ +#endif /* FIX_I109_ORIENTATION_TRACKING */ ivas_error IVAS_REND_GetSamples( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ diff --git a/lib_util/audio_file_reader.c b/lib_util/audio_file_reader.c index c7feefd7b7..4f6bd0c34d 100644 --- a/lib_util/audio_file_reader.c +++ b/lib_util/audio_file_reader.c @@ -40,9 +40,7 @@ struct AudioFileReader { FILE *rawFile; WAVEFILEIN *wavFile; -#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS uint32_t samplingRate; -#endif int16_t numChannels; }; @@ -57,26 +55,12 @@ static int8_t AudioFileReader_open_raw( static int8_t AudioFileReader_open_wav( AudioFileReader *self, - const char *fileName -#ifndef FIX_94_VERIFY_WAV_NUM_CHANNELS - , - int32_t *sampleRate -#endif -) + const char *fileName ) { -#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS uint32_t samplesInFile; -#else - uint32_t sampleRate_, samplesInFile; -#endif int16_t bps; -#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS self->wavFile = OpenWav( fileName, &self->samplingRate, &self->numChannels, &samplesInFile, &bps ); -#else - self->wavFile = OpenWav( fileName, &sampleRate_, &self->numChannels, &samplesInFile, &bps ); - *sampleRate = sampleRate_; -#endif if ( !self->wavFile ) { @@ -92,10 +76,6 @@ static int8_t AudioFileReader_open_wav( ivas_error AudioFileReader_open( AudioFileReader **audioReader, /* o : AudioFileReader handle */ const char *fileName /* i : path to wav/raw pcm file */ -#ifndef FIX_94_VERIFY_WAV_NUM_CHANNELS - , - int32_t *sampleRate /* o : sample rate of wav file, unused with pcm */ -#endif ) { AudioFileReader *self; @@ -118,19 +98,12 @@ ivas_error AudioFileReader_open( return IVAS_ERR_FAILED_FILE_OPEN; } self = calloc( sizeof( AudioFileReader ), 1 ); -#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS self->samplingRate = 0; -#endif self->numChannels = 0; if ( fileNameLen > wavSuffixLen && strncmp( fileName + fileNameLen - wavSuffixLen, wavSuffix, wavSuffixLen ) == 0 ) { - retCode = AudioFileReader_open_wav( self, fileName -#ifndef FIX_94_VERIFY_WAV_NUM_CHANNELS - , - sampleRate -#endif - ); + retCode = AudioFileReader_open_wav( self, fileName ); } else { @@ -206,7 +179,6 @@ ivas_error AudioFileReader_read( return error; } -#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS ivas_error AudioFileReader_getSamplingRate( AudioFileReader *self, int32_t *samplingRate ) @@ -257,17 +229,3 @@ ivas_error AudioFileReader_getNumChannels( return IVAS_ERR_OK; } -#else -/*! r: number of channels of the opened file */ -int16_t AudioFileReader_getNumChannels( - AudioFileReader *self /* i/o: AudioFileReader handle */ -) -{ - if ( self != NULL ) - { - return self->numChannels; - } - - return 0; -} -#endif diff --git a/lib_util/audio_file_reader.h b/lib_util/audio_file_reader.h index a944c85dc1..0fd4da5ac7 100644 --- a/lib_util/audio_file_reader.h +++ b/lib_util/audio_file_reader.h @@ -43,9 +43,6 @@ typedef struct AudioFileReader AudioFileReader; ivas_error AudioFileReader_open( AudioFileReader **audioReader, /* o : AudioFileReader handle */ const char *fileName /* i : path to wav/raw pcm file */ -#ifndef FIX_94_VERIFY_WAV_NUM_CHANNELS - ,int32_t *sampleRate /* o : sample rate of wav file, unused with pcm */ -#endif ); ivas_error AudioFileReader_read( @@ -55,7 +52,6 @@ ivas_error AudioFileReader_read( int16_t *numSamplesRead /* i : number of samples actualy read */ ); -#ifdef FIX_94_VERIFY_WAV_NUM_CHANNELS /*! r: ivas error - in particular, IVAS_ERR_SAMPLING_RATE_UNKNOWN if the opened file has no sampling rate metadata */ ivas_error AudioFileReader_getSamplingRate( AudioFileReader *self, /* i/o: AudioFileReader handle */ @@ -67,12 +63,6 @@ ivas_error AudioFileReader_getNumChannels( AudioFileReader *self, /* i/o: AudioFileReader handle */ int16_t * numChannels /* o : number fo channels in opened audio file */ ); -#else -/*! r: number of channels of the opened file */ -int16_t AudioFileReader_getNumChannels( - AudioFileReader *self /* i/o: AudioFileReader handle */ -); -#endif void AudioFileReader_close( AudioFileReader **selfPtr /* i/o: pointer to AudioFileReader handle */ diff --git a/lib_util/audio_file_writer.c b/lib_util/audio_file_writer.c index d6cbb1810e..b27a8ceca6 100644 --- a/lib_util/audio_file_writer.c +++ b/lib_util/audio_file_writer.c @@ -98,7 +98,11 @@ ivas_error AudioFileWriter_open( int8_t retCode; +#ifdef FIX_I109_ORIENTATION_TRACKING + if ( ( fileNameLen > wavSuffixLen ) && ( strncmp( fileName + fileNameLen - wavSuffixLen, wavSuffix, wavSuffixLen ) == 0 ) ) +#else if ( fileNameLen > wavSuffixLen && strncmp( fileName + fileNameLen - wavSuffixLen, wavSuffix, wavSuffixLen ) == 0 ) +#endif { retCode = AudioFileWriter_open_wav( self, fileName, sampleRate, numChannels ); } diff --git a/lib_util/head_rotation_file_reader.c b/lib_util/head_rotation_file_reader.c index 533c14a651..500fdd2b7a 100644 --- a/lib_util/head_rotation_file_reader.c +++ b/lib_util/head_rotation_file_reader.c @@ -91,39 +91,125 @@ ivas_error HeadRotationFileReader_open( * Read values from the trajectory file *-----------------------------------------------------------------------*/ +#ifdef FIX_I109_ORIENTATION_TRACKING ivas_error HeadRotationFileReading( HeadRotFileReader *headRotReader, /* i/o: HeadRotFileReader handle */ - IVAS_QUATERNION *Quaternions, /* o : head-tracking data */ - const int32_t frame_dec /* i : decoded frame number */ +#ifdef TD5 + IVAS_QUATERNION *pQuaternion, /* o : head-tracking data */ + IVAS_POSITION *pPos /* o : listener position */ +#else + IVAS_QUATERNION *pQuaternion /* o : head-tracking data */ +#endif +) +{ + float w, x, y, z; +#ifdef TD5 + float posx, posy, posz; + int32_t read_values; + + posx = 0.0f; + posy = 0.0f; + posz = 0.0f; +#endif + +#ifdef TD5 + read_values = fscanf( headRotReader->trajFile, "%f,%f,%f,%f,%f,%f,%f", &w, &x, &y, &z, &posx, &posy, &posz ); + if ( ( read_values != 4 ) && ( read_values != 7 ) ) /* Allow either orientation (4) or orientation+position (4+3) */ +#else + if ( 4 != fscanf( headRotReader->trajFile, "%f,%f,%f,%f", &w, &x, &y, &z ) ) +#endif + { + if ( feof( headRotReader->trajFile ) ) + { + rewind( headRotReader->trajFile ); + headRotReader->fileRewind = true; +#ifdef TD5 + return HeadRotationFileReading( headRotReader, pQuaternion, pPos ); +#else + return HeadRotationFileReading( headRotReader, pQuaternion ); +#endif + } + return IVAS_ERR_FAILED_FILE_PARSE; + } + + ( headRotReader->frameCounter )++; + + pQuaternion->w = w; + pQuaternion->x = x; + pQuaternion->y = y; + pQuaternion->z = z; +#ifdef TD5 + if ( pPos != NULL ) + { + pPos->x = posx; + pPos->y = posy; + pPos->z = posz; + } +#endif + + return IVAS_ERR_OK; +} + +#else +ivas_error HeadRotationFileReading( + HeadRotFileReader *headRotReader, /* i/o: HeadRotFileReader handle */ + IVAS_QUATERNION *Quaternions, /* o : head-tracking data, listener orientation */ +#ifdef TD5 + IVAS_POSITION *Pos /* o : listener position */ +#else + const int32_t frame_dec /* i : decoded frame number */ +#endif ) { uint16_t i; float w, x, y, z; +#ifdef TD5 + float posx, posy, posz; + int32_t read_values; + + posx = 0.0f; + posy = 0.0f; + posz = 0.0f; +#endif for ( i = 0; i < IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { +#ifdef TD5 + read_values = fscanf( headRotReader->trajFile, "%f,%f,%f,%f,%f,%f,%f", &w, &x, &y, &z, &posx, &posy, &posz ); + if ( ( read_values != 4 ) && ( read_values != 7 ) ) /* Allow either orientation (4) or orientation+position (4+3) */ +#else if ( 4 != fscanf( headRotReader->trajFile, "%f,%f,%f,%f", &w, &x, &y, &z ) ) +#endif { if ( feof( headRotReader->trajFile ) ) { rewind( headRotReader->trajFile ); headRotReader->fileRewind = true; +#ifdef TD5 + return HeadRotationFileReading( headRotReader, Quaternions, Pos ); +#else return HeadRotationFileReading( headRotReader, Quaternions, frame_dec ); +#endif } return IVAS_ERR_FAILED_FILE_PARSE; } - ( headRotReader->frameCounter )++; Quaternions[i].w = w; Quaternions[i].x = x; Quaternions[i].y = y; Quaternions[i].z = z; +#ifdef TD5 + Pos[i].x = posx; + Pos[i].y = posy; + Pos[i].z = posz; +#endif } return IVAS_ERR_OK; } +#endif /*-----------------------------------------------------------------------* diff --git a/lib_util/head_rotation_file_reader.h b/lib_util/head_rotation_file_reader.h index e70281401a..d735423e2c 100644 --- a/lib_util/head_rotation_file_reader.h +++ b/lib_util/head_rotation_file_reader.h @@ -57,11 +57,27 @@ ivas_error HeadRotationFileReader_open( * Read values from the trajectory file *-----------------------------------------------------------------------*/ +#ifdef FIX_I109_ORIENTATION_TRACKING +ivas_error HeadRotationFileReading( + HeadRotFileReader *headRotReader, /* i/o: HeadRotFileReader handle */ +#ifdef TD5 + IVAS_QUATERNION *pQuaternion, /* o : head-tracking data */ + IVAS_POSITION *pPos /* o : listener position */ +#else + IVAS_QUATERNION *pQuaternion /* o : head-tracking data */ +#endif +); +#else ivas_error HeadRotationFileReading( HeadRotFileReader *headRotReader, /* i/o: HeadRotFileReader handle */ IVAS_QUATERNION *Quaternions, /* o : head-tracking data */ - const int32_t frame_dec /* i : decoded frame number */ +#ifdef TD5 + IVAS_POSITION *Pos /* o : listener position */ +#else + const int32_t frame_dec /* i : decoded frame number */ +#endif ); +#endif /*-----------------------------------------------------------------------* * HeadRotationFileReader_close() diff --git a/lib_util/ism_file_reader.c b/lib_util/ism_file_reader.c index 77912f5c58..d60a7c1984 100644 --- a/lib_util/ism_file_reader.c +++ b/lib_util/ism_file_reader.c @@ -36,8 +36,13 @@ #include -#define META_LINE_LENGTH 200 /* max number of characters at one line of metadata input/output file */ -#define NUM_ISM_METADATA_PER_LINE 5 /* Number of ISM metadata per line in a metadata file */ +#define META_LINE_LENGTH 200 /* max number of characters at one line of metadata input/output file */ +#ifdef TD5 +#define NUM_ISM_METADATA_PER_LINE 7 /* Number of ISM metadata per line in a metadata file */ +#define NUM_MIN_ISM_METADATA 2 /* Minimum number of metadata parameters (azimuth and elevation) */ +#else +#define NUM_ISM_METADATA_PER_LINE 5 /* Number of ISM metadata per line in a metadata file */ +#endif struct IsmFileReader @@ -54,7 +59,7 @@ struct IsmFileReader *---------------------------------------------------------------------*/ IsmFileReader *IsmFileReader_open( - const char *filePath /* i : path to ism metadata file */ + const char *filePath /* i : path to ISM metadata file */ ) { IsmFileReader *self; @@ -90,15 +95,26 @@ IsmFileReader *IsmFileReader_open( /*! r: error code */ ivas_error IsmFileReader_readNextFrame( IsmFileReader *self, /* i/o: IsmFileReader handle */ - IVAS_ISM_METADATA *ismMetadata /* o ISM : metadata read from the opened file */ + IVAS_ISM_METADATA *ismMetadata /* o : ISM metadata read from the opened file */ ) { char char_buff[META_LINE_LENGTH]; float meta_prm[NUM_ISM_METADATA_PER_LINE]; +#ifdef TD5 + const float meta_prm_default[NUM_ISM_METADATA_PER_LINE] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f }; +#endif char *char_ptr; int16_t i; FILE *file; +#ifdef TD5 + /* Set default metadata parameters */ + for ( i = 0; i < NUM_ISM_METADATA_PER_LINE; i++ ) + { + meta_prm[i] = meta_prm_default[i]; + } +#endif + if ( ismMetadata == NULL || self->file == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -127,24 +143,34 @@ ivas_error IsmFileReader_readNextFrame( meta_prm[i++] = (float) atof( char_ptr ); } - +#ifdef TD5 + /* Check if minimum number of metadata values were read. Additional values are ignored. */ + if ( i < NUM_MIN_ISM_METADATA ) +#else if ( i != NUM_ISM_METADATA_PER_LINE ) +#endif { /* Not enough values provided in one line */ return IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT; } +#ifndef TD5 if ( char_ptr != NULL ) { /* Too many values provided in one line */ return IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT; } +#endif ismMetadata->azimuth = meta_prm[0]; ismMetadata->elevation = meta_prm[1]; ismMetadata->radius = meta_prm[2]; ismMetadata->spread = meta_prm[3]; ismMetadata->gainFactor = meta_prm[4]; +#ifdef TD5 + ismMetadata->yaw = meta_prm[5]; + ismMetadata->pitch = meta_prm[6]; +#endif /* verify whether the read metadata values are in an expected range */ if ( ismMetadata->azimuth > 180 || ismMetadata->azimuth < -180 ) @@ -171,6 +197,17 @@ ivas_error IsmFileReader_readNextFrame( { return IVAS_ERR_ISM_INVALID_METADATA_VALUE; } +#ifdef TD5 + if ( ismMetadata->yaw > 180 || ismMetadata->yaw < -180 ) + { + return IVAS_ERR_ISM_INVALID_METADATA_VALUE; + } + + if ( ismMetadata->pitch > 90 || ismMetadata->pitch < -90 ) + { + return IVAS_ERR_ISM_INVALID_METADATA_VALUE; + } +#endif return IVAS_ERR_OK; } diff --git a/lib_util/ism_file_writer.c b/lib_util/ism_file_writer.c index c4dffe38b0..870cf33586 100644 --- a/lib_util/ism_file_writer.c +++ b/lib_util/ism_file_writer.c @@ -35,8 +35,10 @@ #include -#define META_LINE_LENGTH 200 /* max number of characters at one line of metadata input/output file */ -#define NUM_ISM_METADATA_PER_LINE 5 /* Number of ISM metadata per line in a metadata file */ +#define META_LINE_LENGTH 200 /* max number of characters at one line of metadata input/output file */ +#ifndef TD5 +#define NUM_ISM_METADATA_PER_LINE 5 /* Number of ISM metadata per line in a metadata file */ +#endif struct IsmFileWriter @@ -54,7 +56,7 @@ struct IsmFileWriter /*! r: error code */ ivas_error IsmFileWriter_open( const char *filePathWav, /* i : path to output file */ - const int16_t obj_num, /* i : ISm number */ + const int16_t obj_num, /* i : number of ISM channels */ IsmFileWriter **ismWriter /* o : IsmFileWriter handle */ ) { @@ -115,7 +117,18 @@ ivas_error IsmFileWriter_writeFrame( file = ismWriter->file; /* IVAS_fmToDo: work in progress; currently position_azimuth, position_elevation, position_radius, spread, gain_factor */ +#ifdef FIX_293_EXT_RENDERER_CLI +#ifdef TD5 + sprintf( char_buff, "%+07.2f,%+06.2f,%05.2f,%06.2f,%04.2f,%+07.2f,%+06.2f\n", ismMetadata.azimuth, ismMetadata.elevation, ismMetadata.radius, ismMetadata.spread, ismMetadata.gainFactor, ismMetadata.yaw, ismMetadata.pitch ); +#else + sprintf( char_buff, "%+07.2f,%+06.2f,%05.2f,%06.2f,%04.2f\n", ismMetadata.azimuth, ismMetadata.elevation, ismMetadata.radius, ismMetadata.spread, ismMetadata.gainFactor ); +#endif +#endif +#ifdef TD5 + snprintf( char_buff, sizeof( char_buff ), "%+07.2f,%+06.2f,%05.2f,%06.2f,%04.2f,%+07.2f,%+06.2f\n", ismMetadata.azimuth, ismMetadata.elevation, ismMetadata.radius, ismMetadata.spread, ismMetadata.gainFactor, ismMetadata.yaw, ismMetadata.pitch ); +#else snprintf( char_buff, sizeof( char_buff ), "%+07.2f,%+06.2f,%05.2f,%06.2f,%04.2f\n", ismMetadata.azimuth, ismMetadata.elevation, ismMetadata.radius, ismMetadata.spread, ismMetadata.gainFactor ); +#endif if ( file ) { diff --git a/lib_util/ism_file_writer.h b/lib_util/ism_file_writer.h index 24b4c58bd4..d9f731e87e 100644 --- a/lib_util/ism_file_writer.h +++ b/lib_util/ism_file_writer.h @@ -43,7 +43,7 @@ typedef struct IsmFileWriter IsmFileWriter; /*! r: error code */ ivas_error IsmFileWriter_open( const char *filePathWav, /* i : path to output file */ - const int16_t obj_num, /* i : ISm number */ + const int16_t obj_num, /* i : number of ISM channels */ IsmFileWriter **ismWriter /* o : IsmFileReader handle */ ); diff --git a/lib_util/ls_custom_file_reader.c b/lib_util/ls_custom_file_reader.c index f73022e849..9b39fab486 100644 --- a/lib_util/ls_custom_file_reader.c +++ b/lib_util/ls_custom_file_reader.c @@ -52,7 +52,7 @@ struct LsCustomFileReader ivas_error CustomLsReader_open( const char *LsFilePath, /* i : LS custom layout file name */ - LsCustomFileReader **hLsCustomReader /* o : HeadRotFileReader handle */ + LsCustomFileReader **hLsCustomReader /* o : LsCustomFileReader handle */ ) { LsCustomFileReader *self; @@ -89,7 +89,7 @@ ivas_error CustomLsReader_open( *-----------------------------------------------------------------------*/ void CustomLsReader_close( - LsCustomFileReader **hLsCustomReader /* i/o: HeadRotFileReader handle */ + LsCustomFileReader **hLsCustomReader /* i/o: LsCustomFileReader handle */ ) { if ( hLsCustomReader == NULL || *hLsCustomReader == NULL ) @@ -228,7 +228,7 @@ static void CustomLoudspeakerLayout_print_info( *-------------------------------------------------------------------------*/ LS_CUSTOM_FILEREADER_ERROR CustomLsFileReading( - LsCustomFileReader *hLsCustomReader, /* i/o: HeadRotFileReader handle */ + LsCustomFileReader *hLsCustomReader, /* i/o: LsCustomFileReader handle */ IVAS_CUSTOM_LS_DATA *hLsCustomData /* o : Custom loudspeaker setup data */ ) { diff --git a/lib_util/ls_custom_file_reader.h b/lib_util/ls_custom_file_reader.h index 70c854aa9c..df7fe6bde7 100644 --- a/lib_util/ls_custom_file_reader.h +++ b/lib_util/ls_custom_file_reader.h @@ -64,7 +64,7 @@ typedef enum _LS_CUSTOM_FILEREADER_ERROR ivas_error CustomLsReader_open( const char *LsFilePath, /* i : LS custom layout file name */ - LsCustomFileReader **hLsCustomReader /* o : HeadRotFileReader handle */ + LsCustomFileReader **hLsCustomReader /* o : LsCustomFileReader handle */ ); /*-----------------------------------------------------------------------* @@ -74,7 +74,7 @@ ivas_error CustomLsReader_open( *-----------------------------------------------------------------------*/ void CustomLsReader_close( - LsCustomFileReader **hLsCustomReader /* i/o: HeadRotFileReader handle */ + LsCustomFileReader **hLsCustomReader /* i/o: LsCustomFileReader handle */ ); /*-------------------------------------------------------------------------* @@ -84,7 +84,7 @@ void CustomLsReader_close( *-------------------------------------------------------------------------*/ LS_CUSTOM_FILEREADER_ERROR CustomLsFileReading( - LsCustomFileReader *hLsCustomReader, /* i/o: HeadRotFileReader handle */ + LsCustomFileReader *hLsCustomReader, /* i/o: LsCustomFileReader handle */ IVAS_CUSTOM_LS_DATA *hLsCustomData /* o : Custom loudspeaker setup data */ ); diff --git a/lib_util/masa_file_writer.c b/lib_util/masa_file_writer.c index 5667968ece..74429f9185 100644 --- a/lib_util/masa_file_writer.c +++ b/lib_util/masa_file_writer.c @@ -67,8 +67,10 @@ struct MasaFileWriter *-----------------------------------------------------------------------*/ #ifndef FIX_350_MASA_DELAY_COMP +#ifndef FIX_373_MASA_DELAY_COMP_MSAN #define SPH_IDX_FRONT ( MASA_NO_POINTS_EQUATOR / 2 ) /* Spherical index corresponding to front direction for setting as default value */ #endif +#endif /*-----------------------------------------------------------------------* * Local functions diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 9fe7f019eb..907d148a6e 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -522,6 +522,15 @@ ivas_error RenderConfigReader_read( errorHandler( pValue, ERROR_VALUE_INVALID ); } } +#ifdef TD5 + else if ( strcmp( item, "DIRECTIVITY" ) == 0 ) + { + if ( read_vector( pValue, 3, hRenderConfig->directivity ) ) + { + errorHandler( item, ERROR_VALUE_INVALID ); + } + } +#endif #ifdef DEBUGGING else { diff --git a/lib_util/vector3_pair_file_reader.c b/lib_util/vector3_pair_file_reader.c new file mode 100644 index 0000000000..1b8a95bc88 --- /dev/null +++ b/lib_util/vector3_pair_file_reader.c @@ -0,0 +1,166 @@ +/****************************************************************************************************** + + (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ + +#include "vector3_pair_file_reader.h" +#include +#include +#include +#include +#include "prot.h" +#include "options.h" /* only included to get access to the feature-defines */ + +#ifdef OTR_REFERENCE_VECTOR_TRACKING + +struct Vector3PairFileReader +{ + FILE *trajFile; + char *file_path; +}; + +/*-----------------------------------------------------------------------* + * Vector3PairFileReader_open() + * + * Allocate and initialize reader + *-----------------------------------------------------------------------*/ + +ivas_error Vector3PairFileReader_open( + const char *trajFilePath, /* i : trajectory file name */ + Vector3PairFileReader **vector3PairReader /* o : Vector3PairFileReader handle */ +) +{ + Vector3PairFileReader *self; + FILE *trajFile; + + /* Open trajectory file */ + if ( strlen( trajFilePath ) < 1 ) + { + return IVAS_ERR_FAILED_FILE_OPEN; + } + + trajFile = fopen( trajFilePath, "r" ); + + if ( !trajFile ) + { + return IVAS_ERR_FAILED_FILE_OPEN; + } + + self = calloc( sizeof( Vector3PairFileReader ), 1 ); + self->trajFile = trajFile; + self->file_path = calloc( sizeof( char ), strlen( trajFilePath ) + 1 ); + strcpy( self->file_path, trajFilePath ); + + *vector3PairReader = self; + + return IVAS_ERR_OK; +} + + +/*-----------------------------------------------------------------------* + * Vector3PairFileReader_read() + * + * Read one line of values from the trajectory file + *-----------------------------------------------------------------------*/ + +ivas_error Vector3PairFileReader_read( + Vector3PairFileReader *vector3PairReader, /* i/o: Vector3PairFileReader handle */ + IVAS_VECTOR3 *pFirst, /* o : first x,y,z position in the line */ + IVAS_VECTOR3 *pSecond /* o : second x,y,z position in the line */ +) +{ + float x1, y1, z1, x2, y2, z2; + + if ( vector3PairReader == NULL || pFirst == NULL || pSecond == NULL ) + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + + if ( 6 != fscanf( vector3PairReader->trajFile, "%f,%f,%f,%f,%f,%f", &x1, &y1, &z1, &x2, &y2, &z2 ) ) + { + if ( feof( vector3PairReader->trajFile ) ) + { + rewind( vector3PairReader->trajFile ); + return Vector3PairFileReader_read( vector3PairReader, pFirst, pSecond ); + } + return IVAS_ERR_FAILED_FILE_PARSE; + } + + pFirst->x = x1; + pFirst->y = y1; + pFirst->z = z1; + pSecond->x = x2; + pSecond->y = y2; + pSecond->z = z2; + + return IVAS_ERR_OK; +} + +/*-----------------------------------------------------------------------* + * Vector3PairFileReader_close() + * + * Deallocates memory for the Head-Tracking reader + *-----------------------------------------------------------------------*/ + +void Vector3PairFileReader_close( + Vector3PairFileReader **reader /* i/o: Vector3PairFileReader handle */ +) +{ + if ( reader == NULL || *reader == NULL ) + { + return; + } + + fclose( ( *reader )->trajFile ); + free( ( *reader )->file_path ); + free( *reader ); + *reader = NULL; + + return; +} + + +/*-----------------------------------------------------------------------* + * Vector3PairFileReader_getFilePath() + * + * + *-----------------------------------------------------------------------*/ + +const char *Vector3PairFileReader_getFilePath( + Vector3PairFileReader *reader /* i/o: Vector3PairFileReader handle */ +) +{ + if ( reader == NULL ) + { + return NULL; + } + + return reader->file_path; +} + +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ diff --git a/lib_debug/segsnr.c b/lib_util/vector3_pair_file_reader.h similarity index 52% rename from lib_debug/segsnr.c rename to lib_util/vector3_pair_file_reader.h index 5e5cee48b0..a2fd706fc2 100644 --- a/lib_debug/segsnr.c +++ b/lib_util/vector3_pair_file_reader.h @@ -30,76 +30,60 @@ *******************************************************************************************************/ -#include -#ifdef DEBUGGING -#include "debug.h" -#endif -#include "wmc_auto.h" -#include -#include "options.h" -#include "prot.h" - -#define WMC_TOOL_SKIP - -#ifdef OUTPUT_SNR -/*_____________________________________________________________________ - | | - | FUNCTION NAME segsnr | - | Computes the segmential signal-to-noise ratio between the | - | signal x and its estimate xe of length n samples. The segment | - | length is nseg samples. | - | - | INPUT - | x[0:n-1] Signal of n samples. - | xe[0:n-1] Estimated signal of n samples. - | n Signal length. - | nseg Segment length, must be a submultiple of n. - | - | RETURN VALUE - | snr Segmential signal to noise ratio in dB. - |_____________________________________________________________________| -*/ - -float segsnr( float x[], float xe[], int16_t n, int16_t nseg ) -{ - float snr = 0.0f; - float signal, noise, error, fac; - int16_t i, j; - LOOP( 1 ); - for ( i = 0; i < n; i += nseg ) - { - signal = 1e-6f; - MOVE( 2 ); - noise = 1e-6f; - LOOP( 1 ); - for ( j = 0; j < nseg; j++ ) - { - signal += ( *x ) * ( *x ); - MAC( 1 ); - error = *x++ - *xe++; - ADD( 1 ); - noise += error * error; - MAC( 1 ); - } - snr += (float) log10( signal / noise ); - TRANS( 1 ); - DIV( 1 ); - ADD( 1 ); - } - fac = ( (float) ( 10 * nseg ) ) / (float) n; - DIV( 1 ); - MULT( 1 ); - snr = fac * snr; - MULT( 1 ); - ADD( 1 ); - BRANCH( 1 ); - if ( snr < -99.0f ) - { - snr = -99.0f; - MOVE( 1 ); - } - return ( snr ); -} -#endif - -#undef WMC_TOOL_SKIP +#ifndef IVAS_V3PAIR_FILE_READER_H +#define IVAS_V3PAIR_FILE_READER_H + +#include "common_api_types.h" +#include "ivas_error.h" +#include "options.h" /* only included to get access to the feature-defines */ + +#ifdef OTR_REFERENCE_VECTOR_TRACKING + +typedef struct Vector3PairFileReader Vector3PairFileReader; + +/*-----------------------------------------------------------------------* + * Vector3PairFileReader_open() + * + * Allocate and initialize Head-Tracking handle + *-----------------------------------------------------------------------*/ + +ivas_error Vector3PairFileReader_open( + const char *trajFilePath, /* i : trajectory file name */ + Vector3PairFileReader **vector3PairReader /* o : Vector3PairFileReader handle */ +); + +/*-----------------------------------------------------------------------* + * Vector3PairFileReader_read() + * + * Read one line of values from the trajectory file + *-----------------------------------------------------------------------*/ + +ivas_error Vector3PairFileReader_read( + Vector3PairFileReader *vector3PairReader, /* i/o: Vector3PairFileReader handle */ + IVAS_VECTOR3 *pFirst, /* o : first x,y,z position in the line */ + IVAS_VECTOR3 *pSecond /* o : second x,y,z position in the line */ +); + +/*-----------------------------------------------------------------------* + * Vector3PairFileReader_close() + * + * Deallocates memory for the handle + *-----------------------------------------------------------------------*/ + +void Vector3PairFileReader_close( + Vector3PairFileReader **vector3PairReader /* i/o: Vector3PairFileReader handle */ +); + +/*-----------------------------------------------------------------------* + * Vector3PairFileReader_getFilePath() + * + * + *-----------------------------------------------------------------------*/ + +const char *Vector3PairFileReader_getFilePath( + Vector3PairFileReader *vector3PairReader /* i/o: Vector3PairFileReader handle */ +); + +#endif /* OTR_REFERENCE_VECTOR_TRACKING */ + +#endif /* IVAS_V3PAIR_FILE_READER_H */ diff --git a/scripts/IvasBuildAndRun.py b/scripts/IvasBuildAndRun.py index 77c0e3ad60..554c216b18 100755 --- a/scripts/IvasBuildAndRun.py +++ b/scripts/IvasBuildAndRun.py @@ -32,7 +32,6 @@ import os.path import sys -import pdb from pyivastest.IvasSvnBuilder import * from pyivastest import IvasScriptsCommon diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 223ac0352c..f26fba423a 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -161,19 +161,19 @@ ../IVAS_dec STEREO 48 bit testv/stvST48c.wav_stereo_32000_48-48_bandwidth_sw.tst // stereo at 32 kbps, 48kHz in, 32kHz out, random FEC at 6% -../IVAS_cod -stereo -max_band FB 32000 48 testv/stvST48c.wav bit +../IVAS_cod -stereo 32000 48 testv/stvST48c.wav bit ../IVAS_dec -fec testv/FEC_6pct.bin STEREO 32 bit testv/stvST48c.wav_stereo_32000_48-32_FEC5.tst // stereo at 32 kbps, 48kHz in, 48kHz out, DTX on, random FEC at 5% -../IVAS_cod -stereo -dtx -max_band FB 32000 48 testv/stvST48n.wav bit +../IVAS_cod -stereo -dtx 32000 48 testv/stvST48n.wav bit ../IVAS_dec -fec 5 STEREO 48 bit testv/stvST48n.wav_stereo_32000_48-48_DTX_FEC5.tst // stereo at 32 kbps, 48kHz in, 48kHz out, DTX on, MONO out, random FEC at 5% -../IVAS_cod -stereo -dtx -max_band FB 32000 48 testv/stvST48n.wav bit +../IVAS_cod -stereo -dtx 32000 48 testv/stvST48n.wav bit ../IVAS_dec -fec 5 MONO 48 bit testv/stvST48n.wav_stereo_32000_48-48_DTX_MONO_FEC5.tst // stereo at 32 kbps, 48kHz in, 16kHz out, DTX on, MONO out, random FEC at 5% -../IVAS_cod -stereo -dtx -max_band FB 32000 48 testv/stvST48n.wav bit +../IVAS_cod -stereo -dtx 32000 48 testv/stvST48n.wav bit ../IVAS_dec -fec 5 MONO 16 bit testv/stvST48n.wav_stereo_32000_48-16_DTX_MONO_FEC5.tst // stereo at 48 kbps, 16kHz in, 16kHz out @@ -250,153 +250,175 @@ -// 1 ISm with metadata at 13.2 kbps, 48 kHz in, 48 kHz out, MONO out +// 1 ISM with metadata at 13.2 kbps, 48 kHz in, 48 kHz out, MONO out ../IVAS_cod -ism 1 testv/stvISM1.csv 13200 48 testv/stv1ISM48s.wav bit ../IVAS_dec MONO 48 bit testv/stv1ISM48s.wav_13200_48-48_MONO.tst -// 1 ISm with metadata at 13.2 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL out, random FEC at 5% +// 1 ISM with metadata at 13.2 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL out, random FEC at 5% ../IVAS_cod -dtx -ism 1 testv/stvISM1.csv 13200 48 testv/stv48n.wav bit ../IVAS_dec -fec 5 BINAURAL 48 bit testv/stv48n.wav_13200_48-48_DTX_FEC5_BINAURAL.tst -// 2 ISm with metadata at 16.4 kbps, 48 kHz in, 48 kHz out, STEREO out +// 2 ISM with metadata at 16.4 kbps, 48 kHz in, 48 kHz out, STEREO out ../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 16400 48 testv/stv2ISM48s.wav bit ../IVAS_dec STEREO 48 bit testv/stv2ISM48s.wav_16400_48-48_STEREO.tst -// 3 ISm with metadata at 24.4 kbps, 48 kHz in, 48 kHz out, 7_1 out +// 2 ISM with metadata at 16.4 kbps, 48 kHz in, 48 kHz out, BINAURAL out +../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 16400 48 testv/stv2ISM48s.wav bit +../IVAS_dec BINAURAL 48 bit testv/stv2ISM48s.wav_16400_48-48_binaural.tst + +// 1 ISM with metadata at 16.4 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out +../IVAS_cod -ism 1 testv/stvISM1.csv 16400 48 testv/stv1ISM48s.wav bit +../IVAS_dec BINAURAL_ROOM 48 bit testv/stv1ISM48s.wav_16400_48-48_binaural_room.tst + +// 3 ISM with metadata at 24.4 kbps, 48 kHz in, 48 kHz out, 7_1 out ../IVAS_cod -ism 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 24400 48 testv/stv3ISM48s.wav bit ../IVAS_dec 7_1 48 bit testv/stv3ISM48s.wav_24400_48-48_7_1.tst -// 3 ISm with metadata at 24.4 kbps, 48 kHz in, 48 kHz out, MONO out, random FEC at 5% +// 3 ISM with metadata at 24.4 kbps, 48 kHz in, 48 kHz out, MONO out, random FEC at 5% ../IVAS_cod -ism 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 24400 48 testv/stv3ISM48s.wav bit ../IVAS_dec -fec 5 MONO 48 bit testv/stv3ISM48s.wav_24400_48-48_MONO_FEC5.tst -// 1 ISm with metadata at 32 kbps, 32 kHz in, 32 kHz out, DTX on, MONO out +// 3 ISM with metadata at 24.4 kbps, 48 kHz in, 48 kHz out, BINAURAL out +../IVAS_cod -ism 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 24400 48 testv/stv3ISM48s.wav bit +../IVAS_dec BINAURAL 48 bit testv/stv3ISM48s.wav_24400_48-48_binaural.tst + +// 1 ISM with metadata at 32 kbps, 32 kHz in, 32 kHz out, DTX on, MONO out ../IVAS_cod -dtx -ism 1 testv/stvISM1.csv 32000 32 testv/stv32n.wav bit ../IVAS_dec MONO 32 bit testv/stv32n.wav_32000_32-32_DTX_MONO.tst -// 4 ISm with metadata at 32 kbps, 48 kHz in, 48 kHz out, FOA out +// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, FOA out ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48s.wav bit ../IVAS_dec FOA 48 bit testv/stv4ISM48s.wav_32000_48-48_FOA.tst -// 4 ISm with metadata at 32 kbps, 48 kHz in, 48 kHz out, STEREO out +// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, STEREO out ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48s.wav bit ../IVAS_dec STEREO 48 bit testv/stv4ISM48s.wav_32000_48-48_STEREO.tst -// 3 ISm with metadata at 48 kbps, 48 kHz in, 48 kHz out, MONO out -../IVAS_cod -ism 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 48000 48 testv/stv3ISM48s.wav bit -../IVAS_dec MONO 48 bit testv/stv43ISM48s_48000_48-48_MONO.tst - -// 2 ISm with metadata at 64 kbps, 48 kHz in, 32 kHz out, 5_1 out -../IVAS_cod -max_band FB -ism 2 testv/stvISM1.csv testv/stvISM2.csv 64000 48 testv/stv2ISM48s.wav bit -../IVAS_dec 5_1 32 bit testv/stv2ISM48s.wav_64000_48-32_5_1.tst - -// 4 ISm with metadata at 80 kbps, 48 kHz in, 48 kHz out, HOA2 out -../IVAS_cod -max_band FB -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 80000 48 testv/stv4ISM48s.wav bit -../IVAS_dec HOA2 48 bit testv/stv4ISM48s.wav_80000_48-48_HOA2.tst - -// 4 ISm with metadata at 96 kbps, 48 kHz in, 48 kHz out, Custom LS setup out -../IVAS_cod -max_band FB -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 96000 48 testv/stv4ISM48s.wav bit -../IVAS_dec testv/ls_setup_16ch_8+4+4.txt 48 bit testv/stv4ISM48s.wav_96000_48-48_MC_custom_setup.tst - -// 3 ISm with metadata at 128 kbps, 48 kHz in, 32 kHz out, HOA3 out, random FEC at 5% -../IVAS_cod -max_band FB -ism 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 128000 48 testv/stv3ISM48s.wav bit -../IVAS_dec -fec 5 HOA3 32 bit testv/stv3ISM48s.wav_128000_48-32_HOA3_FEC5.tst - -// 4 ISm with metadata at 160 kbps, 48 kHz in, 48 kHz out, STEREO out -../IVAS_cod -max_band FB -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 160000 48 testv/stv4ISM48s.wav bit -../IVAS_dec STEREO 48 bit testv/stv4ISM48s.wav_160000_48-48_STEREO.tst - -// 2 ISm with metadata at 16.4 kbps, 48 kHz in, 48 kHz out, BINAURAL out -../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 16400 48 testv/stv2ISM48s.wav bit -../IVAS_dec BINAURAL 48 bit testv/stv2ISM48s.wav_16400_48-48_binaural.tst - -// 3 ISm with metadata at 24.4 kbps, 48 kHz in, 48 kHz out, BINAURAL out -../IVAS_cod -ism 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 24400 48 testv/stv3ISM48s.wav bit -../IVAS_dec BINAURAL 48 bit testv/stv3ISM48s.wav_24400_48-48_binaural.tst - -// 2 ISm with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL out, random FEC at 5% -../IVAS_cod -ism 2 testv/stvISM3.csv testv/stvISM4.csv 48000 48 testv/stv2ISM48s.wav bit -../IVAS_dec -fec 5 BINAURAL 48 bit testv/stv2ISM48s.wav_48000_48-48_binaural_FEC5.tst - -// 4 ISm with metadata at 32 kbps, 48 kHz in, 48 kHz out, BINAURAL out +// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, BINAURAL out ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48s.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv4ISM48s.wav_32000_48-48_binaural.tst -// 1 ISm with metadata at 16.4 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out -../IVAS_cod -ism 1 testv/stvISM1.csv 16400 48 testv/stv1ISM48s.wav bit -../IVAS_dec BINAURAL_ROOM 48 bit testv/stv1ISM48s.wav_16400_48-48_binaural_room.tst +// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL out +../IVAS_cod -dtx -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48n.wav bit +../IVAS_dec BINAURAL 48 bit testv/stv4ISM48n.wav_32000_48-48_DTX_BINAURAL.tst + +// 2 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, DTX on, HOA2 out +../IVAS_cod -dtx -ism 2 testv/stvISM1.csv testv/stvISM2.csv 32000 48 testv/stvST48c.wav bit +../IVAS_dec HOA2 48 bit testv/stv2ST48c.wav_32000_48-48_DTX_HOA2.tst + -// 2 ISm with metadata at 32 kbps, 48 kHz in, 48 kHz out, EXTERNAL out +// 2 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, EXTERNAL out ../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 32000 48 testv/stv2ISM48s.wav bit ../IVAS_dec EXT 48 bit testv/stv2ISM48s.wav_32000_48-48_external.tst -// 2 ISm with metadata at 64 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out +// 2 ISM with metadata at 64 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out ../IVAS_cod -ism 2 testv/stvISM3.csv testv/stvISM4.csv 64000 48 testv/stv2ISM48s.wav bit ../IVAS_dec BINAURAL_ROOM 48 bit testv/stv2ISM48s.wav_64000_48-48_binaural_room.tst -// 4 ISm with metadata at 32 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out, random FEC at 5% +// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out, random FEC at 5% ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48s.wav bit ../IVAS_dec -fec 5 BINAURAL_ROOM 48 bit testv/stv4ISM48s.wav_32000_48-48_binaural_room_FEC5.tst -// 4 ISm with metadata at 64 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out -../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 64000 48 testv/stv4ISM48s.wav bit -../IVAS_dec BINAURAL_ROOM 48 bit testv/stv4ISM48s.wav_64000_48-48_binaural_room.tst +// 3 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, MONO out +../IVAS_cod -ism 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 48000 48 testv/stv3ISM48s.wav bit +../IVAS_dec MONO 48 bit testv/stv43ISM48s_48000_48-48_MONO.tst + +// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL out +../IVAS_cod -dtx -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48n.wav bit +../IVAS_dec BINAURAL 48 bit testv/stv4ISM48n.wav_32000_48-48_DTX_BINAURAL.tst + +// 4 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL ROOM out, random FEC at 5% +../IVAS_cod -dtx -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 48000 48 testv/stv4ISM48n.wav bit +../IVAS_dec -fec 5 BINAURAL_ROOM 48 bit testv/stv4ISM48n.wav_48000_48-48_DTX_TD_binaural_room_FEC5.tst + +// 2 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL out, random FEC at 5% +../IVAS_cod -ism 2 testv/stvISM3.csv testv/stvISM4.csv 48000 48 testv/stv2ISM48s.wav bit +../IVAS_dec -fec 5 BINAURAL 48 bit testv/stv2ISM48s.wav_48000_48-48_binaural_FEC5.tst -// 1 ISm with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out, head rotation, random FEC at 5% +// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out, head rotation, random FEC at 5% ../IVAS_cod -ism 1 testv/stvISM1.csv 48000 48 testv/stv1ISM48s.wav bit ../IVAS_dec -fec 5 -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM 48 bit testv/stv1ISM48s.wav_64000_48-48_binaural_room_HR.tst -// 1 ISm with metadata at 96 kbps, 48 kHz in, 16 kHz out, TD BINAURAL out (Model from file) -../IVAS_cod -ism 1 testv/stvISM1.csv 96000 48 testv/stv1ISM48s.wav bit -../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit testv/stv2ISM48s.wav_96000_48-16_TD_binaural.tst +// 2 ISM with metadata at 64 kbps, 48 kHz in, 32 kHz out, 5_1 out +../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 64000 48 testv/stv2ISM48s.wav bit +../IVAS_dec 5_1 32 bit testv/stv2ISM48s.wav_64000_48-32_5_1.tst -// 2 ISm with metadata at 160 kbps, 48 kHz in, 32 kHz out, TD BINAURAL out -../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 160000 48 testv/stv2ISM48s.wav bit -../IVAS_dec BINAURAL 32 bit testv/stv2ISM48s.wav_160000_48-32_TD_binaural.tst +// 4 ISM with metadata at 64 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out +../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 64000 48 testv/stv4ISM48s.wav bit +../IVAS_dec BINAURAL_ROOM 48 bit testv/stv4ISM48s.wav_64000_48-48_binaural_room.tst -// 3 ISm with metadata at 192 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out (Model from file) -../IVAS_cod -ism 3 testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 192000 48 testv/stv3ISM48s.wav bit -../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL 48 bit testv/stv3ISM48s.wav_192000_48-48_TD_binaural.tst +// 2 ISM with metadata at 80 kbps, 48 kHz in, 48 kHz out, DTX on, stereo out +../IVAS_cod -dtx -ism 2 testv/stvISM1.csv testv/stvISM2.csv 80000 48 testv/stvST48c.wav bit +../IVAS_dec STEREO 48 bit testv/stv2ST48c.wav_80000_48-48_DTX_STEREO.tst -// 4 ISm with metadata at 256 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out -../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit -../IVAS_dec BINAURAL 48 bit testv/stv4ISM48s.wav_256000_48-48_TD_binaural.tst +// 4 ISM with metadata at 80 kbps, 48 kHz in, 48 kHz out, HOA2 out +../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 80000 48 testv/stv4ISM48s.wav bit +../IVAS_dec HOA2 48 bit testv/stv4ISM48s.wav_80000_48-48_HOA2.tst -// 1 ISm with metadata at 80 kbps, 48 kHz in, 16 kHz out, TD BINAURAL out (Model from file), head rotation, random FEC at 5% +// 1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), head rotation, random FEC at 5% ../IVAS_cod -ism 1 testv/stvISM1.csv 80000 48 testv/stv1ISM48s.wav bit -../IVAS_dec -fec 5 -t testv/headrot_case00_3000_q.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit testv/stv2ISM48s.wav_80000_48-16_TDHR_FEC5.tst +../IVAS_dec -fec 5 -t testv/headrot_case00_3000_q.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit testv/stv2ISM48s.wav_80000_48-16_binaural_file_TDHR_FEC5.tst -// 2 ISm with metadata at 128 kbps, 48 kHz in, 32 kHz out, TD BINAURAL out (Model from file), head rotation +// 4 ISM with metadata at 96 kbps, 48 kHz in, 48 kHz out, Custom LS setup out +../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 96000 48 testv/stv4ISM48s.wav bit +../IVAS_dec testv/ls_setup_16ch_8+4+4.txt 48 bit testv/stv4ISM48s.wav_96000_48-48_MC_custom_setup.tst + +// 1 ISM with metadata at 96 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file) +../IVAS_cod -ism 1 testv/stvISM1.csv 96000 48 testv/stv1ISM48s.wav bit +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit testv/stv2ISM48s.wav_96000_48-16_binaural.tst + +// 3 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, HOA3 out, random FEC at 5% +../IVAS_cod -ism 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 128000 48 testv/stv3ISM48s.wav bit +../IVAS_dec -fec 5 HOA3 32 bit testv/stv3ISM48s.wav_128000_48-32_HOA3_FEC5.tst + + +// 2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), head rotation ../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 128000 48 testv/stv2ISM48s.wav bit -../IVAS_dec -t testv/headrot_case01_3000_q.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin BINAURAL 32 bit testv/stv2ISM48s.wav_128000_48-32_TDHR.tst +../IVAS_dec -t testv/headrot_case01_3000_q.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin BINAURAL 32 bit testv/stv2ISM48s.wav_128000_48-32_binaural_file_TDHR.tst + +// 4 ISM with metadata at 160 kbps, 48 kHz in, 48 kHz out, STEREO out +../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 160000 48 testv/stv4ISM48s.wav bit +../IVAS_dec STEREO 48 bit testv/stv4ISM48s.wav_160000_48-48_STEREO.tst -// 3 ISm with metadata at 192 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out, head rotation, random FEC at 5% +// 2 ISM with metadata at 160 kbps, 48 kHz in, 32 kHz out, BINAURAL out +../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 160000 48 testv/stv2ISM48s.wav bit +../IVAS_dec BINAURAL 32 bit testv/stv2ISM48s.wav_160000_48-32_binaural.tst + +// 3 ISM with metadata at 192 kbps, 48 kHz in, 48 kHz out, BINAURAL out (Model from file) +../IVAS_cod -ism 3 testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 192000 48 testv/stv3ISM48s.wav bit +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL 48 bit testv/stv3ISM48s.wav_192000_48-48_binaural)file.tst + +// 3 ISM with metadata at 192 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, random FEC at 5% ../IVAS_cod -ism 3 testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 192000 48 testv/stv3ISM48s.wav bit -../IVAS_dec -fec 5 -t testv/headrot_case02_3000_q.csv BINAURAL 48 bit testv/stv3ISM48s.wav_192000_48-48_TDHR_FEC5.tst +../IVAS_dec -fec 5 -t testv/headrot_case02_3000_q.csv BINAURAL 48 bit testv/stv3ISM48s.wav_192000_48-48_binaural_file_TDHR_FEC5.tst -// 4 ISm with metadata at 256 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out, head rotation +// 4 ISM with metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit -../IVAS_dec -t testv/headrot_case03_3000_q.csv BINAURAL 48 bit testv/stv4ISM48s.wav_256000_48-48_TDHR.tst +../IVAS_dec BINAURAL 48 bit testv/stv4ISM48s.wav_256000_48-48_binaural.tst -// 3 ISm with metadata at 384 kbps, 48 kHz in, 32 kHz out, 7_1_4 out +// 4 ISM with metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation +../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit +../IVAS_dec -t testv/headrot_case03_3000_q.csv BINAURAL 48 bit testv/stv4ISM48s.wav_256000_48-48_binaural_file_TDHR.tst + +// 3 ISM with metadata at 384 kbps, 48 kHz in, 32 kHz out, 7_1_4 out ../IVAS_cod -ism 3 testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 384000 48 testv/stv3ISM48s.wav bit ../IVAS_dec 7_1_4 32 bit testv/stv3ISM48s.wav_384000_48-32_7_1_4.tst -// 4 ISm with metadata at 512 kbps, 48 kHz in, 48 kHz out, 5_1 +// 4 ISM with metadata at 512 kbps, 48 kHz in, 48 kHz out, 5_1 ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 512000 48 testv/stv4ISM48s.wav bit ../IVAS_dec 5_1 48 bit testv/stv4ISM48s.wav_512000_48-48_5_1.tst -// 1 ISm with metadata bitrate switching from 13.2 kbps to 128 kbps, 32 kHz in, 32 kHz out, mono out, DTX on +// 1 ISM with metadata bitrate switching from 13.2 kbps to 128 kbps, 32 kHz in, 32 kHz out, mono out, DTX on ../IVAS_cod -dtx -ism 1 testv/stvISM1.csv ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 32 testv/stv32c.wav bit ../IVAS_dec MONO 32 bit testv/stv32c.wav_brate_sw_32-32_mono_dtx.tst -// 4 ISm with metadata bitrate switching from 24.4 kbps to 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out +// 4 ISM with metadata bitrate switching from 24.4 kbps to 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv4ISM48s.wav bit -../IVAS_dec BINAURAL 48 bit testv/stv4ISM48s.wav_brate_sw_48-48_BINAURAL.tst +../IVAS_dec BINAURAL 48 bit testv/stv4ISM48s.wav_brate_sw_48-48_binaural.tst -// 4 ISm with metadata at 256 kbps, 48 kHz in, 48 kHz out, DTX on, TD BINAURAL out -../IVAS_cod -dtx -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48n.wav bit -../IVAS_dec BINAURAL 48 bit testv/stv4ISM48n.wav_256000_48-48_DTX_TD_binaural.tst +// 4 ISm with and without metadata bitrate switching from 24.4 kbps to 256 kbps, 48 kHz in, 48 kHz out, DTX on, HOA3 out +../IVAS_cod -dtx -ism 4 testv/stvISM1.csv NULL NULL testv/stvISM4.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv4ISM48s.wav bit +../IVAS_dec HOA3 48 bit testv/stv4ISM48s.wav_brate_sw_48-48_DTX_hoa3.tst @@ -493,7 +515,7 @@ ../IVAS_dec -fec 5 FOA 32 bit testv/stvFOA32c.wav_SBA_64000_32-32_DTX_FOA.tst // SBA at 64 kbps, 48kHz in, 48kHz out, 5_1_4 out -../IVAS_cod -max_band FB -sba 1 64000 48 testv/stvFOA48c.wav bit +../IVAS_cod -sba 1 64000 48 testv/stvFOA48c.wav bit ../IVAS_dec 5_1_4 48 bit testv/stvFOA48c.wav_SBA_64000_48-48_5_1_4.tst // SBA at 64 kbps, 48kHz in, 48kHz out, 7_1_4 out diff --git a/scripts/pyivastest/IvasModeAnalyzer.py b/scripts/pyivastest/IvasModeAnalyzer.py index 3562837e34..fed4f29ecd 100644 --- a/scripts/pyivastest/IvasModeAnalyzer.py +++ b/scripts/pyivastest/IvasModeAnalyzer.py @@ -36,7 +36,6 @@ import operator from copy import deepcopy import logging import functools -import pdb from pyivastest.IvasModeCollector import IvasModeCollector from pyivastest.constants import LOG_FILE_EXT @@ -45,7 +44,7 @@ from pyivastest.IvasBaseClass import IvasBaseClass INSTRUMENTED_RESULTS = { "WMOPS": { - "keyword": " total", + "keyword": "total", "number_format": "{:.5g}", "position": 2, "max_or_add": "add", @@ -939,8 +938,6 @@ class IvasModeAnalyzer(IvasModeCollector): """ - # pdb.set_trace() - if not os.path.exists(os.path.dirname(csv_file_name)): os.makedirs(os.path.dirname(csv_file_name)) diff --git a/scripts/pyivastest/IvasScriptsCommon.py b/scripts/pyivastest/IvasScriptsCommon.py index dcbd08c146..3df9994170 100644 --- a/scripts/pyivastest/IvasScriptsCommon.py +++ b/scripts/pyivastest/IvasScriptsCommon.py @@ -39,7 +39,6 @@ from pyivastest.IvasBaseClass import * import pyivastest.constants as constants import logging import platform -import pdb # make sure we have colored output using shell escapes correctly on windows if platform.system() == "Windows": # Only if we are running on Windows @@ -304,8 +303,6 @@ class IvasScriptArgParser(argparse.ArgumentParser): args["loglevel"] = args["loglevel"].upper() # do some sanity checks here - # pdb.set_trace() - # check if config file exists if ( "config" in args.keys() diff --git a/scripts/pyivastest/IvasSvnBuilder.py b/scripts/pyivastest/IvasSvnBuilder.py index edcea1bb18..0d7cc9c847 100644 --- a/scripts/pyivastest/IvasSvnBuilder.py +++ b/scripts/pyivastest/IvasSvnBuilder.py @@ -42,7 +42,6 @@ import logging from getpass import getpass import urllib.parse from multiprocessing import cpu_count -import pdb from pyivastest.IvasModeRunner import * from pyivastest.IvasModeAnalyzer import * @@ -1111,7 +1110,6 @@ class IvasBuilderAndRunner(IvasBaseClass): self.build_and_run_dict[cfg_name]["runner"].dir_name = run_dir self.build_and_run_dict[cfg_name]["analyzer"].dir = run_dir self.build_and_run_dict[cfg_name]["runner"].run() - if self.build_and_run_dict[cfg_name]["analyzer"].get_errors: failed_modes = self.build_and_run_dict[cfg_name]["runner"].failed_modes self.build_and_run_dict[cfg_name]["analyzer"].get_errors(failed_modes) diff --git a/scripts/testv/stv16c.wav b/scripts/testv/stv16c.wav index 6923cea4ed..d107fe711d 100644 --- a/scripts/testv/stv16c.wav +++ b/scripts/testv/stv16c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:787f5198da219f4a449b2269d9f2a7c592abdbc9554a991b8b9656d53aac1884 -size 640108 +oid sha256:61f9eca5dafeb46a6aa29c82a8252ebb4ffd4e7a7255f5a4653d8335e685872e +size 640046 diff --git a/scripts/testv/stv16n.wav b/scripts/testv/stv16n.wav index dd94fc0e63..9a9c8798e5 100644 --- a/scripts/testv/stv16n.wav +++ b/scripts/testv/stv16n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:831f2439e3d728595e3583fea053a5f7130e5f09b69832e686b76a69d93bbcee -size 620908 +oid sha256:7d0ac0846c3046d91843b390fbef3a0180dac92b7d53e4079b3541d43b8af188 +size 620846 diff --git a/scripts/testv/stv1ISM48s.wav b/scripts/testv/stv1ISM48s.wav index ddcd5d3324..da05075565 100644 --- a/scripts/testv/stv1ISM48s.wav +++ b/scripts/testv/stv1ISM48s.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c6914081054030a4a99ab3556f86ecd817b477a132df8d837a8b11568debd49e -size 2880106 +oid sha256:dfd1f55af3964c73b423efe64c7400c02ea3c5f289bf347b019350fe3165bcf3 +size 2880044 diff --git a/scripts/testv/stv1MASA1TC48c.wav b/scripts/testv/stv1MASA1TC48c.wav index 60c2de7967..263f109000 100644 --- a/scripts/testv/stv1MASA1TC48c.wav +++ b/scripts/testv/stv1MASA1TC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e9d4810b9aeee2f374c77ab3a0377c478e49e52d9e81b9ec2a01ddd0e8a0f8d4 -size 288106 +oid sha256:2409df48bf501463db0e468aeeee11e5aa866f0adf91ef714a7c6fc506235aa1 +size 288044 diff --git a/scripts/testv/stv1MASA1TC48n.wav b/scripts/testv/stv1MASA1TC48n.wav index 541ded9f6d..1b0012d886 100644 --- a/scripts/testv/stv1MASA1TC48n.wav +++ b/scripts/testv/stv1MASA1TC48n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c0a85059ba982f249e77391188a0d030acf6853fe326ab5ade480239ce80f07f -size 1927786 +oid sha256:81065ed959b13b8c2a4bb1a05ef14095f523912bc3007fdd172cce87a8398046 +size 1927724 diff --git a/scripts/testv/stv1MASA2TC48c.wav b/scripts/testv/stv1MASA2TC48c.wav index aefec77efe..982e69fb20 100644 --- a/scripts/testv/stv1MASA2TC48c.wav +++ b/scripts/testv/stv1MASA2TC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ab7437cdf41e56338c93f5e593118a112a48bae5138be2cdd301eff5da59bb06 -size 1152106 +oid sha256:1bd8440cbf857f9376d053f780572213964c32a267f325948f3a3a02805dc998 +size 1152044 diff --git a/scripts/testv/stv1MASA2TC48n.wav b/scripts/testv/stv1MASA2TC48n.wav index d5e9d955b2..f25eb24353 100644 --- a/scripts/testv/stv1MASA2TC48n.wav +++ b/scripts/testv/stv1MASA2TC48n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8f745778ed4fa70a704f530049022827696fc4e0dd3389a4076a8658ed514926 +oid sha256:97f1a7a43012ce166b929df59bd756f5d96433ea00ce0a1005380368c01619a0 size 3855404 diff --git a/scripts/testv/stv2ISM48s.wav b/scripts/testv/stv2ISM48s.wav index a945db6b00..02de53114d 100644 --- a/scripts/testv/stv2ISM48s.wav +++ b/scripts/testv/stv2ISM48s.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:777052eddbd7cb2ddcf4539a064368efcb6c5155e08ce42fa7a508d98dd5f8c5 -size 5760106 +oid sha256:e042a1a219fcd4f8a82d1d200071139b76c749d97a7b627774431ba961486b2c +size 5760044 diff --git a/scripts/testv/stv2MASA1TC48c.wav b/scripts/testv/stv2MASA1TC48c.wav index 43096765fd..afe705b0b1 100644 --- a/scripts/testv/stv2MASA1TC48c.wav +++ b/scripts/testv/stv2MASA1TC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ccf03f372e4836c9d5ef71d75cf92a00642a13f77464e7c0fcf5f46c961a7f8d -size 576106 +oid sha256:0d500a55bcc63dda1fd93329bcef272a21eb49731ceb0a60e546ef02e07cdd9b +size 576044 diff --git a/scripts/testv/stv2MASA2TC48c.wav b/scripts/testv/stv2MASA2TC48c.wav index 0f72267ea0..e159c4f9ae 100644 --- a/scripts/testv/stv2MASA2TC48c.wav +++ b/scripts/testv/stv2MASA2TC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a5a0379965053087ef1ce4775c85384e8c06aaa8161f12888f5e5c06d8612c1f -size 576106 +oid sha256:60a713ed1b97cf94b16849806951ef83d8f41c8ee455b267ec0a292c695cbbc1 +size 576044 diff --git a/scripts/testv/stv2OA32c.wav b/scripts/testv/stv2OA32c.wav index 071c4866e0..86d288de72 100644 --- a/scripts/testv/stv2OA32c.wav +++ b/scripts/testv/stv2OA32c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d608b108d8e38750d78f1691ed92cac2e92f48a86a4488a3dab9a893cfa6ecf2 -size 11520436 +oid sha256:1824c3afe43861b2ed1e4ff94591932f34bb1885d96796e282d3839906e50aed +size 11520350 diff --git a/scripts/testv/stv2OA48c.wav b/scripts/testv/stv2OA48c.wav index 6ba780a84a..24bb1f0872 100644 --- a/scripts/testv/stv2OA48c.wav +++ b/scripts/testv/stv2OA48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ef0935e08a571a9e88f2257e64c45394633252766a0fb91da582eabf5537a49e -size 17280580 +oid sha256:f573744bd97ad3dcb8e86c39d1770725a34f3c43c37c62c26d670a7f722a880e +size 17280494 diff --git a/scripts/testv/stv32c.wav b/scripts/testv/stv32c.wav index 1267f189de..640532cc12 100644 --- a/scripts/testv/stv32c.wav +++ b/scripts/testv/stv32c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9babeb07a95e9e23068a9c15eea1996a7c366e6000cf8347ce70661631e04ec4 -size 1389700 +oid sha256:00089d67aa513a9f6b2f73526e94d5c32437c6944ec6467072dc27ccaa1f5080 +size 1389542 diff --git a/scripts/testv/stv32n.wav b/scripts/testv/stv32n.wav index 888bbe819c..6a23d99d6e 100644 --- a/scripts/testv/stv32n.wav +++ b/scripts/testv/stv32n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:acbf022e8fbaafb811c14f75f78ec503ef8a1529ce4b04eabbb00c5066635592 -size 1241706 +oid sha256:1a92be333a359a77ec70324815d71282398dede88e59ac19a31f8d18913c0505 +size 1241644 diff --git a/scripts/testv/stv3ISM48s.wav b/scripts/testv/stv3ISM48s.wav index 12f31ee40a..c52500f610 100644 --- a/scripts/testv/stv3ISM48s.wav +++ b/scripts/testv/stv3ISM48s.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ac91a0d2d1584c52799d7fb52eaa2741df9c6927f94f9d5293dd214938f18a50 -size 8640130 +oid sha256:2a29dfd720edab2367f86c394d4abc9f641596d50697539be70cdfe178d2a28d +size 8640044 diff --git a/scripts/testv/stv3OA32c.wav b/scripts/testv/stv3OA32c.wav index 88c473707d..07cda52674 100644 --- a/scripts/testv/stv3OA32c.wav +++ b/scripts/testv/stv3OA32c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7376200d96aafc156cd4f9907e0b727e1e04921bfcbdb580ac8ff58fea4a60d6 -size 20480674 +oid sha256:bdd1fd31b318bef4439a35baf2252c8edabb826198c75d705095b68dfa288fb0 +size 20480588 diff --git a/scripts/testv/stv3OA48c.wav b/scripts/testv/stv3OA48c.wav index 39a208555f..960d9e2019 100644 --- a/scripts/testv/stv3OA48c.wav +++ b/scripts/testv/stv3OA48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3d1bf1ccd3a2d59b8fd768df58c49f9abd2b090664745256eec7d23aa0ea8c70 -size 30720930 +oid sha256:7ce54b1708a76f34eeedc40b01e806cb92d32b0813e8ac23bfceaaa8d25262e6 +size 30720844 diff --git a/scripts/testv/stv48c.wav b/scripts/testv/stv48c.wav index d6df0e8fe2..1be5a1dc3c 100644 --- a/scripts/testv/stv48c.wav +++ b/scripts/testv/stv48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2a2553784fc796c20b2f7d12e159661e9a480438b0ca71bfaf613757c841a1bb -size 1920106 +oid sha256:59f39e02d601b453170cde1e49d50e58b58ff5154ba54c75fc5d79f4964d1e48 +size 1920044 diff --git a/scripts/testv/stv48n.wav b/scripts/testv/stv48n.wav index 040040fadc..2d79cee520 100644 --- a/scripts/testv/stv48n.wav +++ b/scripts/testv/stv48n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:621ec6a05e4e5064bd2f5699129e81335ac64f257e3dee293b0245ac1adcdb6b -size 1862506 +oid sha256:3c774e6fe4e22274ef72552901c4b4870d56d825fa67e8e3e59a30cc0a44dbfa +size 1862444 diff --git a/scripts/testv/stv4ISM48n.wav b/scripts/testv/stv4ISM48n.wav index 5294260a0f..0ca6e5f3f5 100644 --- a/scripts/testv/stv4ISM48n.wav +++ b/scripts/testv/stv4ISM48n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b48c4030982641afcaa0c61182f35d6648e2bea4a952d9430f710989e4e4646c +oid sha256:74697fcb6241db1bed87121244c09a3499ea4024cdf15d279feafbedbca6123a size 7680044 diff --git a/scripts/testv/stv4ISM48s.wav b/scripts/testv/stv4ISM48s.wav index faffedc961..de034819ea 100644 --- a/scripts/testv/stv4ISM48s.wav +++ b/scripts/testv/stv4ISM48s.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:361001b64a7ff11a22267df08ccd261728b9a455c2c4860f84f99ce2dc6dd485 -size 11520130 +oid sha256:70433aebd892f38df31f12f10e71caaa1e794c64abb7d3e75fe895676e63609e +size 11520044 diff --git a/scripts/testv/stv512MC48c.wav b/scripts/testv/stv512MC48c.wav index a0c66dc86c..e21644a5d9 100644 --- a/scripts/testv/stv512MC48c.wav +++ b/scripts/testv/stv512MC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0f2bcf911eda4dc1069e113d82f2e72b0849db5fb28ebdd619a59971f16fc909 -size 2304130 +oid sha256:3be0c6dccbf26f8755200683bba42553eb36feed297110e289afcec32e0c8459 +size 2304044 diff --git a/scripts/testv/stv514MC48c.wav b/scripts/testv/stv514MC48c.wav index 22d0c6e0ab..113cd6219a 100644 --- a/scripts/testv/stv514MC48c.wav +++ b/scripts/testv/stv514MC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6ca93376cae09017177a1a49e2d7d006f5bf61c4c94b9e466dedee6e03a45efb -size 2880130 +oid sha256:d2097dd80fa69f239689b06a62a44eb592bf2fe699e549347ae4567c1b690170 +size 2880044 diff --git a/scripts/testv/stv51MC48c.wav b/scripts/testv/stv51MC48c.wav index 7c98cc83d3..e5f4bae7d4 100644 --- a/scripts/testv/stv51MC48c.wav +++ b/scripts/testv/stv51MC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:377961aefebcea8dd87e5a63af8c17f6b0db588f328cee9ae6db5be95e23cd05 -size 11520130 +oid sha256:daccececb4336a7f2492185767d108dbc5594a7d6e2841d861f43ef44437a377 +size 11520044 diff --git a/scripts/testv/stv714MC48c.wav b/scripts/testv/stv714MC48c.wav index 53c36268d0..cabcb790b0 100644 --- a/scripts/testv/stv714MC48c.wav +++ b/scripts/testv/stv714MC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6fa104a2015be912ea80d015ddb0a42774edea137bc9427954767efcae5e0b1c -size 3456130 +oid sha256:da62e19b166089efae2f22e68d76b82d3295d15785a4967465a04bc1c75b0462 +size 3456044 diff --git a/scripts/testv/stv71MC48c.wav b/scripts/testv/stv71MC48c.wav index 2a0b012ab0..72b3337e59 100644 --- a/scripts/testv/stv71MC48c.wav +++ b/scripts/testv/stv71MC48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d0ac38ddb16b2ce9cbca27965c5aedaf1af857a6fdce340bc01322794311e92d -size 2304130 +oid sha256:3fb15d0c109c41d5e629b2e15a47be72ca8d209919ac39f79a7947e9cd2e5e02 +size 2304044 diff --git a/scripts/testv/stv8c.wav b/scripts/testv/stv8c.wav index 0ee4ea2b7a..5f3b0ed4d9 100644 --- a/scripts/testv/stv8c.wav +++ b/scripts/testv/stv8c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8659d17c088387b59f3a02e698c5dd32746f541493d68be1883a217f4d1b08cf -size 320108 +oid sha256:722081dcfaaee1c04254b0bde8436c73748a44f6760067907194a1ba24b199d7 +size 320046 diff --git a/scripts/testv/stv8n.wav b/scripts/testv/stv8n.wav index 66e042366e..2b35ec4dba 100644 --- a/scripts/testv/stv8n.wav +++ b/scripts/testv/stv8n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d872103d81dcdf846105cdacdb33fc02cbae02104e2c77ff5ff6d985f409b81f -size 310508 +oid sha256:223e9f5353c49163803abedf97d557436d025f445fe9de4508c9559ca15b330b +size 310446 diff --git a/scripts/testv/stvFOA16c.wav b/scripts/testv/stvFOA16c.wav index 996ada1bcd..cb67e8b371 100644 --- a/scripts/testv/stvFOA16c.wav +++ b/scripts/testv/stvFOA16c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:30a766e574f03b20403b873443b837497a685c0c5ac28c5ac51c95ef226385fa -size 2560202 +oid sha256:6725a5d2647516071033f83f385dc7dfe4ff6719d493b1b682ec0274c1347e93 +size 2560116 diff --git a/scripts/testv/stvFOA32c.wav b/scripts/testv/stvFOA32c.wav index 3a681bfa80..661a97a3dc 100644 --- a/scripts/testv/stvFOA32c.wav +++ b/scripts/testv/stvFOA32c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:47176066fc373347564bc28ff56d8d9d52745ab7dd631ce4e051f81dff6908e5 -size 5120266 +oid sha256:273308e57de4c5f3ef2eeed164b0a9f34ba86ab05ca533ee5ee8a76528c01abe +size 5120180 diff --git a/scripts/testv/stvFOA48c.wav b/scripts/testv/stvFOA48c.wav index ade8e3343d..7ece23b084 100644 --- a/scripts/testv/stvFOA48c.wav +++ b/scripts/testv/stvFOA48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9c5da22f3ab1bd9681fff74a77f8ff543f1565f93a5c573125db8820c267376f -size 7680330 +oid sha256:45a1dd6c4fe6802e98821657337b453d5dab2fe32089c675637b9d23cfe74c8d +size 7680244 diff --git a/scripts/testv/stvST16c.wav b/scripts/testv/stvST16c.wav index e46f2e6f5d..3fb9ec0b3b 100644 --- a/scripts/testv/stvST16c.wav +++ b/scripts/testv/stvST16c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:350c8b0d4c11d2e994158be287c07fda1eef6fd6f92aaf769a7f8529c88f16d0 -size 1280110 +oid sha256:11a2f5887fe2407df03128634188d8aef6d3f76b52db14a1f834dbb98b7dd52e +size 1280048 diff --git a/scripts/testv/stvST16n.wav b/scripts/testv/stvST16n.wav index 63afe4f14b..74c80dca93 100644 --- a/scripts/testv/stvST16n.wav +++ b/scripts/testv/stvST16n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:40d28848ee6fc8442738662e5cda78473fb099314aab49440afcfd68286d280d -size 1241710 +oid sha256:60a8cfa5abf4e052840fea0054fec5331465149747fd7bc7eadab18b62d864f1 +size 1241648 diff --git a/scripts/testv/stvST32c.wav b/scripts/testv/stvST32c.wav index 876c0e558b..68a4a1fa33 100644 --- a/scripts/testv/stvST32c.wav +++ b/scripts/testv/stvST32c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:12737393e0bbcdb7b6d9d6dbef79984feac3ff5313daa97a6a8793d3e26099ba -size 2560106 +oid sha256:1182294e7c3ba44e854219698e6a3c209e24345ab2e5e4296fce38029324f374 +size 2560044 diff --git a/scripts/testv/stvST32n.wav b/scripts/testv/stvST32n.wav index 6d77c6892d..7da590907d 100644 --- a/scripts/testv/stvST32n.wav +++ b/scripts/testv/stvST32n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3642b2bce81ea794457655886f56bca58fb0b1431ed7ac52f1a27f8388c75eb4 -size 2483306 +oid sha256:a6edbfd26681fa42f377891761ad79f97029a3380bc644e47bff1803c7904ff9 +size 2483244 diff --git a/scripts/testv/stvST48c.wav b/scripts/testv/stvST48c.wav index 250770d61f..df554e6521 100644 --- a/scripts/testv/stvST48c.wav +++ b/scripts/testv/stvST48c.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cc028e71c94b43068dcc2c7557277ad1989ee20e7a6d8dd6fd30d70d384d56b3 -size 3840106 +oid sha256:40929eb3eb266ed78c16daa2a9c987745fe8e005a577f2dd81264ffda845c118 +size 3840044 diff --git a/scripts/testv/stvST48n.wav b/scripts/testv/stvST48n.wav index 8dd24e4ca0..cb2d8c4fc3 100644 --- a/scripts/testv/stvST48n.wav +++ b/scripts/testv/stvST48n.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ac4262d08b5e45e8ce8da4456740d1e7224aa25b0e3e3088381cb91436cec31f -size 3724906 +oid sha256:6074a3a3b88c7868f62c9bcf7df56e4a8fd25ffed059886846220efc4fbc0992 +size 3724844 diff --git a/scripts/trajectories/azi+2-ele+2-every-100-frames-Euler.csv b/scripts/trajectories/azi_plus_2-ele_plus_2-every-100-frames-Euler.csv similarity index 100% rename from scripts/trajectories/azi+2-ele+2-every-100-frames-Euler.csv rename to scripts/trajectories/azi_plus_2-ele_plus_2-every-100-frames-Euler.csv diff --git a/scripts/trajectories/azi+2-ele+2-every-100-frames.csv b/scripts/trajectories/azi_plus_2-ele_plus_2-every-100-frames.csv similarity index 100% rename from scripts/trajectories/azi+2-ele+2-every-100-frames.csv rename to scripts/trajectories/azi_plus_2-ele_plus_2-every-100-frames.csv diff --git a/scripts/trajectories/azi_plus_2-ele_plus_2-every-25-rows.csv b/scripts/trajectories/azi_plus_2-ele_plus_2-every-25-rows.csv new file mode 100644 index 0000000000..4d8eb8d47b --- /dev/null +++ b/scripts/trajectories/azi_plus_2-ele_plus_2-every-25-rows.csv @@ -0,0 +1,3000 @@ + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.653281, -0.270598, 0.270598, 0.653281 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.634602, -0.292582, 0.282543, 0.657150 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.615562, -0.314856, 0.293608, 0.660109 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.596200, -0.337381, 0.303779, 0.662147 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.576556, -0.360116, 0.313044, 0.663252 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.556670, -0.383022, 0.321394, 0.663414 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.536584, -0.406058, 0.328819, 0.662626 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.516337, -0.429181, 0.335313, 0.660881 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.495972, -0.452352, 0.340872, 0.658176 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.475528, -0.475528, 0.345492, 0.654508 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.455049, -0.498668, 0.349171, 0.649877 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.434575, -0.521730, 0.351911, 0.644283 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.414147, -0.544673, 0.353715, 0.637730 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.393807, -0.567455, 0.354585, 0.630223 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.373595, -0.590035, 0.354529, 0.621767 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.353553, -0.612372, 0.353553, 0.612372 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.333721, -0.634427, 0.351668, 0.602048 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.314138, -0.656158, 0.348885, 0.590807 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.294843, -0.677527, 0.345217, 0.578662 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.275876, -0.698494, 0.340678, 0.565629 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.257274, -0.719022, 0.335286, 0.551725 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.239074, -0.739074, 0.329057, 0.536969 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.221313, -0.758612, 0.322012, 0.521380 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.204025, -0.777602, 0.314172, 0.504981 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.187247, -0.796008, 0.305559, 0.487794 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.171010, -0.813798, 0.296198, 0.469846 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.155348, -0.830938, 0.286115, 0.451162 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.140291, -0.847398, 0.275336, 0.431771 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.125869, -0.863147, 0.263890, 0.411700 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.112112, -0.878156, 0.251807, 0.390980 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.099046, -0.892399, 0.239118, 0.369644 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.086697, -0.905849, 0.225854, 0.347723 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.075090, -0.918482, 0.212048, 0.325251 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.064248, -0.930274, 0.197736, 0.302264 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.054193, -0.941204, 0.182951, 0.278797 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.044943, -0.951251, 0.167731, 0.254887 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.036519, -0.960398, 0.152112, 0.230571 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.028936, -0.968628, 0.136132, 0.205888 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.022209, -0.975926, 0.119829, 0.180877 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.016352, -0.982278, 0.103242, 0.155578 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.011376, -0.987672, 0.086410, 0.130030 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.007292, -0.992099, 0.069374, 0.104274 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.004106, -0.995551, 0.052175, 0.078352 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.001826, -0.998021, 0.034852, 0.052304 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000457, -0.999505, 0.017446, 0.026173 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000000, -1.000000, 0.000000, 0.000000 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.000457, -0.999505, -0.017446, -0.026173 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.001826, -0.998021, -0.034852, -0.052304 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.004106, -0.995551, -0.052175, -0.078352 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.007292, -0.992099, -0.069374, -0.104274 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.011376, -0.987672, -0.086410, -0.130030 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.016352, -0.982278, -0.103242, -0.155578 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.022209, -0.975926, -0.119829, -0.180877 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.028936, -0.968628, -0.136132, -0.205888 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.036519, -0.960398, -0.152112, -0.230571 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.044943, -0.951251, -0.167731, -0.254887 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.054193, -0.941204, -0.182951, -0.278797 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.064248, -0.930274, -0.197736, -0.302264 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.075090, -0.918482, -0.212048, -0.325251 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.086697, -0.905849, -0.225854, -0.347723 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.099046, -0.892399, -0.239118, -0.369644 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.112112, -0.878156, -0.251807, -0.390980 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.125869, -0.863147, -0.263890, -0.411700 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.140291, -0.847398, -0.275336, -0.431771 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.155348, -0.830938, -0.286115, -0.451162 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.171010, -0.813798, -0.296198, -0.469846 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.187247, -0.796008, -0.305559, -0.487794 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.204025, -0.777602, -0.314172, -0.504981 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.221313, -0.758612, -0.322012, -0.521380 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.239074, -0.739074, -0.329057, -0.536969 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.257274, -0.719022, -0.335286, -0.551725 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.275876, -0.698494, -0.340678, -0.565629 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.294843, -0.677527, -0.345217, -0.578662 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.314138, -0.656158, -0.348885, -0.590807 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.333721, -0.634427, -0.351668, -0.602048 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.353553, -0.612372, -0.353553, -0.612372 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.373595, -0.590035, -0.354529, -0.621767 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.393807, -0.567455, -0.354585, -0.630223 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.414147, -0.544673, -0.353715, -0.637730 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.434575, -0.521730, -0.351911, -0.644283 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.455049, -0.498668, -0.349171, -0.649877 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.475528, -0.475528, -0.345492, -0.654508 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.495972, -0.452352, -0.340872, -0.658176 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.516337, -0.429181, -0.335313, -0.660881 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.536584, -0.406058, -0.328819, -0.662626 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.556670, -0.383022, -0.321394, -0.663414 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.576556, -0.360116, -0.313044, -0.663252 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.596200, -0.337381, -0.303779, -0.662147 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.615562, -0.314856, -0.293608, -0.660109 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.634602, -0.292582, -0.282543, -0.657150 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.653281, -0.270598, -0.270598, -0.653281 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.671562, -0.248943, -0.257788, -0.648519 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.689404, -0.227656, -0.244131, -0.642880 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.706773, -0.206773, -0.229644, -0.636381 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.723630, -0.186331, -0.214349, -0.629042 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.739942, -0.166366, -0.198267, -0.620885 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.755673, -0.146912, -0.181421, -0.611932 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.770791, -0.128003, -0.163837, -0.602208 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.785262, -0.109672, -0.145540, -0.591738 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.799057, -0.091950, -0.126558, -0.580549 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.812144, -0.074867, -0.106921, -0.568669 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.824496, -0.058452, -0.086658, -0.556130 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.836085, -0.042732, -0.065801, -0.542960 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.846886, -0.027734, -0.044383, -0.529193 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.856874, -0.013482, -0.022438, -0.514862 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.866025, -0.000000, -0.000000, -0.500000 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.874320, 0.012691, 0.022895, -0.484643 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.881738, 0.024570, 0.046210, -0.468828 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.888260, 0.035620, 0.069908, -0.452591 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.893870, 0.045822, 0.093950, -0.435970 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.898554, 0.055163, 0.118297, -0.419003 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.902298, 0.063628, 0.142910, -0.401729 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.905091, 0.071205, 0.167749, -0.384188 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.906923, 0.077885, 0.192772, -0.366421 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907786, 0.083659, 0.217940, -0.348466 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.907673, 0.088521, 0.243210, -0.330366 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.906582, 0.092466, 0.268542, -0.312161 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.904508, 0.095492, 0.293893, -0.293893 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.901453, 0.097596, 0.319221, -0.275602 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 + 0.897415, 0.098780, 0.344485, -0.257330 diff --git a/scripts/trajectories/const000-Vector3.csv b/scripts/trajectories/const000-Vector3.csv new file mode 100644 index 0000000000..f47ae12e5d --- /dev/null +++ b/scripts/trajectories/const000-Vector3.csv @@ -0,0 +1,4 @@ +0.0, 0.0, 0.0, 1.0, 0.0, 0.0 +0.0, 0.0, 0.0, 1.0, 0.0, 0.0 +0.0, 0.0, 0.0, 1.0, 0.0, 0.0 +0.0, 0.0, 0.0, 1.0, 0.0, 0.0 diff --git a/scripts/trajectories/full-circle-4s-Vector3.csv b/scripts/trajectories/full-circle-4s-Vector3.csv new file mode 100644 index 0000000000..38a3505239 --- /dev/null +++ b/scripts/trajectories/full-circle-4s-Vector3.csv @@ -0,0 +1,200 @@ +0.0000,0.0000,0.0000,0.9995,-0.0314,0.0000 +0.0000,0.0000,0.0000,0.9980,-0.0628,0.0000 +0.0000,0.0000,0.0000,0.9956,-0.0941,0.0000 +0.0000,0.0000,0.0000,0.9921,-0.1253,0.0000 +0.0000,0.0000,0.0000,0.9877,-0.1564,0.0000 +0.0000,0.0000,0.0000,0.9823,-0.1874,0.0000 +0.0000,0.0000,0.0000,0.9759,-0.2181,0.0000 +0.0000,0.0000,0.0000,0.9686,-0.2487,0.0000 +0.0000,0.0000,0.0000,0.9603,-0.2790,0.0000 +0.0000,0.0000,0.0000,0.9511,-0.3090,0.0000 +0.0000,0.0000,0.0000,0.9409,-0.3387,0.0000 +0.0000,0.0000,0.0000,0.9298,-0.3681,0.0000 +0.0000,0.0000,0.0000,0.9178,-0.3971,0.0000 +0.0000,0.0000,0.0000,0.9048,-0.4258,0.0000 +0.0000,0.0000,0.0000,0.8910,-0.4540,0.0000 +0.0000,0.0000,0.0000,0.8763,-0.4818,0.0000 +0.0000,0.0000,0.0000,0.8607,-0.5090,0.0000 +0.0000,0.0000,0.0000,0.8443,-0.5358,0.0000 +0.0000,0.0000,0.0000,0.8271,-0.5621,0.0000 +0.0000,0.0000,0.0000,0.8090,-0.5878,0.0000 +0.0000,0.0000,0.0000,0.7902,-0.6129,0.0000 +0.0000,0.0000,0.0000,0.7705,-0.6374,0.0000 +0.0000,0.0000,0.0000,0.7501,-0.6613,0.0000 +0.0000,0.0000,0.0000,0.7290,-0.6845,0.0000 +0.0000,0.0000,0.0000,0.7071,-0.7071,0.0000 +0.0000,0.0000,0.0000,0.6845,-0.7290,0.0000 +0.0000,0.0000,0.0000,0.6613,-0.7501,0.0000 +0.0000,0.0000,0.0000,0.6374,-0.7705,0.0000 +0.0000,0.0000,0.0000,0.6129,-0.7902,0.0000 +0.0000,0.0000,0.0000,0.5878,-0.8090,0.0000 +0.0000,0.0000,0.0000,0.5621,-0.8271,0.0000 +0.0000,0.0000,0.0000,0.5358,-0.8443,0.0000 +0.0000,0.0000,0.0000,0.5090,-0.8607,0.0000 +0.0000,0.0000,0.0000,0.4818,-0.8763,0.0000 +0.0000,0.0000,0.0000,0.4540,-0.8910,0.0000 +0.0000,0.0000,0.0000,0.4258,-0.9048,0.0000 +0.0000,0.0000,0.0000,0.3971,-0.9178,0.0000 +0.0000,0.0000,0.0000,0.3681,-0.9298,0.0000 +0.0000,0.0000,0.0000,0.3387,-0.9409,0.0000 +0.0000,0.0000,0.0000,0.3090,-0.9511,0.0000 +0.0000,0.0000,0.0000,0.2790,-0.9603,0.0000 +0.0000,0.0000,0.0000,0.2487,-0.9686,0.0000 +0.0000,0.0000,0.0000,0.2181,-0.9759,0.0000 +0.0000,0.0000,0.0000,0.1874,-0.9823,0.0000 +0.0000,0.0000,0.0000,0.1564,-0.9877,0.0000 +0.0000,0.0000,0.0000,0.1253,-0.9921,0.0000 +0.0000,0.0000,0.0000,0.0941,-0.9956,0.0000 +0.0000,0.0000,0.0000,0.0628,-0.9980,0.0000 +0.0000,0.0000,0.0000,0.0314,-0.9995,0.0000 +0.0000,0.0000,0.0000,-0.0000,-1.0000,0.0000 +0.0000,0.0000,0.0000,-0.0314,-0.9995,0.0000 +0.0000,0.0000,0.0000,-0.0628,-0.9980,0.0000 +0.0000,0.0000,0.0000,-0.0941,-0.9956,0.0000 +0.0000,0.0000,0.0000,-0.1253,-0.9921,0.0000 +0.0000,0.0000,0.0000,-0.1564,-0.9877,0.0000 +0.0000,0.0000,0.0000,-0.1874,-0.9823,0.0000 +0.0000,0.0000,0.0000,-0.2181,-0.9759,0.0000 +0.0000,0.0000,0.0000,-0.2487,-0.9686,0.0000 +0.0000,0.0000,0.0000,-0.2790,-0.9603,0.0000 +0.0000,0.0000,0.0000,-0.3090,-0.9511,0.0000 +0.0000,0.0000,0.0000,-0.3387,-0.9409,0.0000 +0.0000,0.0000,0.0000,-0.3681,-0.9298,0.0000 +0.0000,0.0000,0.0000,-0.3971,-0.9178,0.0000 +0.0000,0.0000,0.0000,-0.4258,-0.9048,0.0000 +0.0000,0.0000,0.0000,-0.4540,-0.8910,0.0000 +0.0000,0.0000,0.0000,-0.4818,-0.8763,0.0000 +0.0000,0.0000,0.0000,-0.5090,-0.8607,0.0000 +0.0000,0.0000,0.0000,-0.5358,-0.8443,0.0000 +0.0000,0.0000,0.0000,-0.5621,-0.8271,0.0000 +0.0000,0.0000,0.0000,-0.5878,-0.8090,0.0000 +0.0000,0.0000,0.0000,-0.6129,-0.7902,0.0000 +0.0000,0.0000,0.0000,-0.6374,-0.7705,0.0000 +0.0000,0.0000,0.0000,-0.6613,-0.7501,0.0000 +0.0000,0.0000,0.0000,-0.6845,-0.7290,0.0000 +0.0000,0.0000,0.0000,-0.7071,-0.7071,0.0000 +0.0000,0.0000,0.0000,-0.7290,-0.6845,0.0000 +0.0000,0.0000,0.0000,-0.7501,-0.6613,0.0000 +0.0000,0.0000,0.0000,-0.7705,-0.6374,0.0000 +0.0000,0.0000,0.0000,-0.7902,-0.6129,0.0000 +0.0000,0.0000,0.0000,-0.8090,-0.5878,0.0000 +0.0000,0.0000,0.0000,-0.8271,-0.5621,0.0000 +0.0000,0.0000,0.0000,-0.8443,-0.5358,0.0000 +0.0000,0.0000,0.0000,-0.8607,-0.5090,0.0000 +0.0000,0.0000,0.0000,-0.8763,-0.4818,0.0000 +0.0000,0.0000,0.0000,-0.8910,-0.4540,0.0000 +0.0000,0.0000,0.0000,-0.9048,-0.4258,0.0000 +0.0000,0.0000,0.0000,-0.9178,-0.3971,0.0000 +0.0000,0.0000,0.0000,-0.9298,-0.3681,0.0000 +0.0000,0.0000,0.0000,-0.9409,-0.3387,0.0000 +0.0000,0.0000,0.0000,-0.9511,-0.3090,0.0000 +0.0000,0.0000,0.0000,-0.9603,-0.2790,0.0000 +0.0000,0.0000,0.0000,-0.9686,-0.2487,0.0000 +0.0000,0.0000,0.0000,-0.9759,-0.2181,0.0000 +0.0000,0.0000,0.0000,-0.9823,-0.1874,0.0000 +0.0000,0.0000,0.0000,-0.9877,-0.1564,0.0000 +0.0000,0.0000,0.0000,-0.9921,-0.1253,0.0000 +0.0000,0.0000,0.0000,-0.9956,-0.0941,0.0000 +0.0000,0.0000,0.0000,-0.9980,-0.0628,0.0000 +0.0000,0.0000,0.0000,-0.9995,-0.0314,0.0000 +0.0000,0.0000,0.0000,-1.0000,0.0000,0.0000 +0.0000,0.0000,0.0000,-0.9995,0.0314,0.0000 +0.0000,0.0000,0.0000,-0.9980,0.0628,0.0000 +0.0000,0.0000,0.0000,-0.9956,0.0941,0.0000 +0.0000,0.0000,0.0000,-0.9921,0.1253,0.0000 +0.0000,0.0000,0.0000,-0.9877,0.1564,0.0000 +0.0000,0.0000,0.0000,-0.9823,0.1874,0.0000 +0.0000,0.0000,0.0000,-0.9759,0.2181,0.0000 +0.0000,0.0000,0.0000,-0.9686,0.2487,0.0000 +0.0000,0.0000,0.0000,-0.9603,0.2790,0.0000 +0.0000,0.0000,0.0000,-0.9511,0.3090,0.0000 +0.0000,0.0000,0.0000,-0.9409,0.3387,0.0000 +0.0000,0.0000,0.0000,-0.9298,0.3681,0.0000 +0.0000,0.0000,0.0000,-0.9178,0.3971,0.0000 +0.0000,0.0000,0.0000,-0.9048,0.4258,0.0000 +0.0000,0.0000,0.0000,-0.8910,0.4540,0.0000 +0.0000,0.0000,0.0000,-0.8763,0.4818,0.0000 +0.0000,0.0000,0.0000,-0.8607,0.5090,0.0000 +0.0000,0.0000,0.0000,-0.8443,0.5358,0.0000 +0.0000,0.0000,0.0000,-0.8271,0.5621,0.0000 +0.0000,0.0000,0.0000,-0.8090,0.5878,0.0000 +0.0000,0.0000,0.0000,-0.7902,0.6129,0.0000 +0.0000,0.0000,0.0000,-0.7705,0.6374,0.0000 +0.0000,0.0000,0.0000,-0.7501,0.6613,0.0000 +0.0000,0.0000,0.0000,-0.7290,0.6845,0.0000 +0.0000,0.0000,0.0000,-0.7071,0.7071,0.0000 +0.0000,0.0000,0.0000,-0.6845,0.7290,0.0000 +0.0000,0.0000,0.0000,-0.6613,0.7501,0.0000 +0.0000,0.0000,0.0000,-0.6374,0.7705,0.0000 +0.0000,0.0000,0.0000,-0.6129,0.7902,0.0000 +0.0000,0.0000,0.0000,-0.5878,0.8090,0.0000 +0.0000,0.0000,0.0000,-0.5621,0.8271,0.0000 +0.0000,0.0000,0.0000,-0.5358,0.8443,0.0000 +0.0000,0.0000,0.0000,-0.5090,0.8607,0.0000 +0.0000,0.0000,0.0000,-0.4818,0.8763,0.0000 +0.0000,0.0000,0.0000,-0.4540,0.8910,0.0000 +0.0000,0.0000,0.0000,-0.4258,0.9048,0.0000 +0.0000,0.0000,0.0000,-0.3971,0.9178,0.0000 +0.0000,0.0000,0.0000,-0.3681,0.9298,0.0000 +0.0000,0.0000,0.0000,-0.3387,0.9409,0.0000 +0.0000,0.0000,0.0000,-0.3090,0.9511,0.0000 +0.0000,0.0000,0.0000,-0.2790,0.9603,0.0000 +0.0000,0.0000,0.0000,-0.2487,0.9686,0.0000 +0.0000,0.0000,0.0000,-0.2181,0.9759,0.0000 +0.0000,0.0000,0.0000,-0.1874,0.9823,0.0000 +0.0000,0.0000,0.0000,-0.1564,0.9877,0.0000 +0.0000,0.0000,0.0000,-0.1253,0.9921,0.0000 +0.0000,0.0000,0.0000,-0.0941,0.9956,0.0000 +0.0000,0.0000,0.0000,-0.0628,0.9980,0.0000 +0.0000,0.0000,0.0000,-0.0314,0.9995,0.0000 +0.0000,0.0000,0.0000,0.0000,1.0000,0.0000 +0.0000,0.0000,0.0000,0.0314,0.9995,0.0000 +0.0000,0.0000,0.0000,0.0628,0.9980,0.0000 +0.0000,0.0000,0.0000,0.0941,0.9956,0.0000 +0.0000,0.0000,0.0000,0.1253,0.9921,0.0000 +0.0000,0.0000,0.0000,0.1564,0.9877,0.0000 +0.0000,0.0000,0.0000,0.1874,0.9823,0.0000 +0.0000,0.0000,0.0000,0.2181,0.9759,0.0000 +0.0000,0.0000,0.0000,0.2487,0.9686,0.0000 +0.0000,0.0000,0.0000,0.2790,0.9603,0.0000 +0.0000,0.0000,0.0000,0.3090,0.9511,0.0000 +0.0000,0.0000,0.0000,0.3387,0.9409,0.0000 +0.0000,0.0000,0.0000,0.3681,0.9298,0.0000 +0.0000,0.0000,0.0000,0.3971,0.9178,0.0000 +0.0000,0.0000,0.0000,0.4258,0.9048,0.0000 +0.0000,0.0000,0.0000,0.4540,0.8910,0.0000 +0.0000,0.0000,0.0000,0.4818,0.8763,0.0000 +0.0000,0.0000,0.0000,0.5090,0.8607,0.0000 +0.0000,0.0000,0.0000,0.5358,0.8443,0.0000 +0.0000,0.0000,0.0000,0.5621,0.8271,0.0000 +0.0000,0.0000,0.0000,0.5878,0.8090,0.0000 +0.0000,0.0000,0.0000,0.6129,0.7902,0.0000 +0.0000,0.0000,0.0000,0.6374,0.7705,0.0000 +0.0000,0.0000,0.0000,0.6613,0.7501,0.0000 +0.0000,0.0000,0.0000,0.6845,0.7290,0.0000 +0.0000,0.0000,0.0000,0.7071,0.7071,0.0000 +0.0000,0.0000,0.0000,0.7290,0.6845,0.0000 +0.0000,0.0000,0.0000,0.7501,0.6613,0.0000 +0.0000,0.0000,0.0000,0.7705,0.6374,0.0000 +0.0000,0.0000,0.0000,0.7902,0.6129,0.0000 +0.0000,0.0000,0.0000,0.8090,0.5878,0.0000 +0.0000,0.0000,0.0000,0.8271,0.5621,0.0000 +0.0000,0.0000,0.0000,0.8443,0.5358,0.0000 +0.0000,0.0000,0.0000,0.8607,0.5090,0.0000 +0.0000,0.0000,0.0000,0.8763,0.4818,0.0000 +0.0000,0.0000,0.0000,0.8910,0.4540,0.0000 +0.0000,0.0000,0.0000,0.9048,0.4258,0.0000 +0.0000,0.0000,0.0000,0.9178,0.3971,0.0000 +0.0000,0.0000,0.0000,0.9298,0.3681,0.0000 +0.0000,0.0000,0.0000,0.9409,0.3387,0.0000 +0.0000,0.0000,0.0000,0.9511,0.3090,0.0000 +0.0000,0.0000,0.0000,0.9603,0.2790,0.0000 +0.0000,0.0000,0.0000,0.9686,0.2487,0.0000 +0.0000,0.0000,0.0000,0.9759,0.2181,0.0000 +0.0000,0.0000,0.0000,0.9823,0.1874,0.0000 +0.0000,0.0000,0.0000,0.9877,0.1564,0.0000 +0.0000,0.0000,0.0000,0.9921,0.1253,0.0000 +0.0000,0.0000,0.0000,0.9956,0.0941,0.0000 +0.0000,0.0000,0.0000,0.9980,0.0628,0.0000 +0.0000,0.0000,0.0000,0.9995,0.0314,0.0000 +0.0000,0.0000,0.0000,1.0000,-0.0000,0.0000 diff --git a/scripts/trajectories/full-circle-4s-ccw-Vector3.csv b/scripts/trajectories/full-circle-4s-ccw-Vector3.csv new file mode 100644 index 0000000000..37b2904ea4 --- /dev/null +++ b/scripts/trajectories/full-circle-4s-ccw-Vector3.csv @@ -0,0 +1,200 @@ +0.0000,0.0000,0.0000,0.9995,0.0314,0.0000 +0.0000,0.0000,0.0000,0.9980,0.0628,0.0000 +0.0000,0.0000,0.0000,0.9956,0.0941,0.0000 +0.0000,0.0000,0.0000,0.9921,0.1253,0.0000 +0.0000,0.0000,0.0000,0.9877,0.1564,0.0000 +0.0000,0.0000,0.0000,0.9823,0.1874,0.0000 +0.0000,0.0000,0.0000,0.9759,0.2181,0.0000 +0.0000,0.0000,0.0000,0.9686,0.2487,0.0000 +0.0000,0.0000,0.0000,0.9603,0.2790,0.0000 +0.0000,0.0000,0.0000,0.9511,0.3090,0.0000 +0.0000,0.0000,0.0000,0.9409,0.3387,0.0000 +0.0000,0.0000,0.0000,0.9298,0.3681,0.0000 +0.0000,0.0000,0.0000,0.9178,0.3971,0.0000 +0.0000,0.0000,0.0000,0.9048,0.4258,0.0000 +0.0000,0.0000,0.0000,0.8910,0.4540,0.0000 +0.0000,0.0000,0.0000,0.8763,0.4818,0.0000 +0.0000,0.0000,0.0000,0.8607,0.5090,0.0000 +0.0000,0.0000,0.0000,0.8443,0.5358,0.0000 +0.0000,0.0000,0.0000,0.8271,0.5621,0.0000 +0.0000,0.0000,0.0000,0.8090,0.5878,0.0000 +0.0000,0.0000,0.0000,0.7902,0.6129,0.0000 +0.0000,0.0000,0.0000,0.7705,0.6374,0.0000 +0.0000,0.0000,0.0000,0.7501,0.6613,0.0000 +0.0000,0.0000,0.0000,0.7290,0.6845,0.0000 +0.0000,0.0000,0.0000,0.7071,0.7071,0.0000 +0.0000,0.0000,0.0000,0.6845,0.7290,0.0000 +0.0000,0.0000,0.0000,0.6613,0.7501,0.0000 +0.0000,0.0000,0.0000,0.6374,0.7705,0.0000 +0.0000,0.0000,0.0000,0.6129,0.7902,0.0000 +0.0000,0.0000,0.0000,0.5878,0.8090,0.0000 +0.0000,0.0000,0.0000,0.5621,0.8271,0.0000 +0.0000,0.0000,0.0000,0.5358,0.8443,0.0000 +0.0000,0.0000,0.0000,0.5090,0.8607,0.0000 +0.0000,0.0000,0.0000,0.4818,0.8763,0.0000 +0.0000,0.0000,0.0000,0.4540,0.8910,0.0000 +0.0000,0.0000,0.0000,0.4258,0.9048,0.0000 +0.0000,0.0000,0.0000,0.3971,0.9178,0.0000 +0.0000,0.0000,0.0000,0.3681,0.9298,0.0000 +0.0000,0.0000,0.0000,0.3387,0.9409,0.0000 +0.0000,0.0000,0.0000,0.3090,0.9511,0.0000 +0.0000,0.0000,0.0000,0.2790,0.9603,0.0000 +0.0000,0.0000,0.0000,0.2487,0.9686,0.0000 +0.0000,0.0000,0.0000,0.2181,0.9759,0.0000 +0.0000,0.0000,0.0000,0.1874,0.9823,0.0000 +0.0000,0.0000,0.0000,0.1564,0.9877,0.0000 +0.0000,0.0000,0.0000,0.1253,0.9921,0.0000 +0.0000,0.0000,0.0000,0.0941,0.9956,0.0000 +0.0000,0.0000,0.0000,0.0628,0.9980,0.0000 +0.0000,0.0000,0.0000,0.0314,0.9995,0.0000 +0.0000,0.0000,0.0000,-0.0000,1.0000,0.0000 +0.0000,0.0000,0.0000,-0.0314,0.9995,0.0000 +0.0000,0.0000,0.0000,-0.0628,0.9980,0.0000 +0.0000,0.0000,0.0000,-0.0941,0.9956,0.0000 +0.0000,0.0000,0.0000,-0.1253,0.9921,0.0000 +0.0000,0.0000,0.0000,-0.1564,0.9877,0.0000 +0.0000,0.0000,0.0000,-0.1874,0.9823,0.0000 +0.0000,0.0000,0.0000,-0.2181,0.9759,0.0000 +0.0000,0.0000,0.0000,-0.2487,0.9686,0.0000 +0.0000,0.0000,0.0000,-0.2790,0.9603,0.0000 +0.0000,0.0000,0.0000,-0.3090,0.9511,0.0000 +0.0000,0.0000,0.0000,-0.3387,0.9409,0.0000 +0.0000,0.0000,0.0000,-0.3681,0.9298,0.0000 +0.0000,0.0000,0.0000,-0.3971,0.9178,0.0000 +0.0000,0.0000,0.0000,-0.4258,0.9048,0.0000 +0.0000,0.0000,0.0000,-0.4540,0.8910,0.0000 +0.0000,0.0000,0.0000,-0.4818,0.8763,0.0000 +0.0000,0.0000,0.0000,-0.5090,0.8607,0.0000 +0.0000,0.0000,0.0000,-0.5358,0.8443,0.0000 +0.0000,0.0000,0.0000,-0.5621,0.8271,0.0000 +0.0000,0.0000,0.0000,-0.5878,0.8090,0.0000 +0.0000,0.0000,0.0000,-0.6129,0.7902,0.0000 +0.0000,0.0000,0.0000,-0.6374,0.7705,0.0000 +0.0000,0.0000,0.0000,-0.6613,0.7501,0.0000 +0.0000,0.0000,0.0000,-0.6845,0.7290,0.0000 +0.0000,0.0000,0.0000,-0.7071,0.7071,0.0000 +0.0000,0.0000,0.0000,-0.7290,0.6845,0.0000 +0.0000,0.0000,0.0000,-0.7501,0.6613,0.0000 +0.0000,0.0000,0.0000,-0.7705,0.6374,0.0000 +0.0000,0.0000,0.0000,-0.7902,0.6129,0.0000 +0.0000,0.0000,0.0000,-0.8090,0.5878,0.0000 +0.0000,0.0000,0.0000,-0.8271,0.5621,0.0000 +0.0000,0.0000,0.0000,-0.8443,0.5358,0.0000 +0.0000,0.0000,0.0000,-0.8607,0.5090,0.0000 +0.0000,0.0000,0.0000,-0.8763,0.4818,0.0000 +0.0000,0.0000,0.0000,-0.8910,0.4540,0.0000 +0.0000,0.0000,0.0000,-0.9048,0.4258,0.0000 +0.0000,0.0000,0.0000,-0.9178,0.3971,0.0000 +0.0000,0.0000,0.0000,-0.9298,0.3681,0.0000 +0.0000,0.0000,0.0000,-0.9409,0.3387,0.0000 +0.0000,0.0000,0.0000,-0.9511,0.3090,0.0000 +0.0000,0.0000,0.0000,-0.9603,0.2790,0.0000 +0.0000,0.0000,0.0000,-0.9686,0.2487,0.0000 +0.0000,0.0000,0.0000,-0.9759,0.2181,0.0000 +0.0000,0.0000,0.0000,-0.9823,0.1874,0.0000 +0.0000,0.0000,0.0000,-0.9877,0.1564,0.0000 +0.0000,0.0000,0.0000,-0.9921,0.1253,0.0000 +0.0000,0.0000,0.0000,-0.9956,0.0941,0.0000 +0.0000,0.0000,0.0000,-0.9980,0.0628,0.0000 +0.0000,0.0000,0.0000,-0.9995,0.0314,0.0000 +0.0000,0.0000,0.0000,-1.0000,-0.0000,0.0000 +0.0000,0.0000,0.0000,-0.9995,-0.0314,0.0000 +0.0000,0.0000,0.0000,-0.9980,-0.0628,0.0000 +0.0000,0.0000,0.0000,-0.9956,-0.0941,0.0000 +0.0000,0.0000,0.0000,-0.9921,-0.1253,0.0000 +0.0000,0.0000,0.0000,-0.9877,-0.1564,0.0000 +0.0000,0.0000,0.0000,-0.9823,-0.1874,0.0000 +0.0000,0.0000,0.0000,-0.9759,-0.2181,0.0000 +0.0000,0.0000,0.0000,-0.9686,-0.2487,0.0000 +0.0000,0.0000,0.0000,-0.9603,-0.2790,0.0000 +0.0000,0.0000,0.0000,-0.9511,-0.3090,0.0000 +0.0000,0.0000,0.0000,-0.9409,-0.3387,0.0000 +0.0000,0.0000,0.0000,-0.9298,-0.3681,0.0000 +0.0000,0.0000,0.0000,-0.9178,-0.3971,0.0000 +0.0000,0.0000,0.0000,-0.9048,-0.4258,0.0000 +0.0000,0.0000,0.0000,-0.8910,-0.4540,0.0000 +0.0000,0.0000,0.0000,-0.8763,-0.4818,0.0000 +0.0000,0.0000,0.0000,-0.8607,-0.5090,0.0000 +0.0000,0.0000,0.0000,-0.8443,-0.5358,0.0000 +0.0000,0.0000,0.0000,-0.8271,-0.5621,0.0000 +0.0000,0.0000,0.0000,-0.8090,-0.5878,0.0000 +0.0000,0.0000,0.0000,-0.7902,-0.6129,0.0000 +0.0000,0.0000,0.0000,-0.7705,-0.6374,0.0000 +0.0000,0.0000,0.0000,-0.7501,-0.6613,0.0000 +0.0000,0.0000,0.0000,-0.7290,-0.6845,0.0000 +0.0000,0.0000,0.0000,-0.7071,-0.7071,0.0000 +0.0000,0.0000,0.0000,-0.6845,-0.7290,0.0000 +0.0000,0.0000,0.0000,-0.6613,-0.7501,0.0000 +0.0000,0.0000,0.0000,-0.6374,-0.7705,0.0000 +0.0000,0.0000,0.0000,-0.6129,-0.7902,0.0000 +0.0000,0.0000,0.0000,-0.5878,-0.8090,0.0000 +0.0000,0.0000,0.0000,-0.5621,-0.8271,0.0000 +0.0000,0.0000,0.0000,-0.5358,-0.8443,0.0000 +0.0000,0.0000,0.0000,-0.5090,-0.8607,0.0000 +0.0000,0.0000,0.0000,-0.4818,-0.8763,0.0000 +0.0000,0.0000,0.0000,-0.4540,-0.8910,0.0000 +0.0000,0.0000,0.0000,-0.4258,-0.9048,0.0000 +0.0000,0.0000,0.0000,-0.3971,-0.9178,0.0000 +0.0000,0.0000,0.0000,-0.3681,-0.9298,0.0000 +0.0000,0.0000,0.0000,-0.3387,-0.9409,0.0000 +0.0000,0.0000,0.0000,-0.3090,-0.9511,0.0000 +0.0000,0.0000,0.0000,-0.2790,-0.9603,0.0000 +0.0000,0.0000,0.0000,-0.2487,-0.9686,0.0000 +0.0000,0.0000,0.0000,-0.2181,-0.9759,0.0000 +0.0000,0.0000,0.0000,-0.1874,-0.9823,0.0000 +0.0000,0.0000,0.0000,-0.1564,-0.9877,0.0000 +0.0000,0.0000,0.0000,-0.1253,-0.9921,0.0000 +0.0000,0.0000,0.0000,-0.0941,-0.9956,0.0000 +0.0000,0.0000,0.0000,-0.0628,-0.9980,0.0000 +0.0000,0.0000,0.0000,-0.0314,-0.9995,0.0000 +0.0000,0.0000,0.0000,0.0000,-1.0000,0.0000 +0.0000,0.0000,0.0000,0.0314,-0.9995,0.0000 +0.0000,0.0000,0.0000,0.0628,-0.9980,0.0000 +0.0000,0.0000,0.0000,0.0941,-0.9956,0.0000 +0.0000,0.0000,0.0000,0.1253,-0.9921,0.0000 +0.0000,0.0000,0.0000,0.1564,-0.9877,0.0000 +0.0000,0.0000,0.0000,0.1874,-0.9823,0.0000 +0.0000,0.0000,0.0000,0.2181,-0.9759,0.0000 +0.0000,0.0000,0.0000,0.2487,-0.9686,0.0000 +0.0000,0.0000,0.0000,0.2790,-0.9603,0.0000 +0.0000,0.0000,0.0000,0.3090,-0.9511,0.0000 +0.0000,0.0000,0.0000,0.3387,-0.9409,0.0000 +0.0000,0.0000,0.0000,0.3681,-0.9298,0.0000 +0.0000,0.0000,0.0000,0.3971,-0.9178,0.0000 +0.0000,0.0000,0.0000,0.4258,-0.9048,0.0000 +0.0000,0.0000,0.0000,0.4540,-0.8910,0.0000 +0.0000,0.0000,0.0000,0.4818,-0.8763,0.0000 +0.0000,0.0000,0.0000,0.5090,-0.8607,0.0000 +0.0000,0.0000,0.0000,0.5358,-0.8443,0.0000 +0.0000,0.0000,0.0000,0.5621,-0.8271,0.0000 +0.0000,0.0000,0.0000,0.5878,-0.8090,0.0000 +0.0000,0.0000,0.0000,0.6129,-0.7902,0.0000 +0.0000,0.0000,0.0000,0.6374,-0.7705,0.0000 +0.0000,0.0000,0.0000,0.6613,-0.7501,0.0000 +0.0000,0.0000,0.0000,0.6845,-0.7290,0.0000 +0.0000,0.0000,0.0000,0.7071,-0.7071,0.0000 +0.0000,0.0000,0.0000,0.7290,-0.6845,0.0000 +0.0000,0.0000,0.0000,0.7501,-0.6613,0.0000 +0.0000,0.0000,0.0000,0.7705,-0.6374,0.0000 +0.0000,0.0000,0.0000,0.7902,-0.6129,0.0000 +0.0000,0.0000,0.0000,0.8090,-0.5878,0.0000 +0.0000,0.0000,0.0000,0.8271,-0.5621,0.0000 +0.0000,0.0000,0.0000,0.8443,-0.5358,0.0000 +0.0000,0.0000,0.0000,0.8607,-0.5090,0.0000 +0.0000,0.0000,0.0000,0.8763,-0.4818,0.0000 +0.0000,0.0000,0.0000,0.8910,-0.4540,0.0000 +0.0000,0.0000,0.0000,0.9048,-0.4258,0.0000 +0.0000,0.0000,0.0000,0.9178,-0.3971,0.0000 +0.0000,0.0000,0.0000,0.9298,-0.3681,0.0000 +0.0000,0.0000,0.0000,0.9409,-0.3387,0.0000 +0.0000,0.0000,0.0000,0.9511,-0.3090,0.0000 +0.0000,0.0000,0.0000,0.9603,-0.2790,0.0000 +0.0000,0.0000,0.0000,0.9686,-0.2487,0.0000 +0.0000,0.0000,0.0000,0.9759,-0.2181,0.0000 +0.0000,0.0000,0.0000,0.9823,-0.1874,0.0000 +0.0000,0.0000,0.0000,0.9877,-0.1564,0.0000 +0.0000,0.0000,0.0000,0.9921,-0.1253,0.0000 +0.0000,0.0000,0.0000,0.9956,-0.0941,0.0000 +0.0000,0.0000,0.0000,0.9980,-0.0628,0.0000 +0.0000,0.0000,0.0000,0.9995,-0.0314,0.0000 +0.0000,0.0000,0.0000,1.0000,0.0000,0.0000 diff --git a/scripts/trajectories/full-circle-4s-ccw.csv b/scripts/trajectories/full-circle-4s-ccw.csv new file mode 100644 index 0000000000..13eeae28e1 --- /dev/null +++ b/scripts/trajectories/full-circle-4s-ccw.csv @@ -0,0 +1,800 @@ +0.9999,0.0000,0.0000,0.0157 +0.9999,0.0000,0.0000,0.0157 +0.9999,0.0000,0.0000,0.0157 +0.9999,0.0000,0.0000,0.0157 +0.9995,0.0000,0.0000,0.0314 +0.9995,0.0000,0.0000,0.0314 +0.9995,0.0000,0.0000,0.0314 +0.9995,0.0000,0.0000,0.0314 +0.9989,0.0000,0.0000,0.0471 +0.9989,0.0000,0.0000,0.0471 +0.9989,0.0000,0.0000,0.0471 +0.9989,0.0000,0.0000,0.0471 +0.9980,0.0000,0.0000,0.0628 +0.9980,0.0000,0.0000,0.0628 +0.9980,0.0000,0.0000,0.0628 +0.9980,0.0000,0.0000,0.0628 +0.9969,0.0000,0.0000,0.0785 +0.9969,0.0000,0.0000,0.0785 +0.9969,0.0000,0.0000,0.0785 +0.9969,0.0000,0.0000,0.0785 +0.9956,0.0000,0.0000,0.0941 +0.9956,0.0000,0.0000,0.0941 +0.9956,0.0000,0.0000,0.0941 +0.9956,0.0000,0.0000,0.0941 +0.9940,0.0000,0.0000,0.1097 +0.9940,0.0000,0.0000,0.1097 +0.9940,0.0000,0.0000,0.1097 +0.9940,0.0000,0.0000,0.1097 +0.9921,0.0000,0.0000,0.1253 +0.9921,0.0000,0.0000,0.1253 +0.9921,0.0000,0.0000,0.1253 +0.9921,0.0000,0.0000,0.1253 +0.9900,0.0000,0.0000,0.1409 +0.9900,0.0000,0.0000,0.1409 +0.9900,0.0000,0.0000,0.1409 +0.9900,0.0000,0.0000,0.1409 +0.9877,0.0000,0.0000,0.1564 +0.9877,0.0000,0.0000,0.1564 +0.9877,0.0000,0.0000,0.1564 +0.9877,0.0000,0.0000,0.1564 +0.9851,0.0000,0.0000,0.1719 +0.9851,0.0000,0.0000,0.1719 +0.9851,0.0000,0.0000,0.1719 +0.9851,0.0000,0.0000,0.1719 +0.9823,0.0000,0.0000,0.1874 +0.9823,0.0000,0.0000,0.1874 +0.9823,0.0000,0.0000,0.1874 +0.9823,0.0000,0.0000,0.1874 +0.9792,0.0000,0.0000,0.2028 +0.9792,0.0000,0.0000,0.2028 +0.9792,0.0000,0.0000,0.2028 +0.9792,0.0000,0.0000,0.2028 +0.9759,0.0000,0.0000,0.2181 +0.9759,0.0000,0.0000,0.2181 +0.9759,0.0000,0.0000,0.2181 +0.9759,0.0000,0.0000,0.2181 +0.9724,0.0000,0.0000,0.2334 +0.9724,0.0000,0.0000,0.2334 +0.9724,0.0000,0.0000,0.2334 +0.9724,0.0000,0.0000,0.2334 +0.9686,0.0000,0.0000,0.2487 +0.9686,0.0000,0.0000,0.2487 +0.9686,0.0000,0.0000,0.2487 +0.9686,0.0000,0.0000,0.2487 +0.9646,0.0000,0.0000,0.2639 +0.9646,0.0000,0.0000,0.2639 +0.9646,0.0000,0.0000,0.2639 +0.9646,0.0000,0.0000,0.2639 +0.9603,0.0000,0.0000,0.2790 +0.9603,0.0000,0.0000,0.2790 +0.9603,0.0000,0.0000,0.2790 +0.9603,0.0000,0.0000,0.2790 +0.9558,0.0000,0.0000,0.2940 +0.9558,0.0000,0.0000,0.2940 +0.9558,0.0000,0.0000,0.2940 +0.9558,0.0000,0.0000,0.2940 +0.9511,0.0000,0.0000,0.3090 +0.9511,0.0000,0.0000,0.3090 +0.9511,0.0000,0.0000,0.3090 +0.9511,0.0000,0.0000,0.3090 +0.9461,0.0000,0.0000,0.3239 +0.9461,0.0000,0.0000,0.3239 +0.9461,0.0000,0.0000,0.3239 +0.9461,0.0000,0.0000,0.3239 +0.9409,0.0000,0.0000,0.3387 +0.9409,0.0000,0.0000,0.3387 +0.9409,0.0000,0.0000,0.3387 +0.9409,0.0000,0.0000,0.3387 +0.9354,0.0000,0.0000,0.3535 +0.9354,0.0000,0.0000,0.3535 +0.9354,0.0000,0.0000,0.3535 +0.9354,0.0000,0.0000,0.3535 +0.9298,0.0000,0.0000,0.3681 +0.9298,0.0000,0.0000,0.3681 +0.9298,0.0000,0.0000,0.3681 +0.9298,0.0000,0.0000,0.3681 +0.9239,0.0000,0.0000,0.3827 +0.9239,0.0000,0.0000,0.3827 +0.9239,0.0000,0.0000,0.3827 +0.9239,0.0000,0.0000,0.3827 +0.9178,0.0000,0.0000,0.3971 +0.9178,0.0000,0.0000,0.3971 +0.9178,0.0000,0.0000,0.3971 +0.9178,0.0000,0.0000,0.3971 +0.9114,0.0000,0.0000,0.4115 +0.9114,0.0000,0.0000,0.4115 +0.9114,0.0000,0.0000,0.4115 +0.9114,0.0000,0.0000,0.4115 +0.9048,0.0000,0.0000,0.4258 +0.9048,0.0000,0.0000,0.4258 +0.9048,0.0000,0.0000,0.4258 +0.9048,0.0000,0.0000,0.4258 +0.8980,0.0000,0.0000,0.4399 +0.8980,0.0000,0.0000,0.4399 +0.8980,0.0000,0.0000,0.4399 +0.8980,0.0000,0.0000,0.4399 +0.8910,0.0000,0.0000,0.4540 +0.8910,0.0000,0.0000,0.4540 +0.8910,0.0000,0.0000,0.4540 +0.8910,0.0000,0.0000,0.4540 +0.8838,0.0000,0.0000,0.4679 +0.8838,0.0000,0.0000,0.4679 +0.8838,0.0000,0.0000,0.4679 +0.8838,0.0000,0.0000,0.4679 +0.8763,0.0000,0.0000,0.4818 +0.8763,0.0000,0.0000,0.4818 +0.8763,0.0000,0.0000,0.4818 +0.8763,0.0000,0.0000,0.4818 +0.8686,0.0000,0.0000,0.4955 +0.8686,0.0000,0.0000,0.4955 +0.8686,0.0000,0.0000,0.4955 +0.8686,0.0000,0.0000,0.4955 +0.8607,0.0000,0.0000,0.5090 +0.8607,0.0000,0.0000,0.5090 +0.8607,0.0000,0.0000,0.5090 +0.8607,0.0000,0.0000,0.5090 +0.8526,0.0000,0.0000,0.5225 +0.8526,0.0000,0.0000,0.5225 +0.8526,0.0000,0.0000,0.5225 +0.8526,0.0000,0.0000,0.5225 +0.8443,0.0000,0.0000,0.5358 +0.8443,0.0000,0.0000,0.5358 +0.8443,0.0000,0.0000,0.5358 +0.8443,0.0000,0.0000,0.5358 +0.8358,0.0000,0.0000,0.5490 +0.8358,0.0000,0.0000,0.5490 +0.8358,0.0000,0.0000,0.5490 +0.8358,0.0000,0.0000,0.5490 +0.8271,0.0000,0.0000,0.5621 +0.8271,0.0000,0.0000,0.5621 +0.8271,0.0000,0.0000,0.5621 +0.8271,0.0000,0.0000,0.5621 +0.8181,0.0000,0.0000,0.5750 +0.8181,0.0000,0.0000,0.5750 +0.8181,0.0000,0.0000,0.5750 +0.8181,0.0000,0.0000,0.5750 +0.8090,0.0000,0.0000,0.5878 +0.8090,0.0000,0.0000,0.5878 +0.8090,0.0000,0.0000,0.5878 +0.8090,0.0000,0.0000,0.5878 +0.7997,0.0000,0.0000,0.6004 +0.7997,0.0000,0.0000,0.6004 +0.7997,0.0000,0.0000,0.6004 +0.7997,0.0000,0.0000,0.6004 +0.7902,0.0000,0.0000,0.6129 +0.7902,0.0000,0.0000,0.6129 +0.7902,0.0000,0.0000,0.6129 +0.7902,0.0000,0.0000,0.6129 +0.7804,0.0000,0.0000,0.6252 +0.7804,0.0000,0.0000,0.6252 +0.7804,0.0000,0.0000,0.6252 +0.7804,0.0000,0.0000,0.6252 +0.7705,0.0000,0.0000,0.6374 +0.7705,0.0000,0.0000,0.6374 +0.7705,0.0000,0.0000,0.6374 +0.7705,0.0000,0.0000,0.6374 +0.7604,0.0000,0.0000,0.6494 +0.7604,0.0000,0.0000,0.6494 +0.7604,0.0000,0.0000,0.6494 +0.7604,0.0000,0.0000,0.6494 +0.7501,0.0000,0.0000,0.6613 +0.7501,0.0000,0.0000,0.6613 +0.7501,0.0000,0.0000,0.6613 +0.7501,0.0000,0.0000,0.6613 +0.7396,0.0000,0.0000,0.6730 +0.7396,0.0000,0.0000,0.6730 +0.7396,0.0000,0.0000,0.6730 +0.7396,0.0000,0.0000,0.6730 +0.7290,0.0000,0.0000,0.6845 +0.7290,0.0000,0.0000,0.6845 +0.7290,0.0000,0.0000,0.6845 +0.7290,0.0000,0.0000,0.6845 +0.7181,0.0000,0.0000,0.6959 +0.7181,0.0000,0.0000,0.6959 +0.7181,0.0000,0.0000,0.6959 +0.7181,0.0000,0.0000,0.6959 +0.7071,0.0000,0.0000,0.7071 +0.7071,0.0000,0.0000,0.7071 +0.7071,0.0000,0.0000,0.7071 +0.7071,0.0000,0.0000,0.7071 +0.6959,0.0000,0.0000,0.7181 +0.6959,0.0000,0.0000,0.7181 +0.6959,0.0000,0.0000,0.7181 +0.6959,0.0000,0.0000,0.7181 +0.6845,0.0000,0.0000,0.7290 +0.6845,0.0000,0.0000,0.7290 +0.6845,0.0000,0.0000,0.7290 +0.6845,0.0000,0.0000,0.7290 +0.6730,0.0000,0.0000,0.7396 +0.6730,0.0000,0.0000,0.7396 +0.6730,0.0000,0.0000,0.7396 +0.6730,0.0000,0.0000,0.7396 +0.6613,0.0000,0.0000,0.7501 +0.6613,0.0000,0.0000,0.7501 +0.6613,0.0000,0.0000,0.7501 +0.6613,0.0000,0.0000,0.7501 +0.6494,0.0000,0.0000,0.7604 +0.6494,0.0000,0.0000,0.7604 +0.6494,0.0000,0.0000,0.7604 +0.6494,0.0000,0.0000,0.7604 +0.6374,0.0000,0.0000,0.7705 +0.6374,0.0000,0.0000,0.7705 +0.6374,0.0000,0.0000,0.7705 +0.6374,0.0000,0.0000,0.7705 +0.6252,0.0000,0.0000,0.7804 +0.6252,0.0000,0.0000,0.7804 +0.6252,0.0000,0.0000,0.7804 +0.6252,0.0000,0.0000,0.7804 +0.6129,0.0000,0.0000,0.7902 +0.6129,0.0000,0.0000,0.7902 +0.6129,0.0000,0.0000,0.7902 +0.6129,0.0000,0.0000,0.7902 +0.6004,0.0000,0.0000,0.7997 +0.6004,0.0000,0.0000,0.7997 +0.6004,0.0000,0.0000,0.7997 +0.6004,0.0000,0.0000,0.7997 +0.5878,0.0000,0.0000,0.8090 +0.5878,0.0000,0.0000,0.8090 +0.5878,0.0000,0.0000,0.8090 +0.5878,0.0000,0.0000,0.8090 +0.5750,0.0000,0.0000,0.8181 +0.5750,0.0000,0.0000,0.8181 +0.5750,0.0000,0.0000,0.8181 +0.5750,0.0000,0.0000,0.8181 +0.5621,0.0000,0.0000,0.8271 +0.5621,0.0000,0.0000,0.8271 +0.5621,0.0000,0.0000,0.8271 +0.5621,0.0000,0.0000,0.8271 +0.5490,0.0000,0.0000,0.8358 +0.5490,0.0000,0.0000,0.8358 +0.5490,0.0000,0.0000,0.8358 +0.5490,0.0000,0.0000,0.8358 +0.5358,0.0000,0.0000,0.8443 +0.5358,0.0000,0.0000,0.8443 +0.5358,0.0000,0.0000,0.8443 +0.5358,0.0000,0.0000,0.8443 +0.5225,0.0000,0.0000,0.8526 +0.5225,0.0000,0.0000,0.8526 +0.5225,0.0000,0.0000,0.8526 +0.5225,0.0000,0.0000,0.8526 +0.5090,0.0000,0.0000,0.8607 +0.5090,0.0000,0.0000,0.8607 +0.5090,0.0000,0.0000,0.8607 +0.5090,0.0000,0.0000,0.8607 +0.4955,0.0000,0.0000,0.8686 +0.4955,0.0000,0.0000,0.8686 +0.4955,0.0000,0.0000,0.8686 +0.4955,0.0000,0.0000,0.8686 +0.4818,0.0000,0.0000,0.8763 +0.4818,0.0000,0.0000,0.8763 +0.4818,0.0000,0.0000,0.8763 +0.4818,0.0000,0.0000,0.8763 +0.4679,0.0000,0.0000,0.8838 +0.4679,0.0000,0.0000,0.8838 +0.4679,0.0000,0.0000,0.8838 +0.4679,0.0000,0.0000,0.8838 +0.4540,0.0000,0.0000,0.8910 +0.4540,0.0000,0.0000,0.8910 +0.4540,0.0000,0.0000,0.8910 +0.4540,0.0000,0.0000,0.8910 +0.4399,0.0000,0.0000,0.8980 +0.4399,0.0000,0.0000,0.8980 +0.4399,0.0000,0.0000,0.8980 +0.4399,0.0000,0.0000,0.8980 +0.4258,0.0000,0.0000,0.9048 +0.4258,0.0000,0.0000,0.9048 +0.4258,0.0000,0.0000,0.9048 +0.4258,0.0000,0.0000,0.9048 +0.4115,0.0000,0.0000,0.9114 +0.4115,0.0000,0.0000,0.9114 +0.4115,0.0000,0.0000,0.9114 +0.4115,0.0000,0.0000,0.9114 +0.3971,0.0000,0.0000,0.9178 +0.3971,0.0000,0.0000,0.9178 +0.3971,0.0000,0.0000,0.9178 +0.3971,0.0000,0.0000,0.9178 +0.3827,0.0000,0.0000,0.9239 +0.3827,0.0000,0.0000,0.9239 +0.3827,0.0000,0.0000,0.9239 +0.3827,0.0000,0.0000,0.9239 +0.3681,0.0000,0.0000,0.9298 +0.3681,0.0000,0.0000,0.9298 +0.3681,0.0000,0.0000,0.9298 +0.3681,0.0000,0.0000,0.9298 +0.3535,0.0000,0.0000,0.9354 +0.3535,0.0000,0.0000,0.9354 +0.3535,0.0000,0.0000,0.9354 +0.3535,0.0000,0.0000,0.9354 +0.3387,0.0000,0.0000,0.9409 +0.3387,0.0000,0.0000,0.9409 +0.3387,0.0000,0.0000,0.9409 +0.3387,0.0000,0.0000,0.9409 +0.3239,0.0000,0.0000,0.9461 +0.3239,0.0000,0.0000,0.9461 +0.3239,0.0000,0.0000,0.9461 +0.3239,0.0000,0.0000,0.9461 +0.3090,0.0000,0.0000,0.9511 +0.3090,0.0000,0.0000,0.9511 +0.3090,0.0000,0.0000,0.9511 +0.3090,0.0000,0.0000,0.9511 +0.2940,0.0000,0.0000,0.9558 +0.2940,0.0000,0.0000,0.9558 +0.2940,0.0000,0.0000,0.9558 +0.2940,0.0000,0.0000,0.9558 +0.2790,0.0000,0.0000,0.9603 +0.2790,0.0000,0.0000,0.9603 +0.2790,0.0000,0.0000,0.9603 +0.2790,0.0000,0.0000,0.9603 +0.2639,0.0000,0.0000,0.9646 +0.2639,0.0000,0.0000,0.9646 +0.2639,0.0000,0.0000,0.9646 +0.2639,0.0000,0.0000,0.9646 +0.2487,0.0000,0.0000,0.9686 +0.2487,0.0000,0.0000,0.9686 +0.2487,0.0000,0.0000,0.9686 +0.2487,0.0000,0.0000,0.9686 +0.2334,0.0000,0.0000,0.9724 +0.2334,0.0000,0.0000,0.9724 +0.2334,0.0000,0.0000,0.9724 +0.2334,0.0000,0.0000,0.9724 +0.2181,0.0000,0.0000,0.9759 +0.2181,0.0000,0.0000,0.9759 +0.2181,0.0000,0.0000,0.9759 +0.2181,0.0000,0.0000,0.9759 +0.2028,0.0000,0.0000,0.9792 +0.2028,0.0000,0.0000,0.9792 +0.2028,0.0000,0.0000,0.9792 +0.2028,0.0000,0.0000,0.9792 +0.1874,0.0000,0.0000,0.9823 +0.1874,0.0000,0.0000,0.9823 +0.1874,0.0000,0.0000,0.9823 +0.1874,0.0000,0.0000,0.9823 +0.1719,0.0000,0.0000,0.9851 +0.1719,0.0000,0.0000,0.9851 +0.1719,0.0000,0.0000,0.9851 +0.1719,0.0000,0.0000,0.9851 +0.1564,0.0000,0.0000,0.9877 +0.1564,0.0000,0.0000,0.9877 +0.1564,0.0000,0.0000,0.9877 +0.1564,0.0000,0.0000,0.9877 +0.1409,0.0000,0.0000,0.9900 +0.1409,0.0000,0.0000,0.9900 +0.1409,0.0000,0.0000,0.9900 +0.1409,0.0000,0.0000,0.9900 +0.1253,0.0000,0.0000,0.9921 +0.1253,0.0000,0.0000,0.9921 +0.1253,0.0000,0.0000,0.9921 +0.1253,0.0000,0.0000,0.9921 +0.1097,0.0000,0.0000,0.9940 +0.1097,0.0000,0.0000,0.9940 +0.1097,0.0000,0.0000,0.9940 +0.1097,0.0000,0.0000,0.9940 +0.0941,0.0000,0.0000,0.9956 +0.0941,0.0000,0.0000,0.9956 +0.0941,0.0000,0.0000,0.9956 +0.0941,0.0000,0.0000,0.9956 +0.0785,0.0000,0.0000,0.9969 +0.0785,0.0000,0.0000,0.9969 +0.0785,0.0000,0.0000,0.9969 +0.0785,0.0000,0.0000,0.9969 +0.0628,0.0000,0.0000,0.9980 +0.0628,0.0000,0.0000,0.9980 +0.0628,0.0000,0.0000,0.9980 +0.0628,0.0000,0.0000,0.9980 +0.0471,0.0000,0.0000,0.9989 +0.0471,0.0000,0.0000,0.9989 +0.0471,0.0000,0.0000,0.9989 +0.0471,0.0000,0.0000,0.9989 +0.0314,0.0000,0.0000,0.9995 +0.0314,0.0000,0.0000,0.9995 +0.0314,0.0000,0.0000,0.9995 +0.0314,0.0000,0.0000,0.9995 +0.0157,0.0000,0.0000,0.9999 +0.0157,0.0000,0.0000,0.9999 +0.0157,0.0000,0.0000,0.9999 +0.0157,0.0000,0.0000,0.9999 +-0.0000,0.0000,0.0000,1.0000 +-0.0000,0.0000,0.0000,1.0000 +-0.0000,0.0000,0.0000,1.0000 +-0.0000,0.0000,0.0000,1.0000 +-0.0157,0.0000,0.0000,0.9999 +-0.0157,0.0000,0.0000,0.9999 +-0.0157,0.0000,0.0000,0.9999 +-0.0157,0.0000,0.0000,0.9999 +-0.0314,0.0000,0.0000,0.9995 +-0.0314,0.0000,0.0000,0.9995 +-0.0314,0.0000,0.0000,0.9995 +-0.0314,0.0000,0.0000,0.9995 +-0.0471,0.0000,0.0000,0.9989 +-0.0471,0.0000,0.0000,0.9989 +-0.0471,0.0000,0.0000,0.9989 +-0.0471,0.0000,0.0000,0.9989 +-0.0628,0.0000,0.0000,0.9980 +-0.0628,0.0000,0.0000,0.9980 +-0.0628,0.0000,0.0000,0.9980 +-0.0628,0.0000,0.0000,0.9980 +-0.0785,0.0000,0.0000,0.9969 +-0.0785,0.0000,0.0000,0.9969 +-0.0785,0.0000,0.0000,0.9969 +-0.0785,0.0000,0.0000,0.9969 +-0.0941,0.0000,0.0000,0.9956 +-0.0941,0.0000,0.0000,0.9956 +-0.0941,0.0000,0.0000,0.9956 +-0.0941,0.0000,0.0000,0.9956 +-0.1097,0.0000,0.0000,0.9940 +-0.1097,0.0000,0.0000,0.9940 +-0.1097,0.0000,0.0000,0.9940 +-0.1097,0.0000,0.0000,0.9940 +-0.1253,0.0000,0.0000,0.9921 +-0.1253,0.0000,0.0000,0.9921 +-0.1253,0.0000,0.0000,0.9921 +-0.1253,0.0000,0.0000,0.9921 +-0.1409,0.0000,0.0000,0.9900 +-0.1409,0.0000,0.0000,0.9900 +-0.1409,0.0000,0.0000,0.9900 +-0.1409,0.0000,0.0000,0.9900 +-0.1564,0.0000,0.0000,0.9877 +-0.1564,0.0000,0.0000,0.9877 +-0.1564,0.0000,0.0000,0.9877 +-0.1564,0.0000,0.0000,0.9877 +-0.1719,0.0000,0.0000,0.9851 +-0.1719,0.0000,0.0000,0.9851 +-0.1719,0.0000,0.0000,0.9851 +-0.1719,0.0000,0.0000,0.9851 +-0.1874,0.0000,0.0000,0.9823 +-0.1874,0.0000,0.0000,0.9823 +-0.1874,0.0000,0.0000,0.9823 +-0.1874,0.0000,0.0000,0.9823 +-0.2028,0.0000,0.0000,0.9792 +-0.2028,0.0000,0.0000,0.9792 +-0.2028,0.0000,0.0000,0.9792 +-0.2028,0.0000,0.0000,0.9792 +-0.2181,0.0000,0.0000,0.9759 +-0.2181,0.0000,0.0000,0.9759 +-0.2181,0.0000,0.0000,0.9759 +-0.2181,0.0000,0.0000,0.9759 +-0.2334,0.0000,0.0000,0.9724 +-0.2334,0.0000,0.0000,0.9724 +-0.2334,0.0000,0.0000,0.9724 +-0.2334,0.0000,0.0000,0.9724 +-0.2487,0.0000,0.0000,0.9686 +-0.2487,0.0000,0.0000,0.9686 +-0.2487,0.0000,0.0000,0.9686 +-0.2487,0.0000,0.0000,0.9686 +-0.2639,0.0000,0.0000,0.9646 +-0.2639,0.0000,0.0000,0.9646 +-0.2639,0.0000,0.0000,0.9646 +-0.2639,0.0000,0.0000,0.9646 +-0.2790,0.0000,0.0000,0.9603 +-0.2790,0.0000,0.0000,0.9603 +-0.2790,0.0000,0.0000,0.9603 +-0.2790,0.0000,0.0000,0.9603 +-0.2940,0.0000,0.0000,0.9558 +-0.2940,0.0000,0.0000,0.9558 +-0.2940,0.0000,0.0000,0.9558 +-0.2940,0.0000,0.0000,0.9558 +-0.3090,0.0000,0.0000,0.9511 +-0.3090,0.0000,0.0000,0.9511 +-0.3090,0.0000,0.0000,0.9511 +-0.3090,0.0000,0.0000,0.9511 +-0.3239,0.0000,0.0000,0.9461 +-0.3239,0.0000,0.0000,0.9461 +-0.3239,0.0000,0.0000,0.9461 +-0.3239,0.0000,0.0000,0.9461 +-0.3387,0.0000,0.0000,0.9409 +-0.3387,0.0000,0.0000,0.9409 +-0.3387,0.0000,0.0000,0.9409 +-0.3387,0.0000,0.0000,0.9409 +-0.3535,0.0000,0.0000,0.9354 +-0.3535,0.0000,0.0000,0.9354 +-0.3535,0.0000,0.0000,0.9354 +-0.3535,0.0000,0.0000,0.9354 +-0.3681,0.0000,0.0000,0.9298 +-0.3681,0.0000,0.0000,0.9298 +-0.3681,0.0000,0.0000,0.9298 +-0.3681,0.0000,0.0000,0.9298 +-0.3827,0.0000,0.0000,0.9239 +-0.3827,0.0000,0.0000,0.9239 +-0.3827,0.0000,0.0000,0.9239 +-0.3827,0.0000,0.0000,0.9239 +-0.3971,0.0000,0.0000,0.9178 +-0.3971,0.0000,0.0000,0.9178 +-0.3971,0.0000,0.0000,0.9178 +-0.3971,0.0000,0.0000,0.9178 +-0.4115,0.0000,0.0000,0.9114 +-0.4115,0.0000,0.0000,0.9114 +-0.4115,0.0000,0.0000,0.9114 +-0.4115,0.0000,0.0000,0.9114 +-0.4258,0.0000,0.0000,0.9048 +-0.4258,0.0000,0.0000,0.9048 +-0.4258,0.0000,0.0000,0.9048 +-0.4258,0.0000,0.0000,0.9048 +-0.4399,0.0000,0.0000,0.8980 +-0.4399,0.0000,0.0000,0.8980 +-0.4399,0.0000,0.0000,0.8980 +-0.4399,0.0000,0.0000,0.8980 +-0.4540,0.0000,0.0000,0.8910 +-0.4540,0.0000,0.0000,0.8910 +-0.4540,0.0000,0.0000,0.8910 +-0.4540,0.0000,0.0000,0.8910 +-0.4679,0.0000,0.0000,0.8838 +-0.4679,0.0000,0.0000,0.8838 +-0.4679,0.0000,0.0000,0.8838 +-0.4679,0.0000,0.0000,0.8838 +-0.4818,0.0000,0.0000,0.8763 +-0.4818,0.0000,0.0000,0.8763 +-0.4818,0.0000,0.0000,0.8763 +-0.4818,0.0000,0.0000,0.8763 +-0.4955,0.0000,0.0000,0.8686 +-0.4955,0.0000,0.0000,0.8686 +-0.4955,0.0000,0.0000,0.8686 +-0.4955,0.0000,0.0000,0.8686 +-0.5090,0.0000,0.0000,0.8607 +-0.5090,0.0000,0.0000,0.8607 +-0.5090,0.0000,0.0000,0.8607 +-0.5090,0.0000,0.0000,0.8607 +-0.5225,0.0000,0.0000,0.8526 +-0.5225,0.0000,0.0000,0.8526 +-0.5225,0.0000,0.0000,0.8526 +-0.5225,0.0000,0.0000,0.8526 +-0.5358,0.0000,0.0000,0.8443 +-0.5358,0.0000,0.0000,0.8443 +-0.5358,0.0000,0.0000,0.8443 +-0.5358,0.0000,0.0000,0.8443 +-0.5490,0.0000,0.0000,0.8358 +-0.5490,0.0000,0.0000,0.8358 +-0.5490,0.0000,0.0000,0.8358 +-0.5490,0.0000,0.0000,0.8358 +-0.5621,0.0000,0.0000,0.8271 +-0.5621,0.0000,0.0000,0.8271 +-0.5621,0.0000,0.0000,0.8271 +-0.5621,0.0000,0.0000,0.8271 +-0.5750,0.0000,0.0000,0.8181 +-0.5750,0.0000,0.0000,0.8181 +-0.5750,0.0000,0.0000,0.8181 +-0.5750,0.0000,0.0000,0.8181 +-0.5878,0.0000,0.0000,0.8090 +-0.5878,0.0000,0.0000,0.8090 +-0.5878,0.0000,0.0000,0.8090 +-0.5878,0.0000,0.0000,0.8090 +-0.6004,0.0000,0.0000,0.7997 +-0.6004,0.0000,0.0000,0.7997 +-0.6004,0.0000,0.0000,0.7997 +-0.6004,0.0000,0.0000,0.7997 +-0.6129,0.0000,0.0000,0.7902 +-0.6129,0.0000,0.0000,0.7902 +-0.6129,0.0000,0.0000,0.7902 +-0.6129,0.0000,0.0000,0.7902 +-0.6252,0.0000,0.0000,0.7804 +-0.6252,0.0000,0.0000,0.7804 +-0.6252,0.0000,0.0000,0.7804 +-0.6252,0.0000,0.0000,0.7804 +-0.6374,0.0000,0.0000,0.7705 +-0.6374,0.0000,0.0000,0.7705 +-0.6374,0.0000,0.0000,0.7705 +-0.6374,0.0000,0.0000,0.7705 +-0.6494,0.0000,0.0000,0.7604 +-0.6494,0.0000,0.0000,0.7604 +-0.6494,0.0000,0.0000,0.7604 +-0.6494,0.0000,0.0000,0.7604 +-0.6613,0.0000,0.0000,0.7501 +-0.6613,0.0000,0.0000,0.7501 +-0.6613,0.0000,0.0000,0.7501 +-0.6613,0.0000,0.0000,0.7501 +-0.6730,0.0000,0.0000,0.7396 +-0.6730,0.0000,0.0000,0.7396 +-0.6730,0.0000,0.0000,0.7396 +-0.6730,0.0000,0.0000,0.7396 +-0.6845,0.0000,0.0000,0.7290 +-0.6845,0.0000,0.0000,0.7290 +-0.6845,0.0000,0.0000,0.7290 +-0.6845,0.0000,0.0000,0.7290 +-0.6959,0.0000,0.0000,0.7181 +-0.6959,0.0000,0.0000,0.7181 +-0.6959,0.0000,0.0000,0.7181 +-0.6959,0.0000,0.0000,0.7181 +-0.7071,0.0000,0.0000,0.7071 +-0.7071,0.0000,0.0000,0.7071 +-0.7071,0.0000,0.0000,0.7071 +-0.7071,0.0000,0.0000,0.7071 +-0.7181,0.0000,0.0000,0.6959 +-0.7181,0.0000,0.0000,0.6959 +-0.7181,0.0000,0.0000,0.6959 +-0.7181,0.0000,0.0000,0.6959 +-0.7290,0.0000,0.0000,0.6845 +-0.7290,0.0000,0.0000,0.6845 +-0.7290,0.0000,0.0000,0.6845 +-0.7290,0.0000,0.0000,0.6845 +-0.7396,0.0000,0.0000,0.6730 +-0.7396,0.0000,0.0000,0.6730 +-0.7396,0.0000,0.0000,0.6730 +-0.7396,0.0000,0.0000,0.6730 +-0.7501,0.0000,0.0000,0.6613 +-0.7501,0.0000,0.0000,0.6613 +-0.7501,0.0000,0.0000,0.6613 +-0.7501,0.0000,0.0000,0.6613 +-0.7604,0.0000,0.0000,0.6494 +-0.7604,0.0000,0.0000,0.6494 +-0.7604,0.0000,0.0000,0.6494 +-0.7604,0.0000,0.0000,0.6494 +-0.7705,0.0000,0.0000,0.6374 +-0.7705,0.0000,0.0000,0.6374 +-0.7705,0.0000,0.0000,0.6374 +-0.7705,0.0000,0.0000,0.6374 +-0.7804,0.0000,0.0000,0.6252 +-0.7804,0.0000,0.0000,0.6252 +-0.7804,0.0000,0.0000,0.6252 +-0.7804,0.0000,0.0000,0.6252 +-0.7902,0.0000,0.0000,0.6129 +-0.7902,0.0000,0.0000,0.6129 +-0.7902,0.0000,0.0000,0.6129 +-0.7902,0.0000,0.0000,0.6129 +-0.7997,0.0000,0.0000,0.6004 +-0.7997,0.0000,0.0000,0.6004 +-0.7997,0.0000,0.0000,0.6004 +-0.7997,0.0000,0.0000,0.6004 +-0.8090,0.0000,0.0000,0.5878 +-0.8090,0.0000,0.0000,0.5878 +-0.8090,0.0000,0.0000,0.5878 +-0.8090,0.0000,0.0000,0.5878 +-0.8182,0.0000,0.0000,0.5750 +-0.8182,0.0000,0.0000,0.5750 +-0.8182,0.0000,0.0000,0.5750 +-0.8182,0.0000,0.0000,0.5750 +-0.8271,0.0000,0.0000,0.5621 +-0.8271,0.0000,0.0000,0.5621 +-0.8271,0.0000,0.0000,0.5621 +-0.8271,0.0000,0.0000,0.5621 +-0.8358,0.0000,0.0000,0.5490 +-0.8358,0.0000,0.0000,0.5490 +-0.8358,0.0000,0.0000,0.5490 +-0.8358,0.0000,0.0000,0.5490 +-0.8443,0.0000,0.0000,0.5358 +-0.8443,0.0000,0.0000,0.5358 +-0.8443,0.0000,0.0000,0.5358 +-0.8443,0.0000,0.0000,0.5358 +-0.8526,0.0000,0.0000,0.5225 +-0.8526,0.0000,0.0000,0.5225 +-0.8526,0.0000,0.0000,0.5225 +-0.8526,0.0000,0.0000,0.5225 +-0.8607,0.0000,0.0000,0.5090 +-0.8607,0.0000,0.0000,0.5090 +-0.8607,0.0000,0.0000,0.5090 +-0.8607,0.0000,0.0000,0.5090 +-0.8686,0.0000,0.0000,0.4955 +-0.8686,0.0000,0.0000,0.4955 +-0.8686,0.0000,0.0000,0.4955 +-0.8686,0.0000,0.0000,0.4955 +-0.8763,0.0000,0.0000,0.4818 +-0.8763,0.0000,0.0000,0.4818 +-0.8763,0.0000,0.0000,0.4818 +-0.8763,0.0000,0.0000,0.4818 +-0.8838,0.0000,0.0000,0.4679 +-0.8838,0.0000,0.0000,0.4679 +-0.8838,0.0000,0.0000,0.4679 +-0.8838,0.0000,0.0000,0.4679 +-0.8910,0.0000,0.0000,0.4540 +-0.8910,0.0000,0.0000,0.4540 +-0.8910,0.0000,0.0000,0.4540 +-0.8910,0.0000,0.0000,0.4540 +-0.8980,0.0000,0.0000,0.4399 +-0.8980,0.0000,0.0000,0.4399 +-0.8980,0.0000,0.0000,0.4399 +-0.8980,0.0000,0.0000,0.4399 +-0.9048,0.0000,0.0000,0.4258 +-0.9048,0.0000,0.0000,0.4258 +-0.9048,0.0000,0.0000,0.4258 +-0.9048,0.0000,0.0000,0.4258 +-0.9114,0.0000,0.0000,0.4115 +-0.9114,0.0000,0.0000,0.4115 +-0.9114,0.0000,0.0000,0.4115 +-0.9114,0.0000,0.0000,0.4115 +-0.9178,0.0000,0.0000,0.3971 +-0.9178,0.0000,0.0000,0.3971 +-0.9178,0.0000,0.0000,0.3971 +-0.9178,0.0000,0.0000,0.3971 +-0.9239,0.0000,0.0000,0.3827 +-0.9239,0.0000,0.0000,0.3827 +-0.9239,0.0000,0.0000,0.3827 +-0.9239,0.0000,0.0000,0.3827 +-0.9298,0.0000,0.0000,0.3681 +-0.9298,0.0000,0.0000,0.3681 +-0.9298,0.0000,0.0000,0.3681 +-0.9298,0.0000,0.0000,0.3681 +-0.9354,0.0000,0.0000,0.3535 +-0.9354,0.0000,0.0000,0.3535 +-0.9354,0.0000,0.0000,0.3535 +-0.9354,0.0000,0.0000,0.3535 +-0.9409,0.0000,0.0000,0.3387 +-0.9409,0.0000,0.0000,0.3387 +-0.9409,0.0000,0.0000,0.3387 +-0.9409,0.0000,0.0000,0.3387 +-0.9461,0.0000,0.0000,0.3239 +-0.9461,0.0000,0.0000,0.3239 +-0.9461,0.0000,0.0000,0.3239 +-0.9461,0.0000,0.0000,0.3239 +-0.9511,0.0000,0.0000,0.3090 +-0.9511,0.0000,0.0000,0.3090 +-0.9511,0.0000,0.0000,0.3090 +-0.9511,0.0000,0.0000,0.3090 +-0.9558,0.0000,0.0000,0.2940 +-0.9558,0.0000,0.0000,0.2940 +-0.9558,0.0000,0.0000,0.2940 +-0.9558,0.0000,0.0000,0.2940 +-0.9603,0.0000,0.0000,0.2790 +-0.9603,0.0000,0.0000,0.2790 +-0.9603,0.0000,0.0000,0.2790 +-0.9603,0.0000,0.0000,0.2790 +-0.9646,0.0000,0.0000,0.2639 +-0.9646,0.0000,0.0000,0.2639 +-0.9646,0.0000,0.0000,0.2639 +-0.9646,0.0000,0.0000,0.2639 +-0.9686,0.0000,0.0000,0.2487 +-0.9686,0.0000,0.0000,0.2487 +-0.9686,0.0000,0.0000,0.2487 +-0.9686,0.0000,0.0000,0.2487 +-0.9724,0.0000,0.0000,0.2334 +-0.9724,0.0000,0.0000,0.2334 +-0.9724,0.0000,0.0000,0.2334 +-0.9724,0.0000,0.0000,0.2334 +-0.9759,0.0000,0.0000,0.2181 +-0.9759,0.0000,0.0000,0.2181 +-0.9759,0.0000,0.0000,0.2181 +-0.9759,0.0000,0.0000,0.2181 +-0.9792,0.0000,0.0000,0.2028 +-0.9792,0.0000,0.0000,0.2028 +-0.9792,0.0000,0.0000,0.2028 +-0.9792,0.0000,0.0000,0.2028 +-0.9823,0.0000,0.0000,0.1874 +-0.9823,0.0000,0.0000,0.1874 +-0.9823,0.0000,0.0000,0.1874 +-0.9823,0.0000,0.0000,0.1874 +-0.9851,0.0000,0.0000,0.1719 +-0.9851,0.0000,0.0000,0.1719 +-0.9851,0.0000,0.0000,0.1719 +-0.9851,0.0000,0.0000,0.1719 +-0.9877,0.0000,0.0000,0.1564 +-0.9877,0.0000,0.0000,0.1564 +-0.9877,0.0000,0.0000,0.1564 +-0.9877,0.0000,0.0000,0.1564 +-0.9900,0.0000,0.0000,0.1409 +-0.9900,0.0000,0.0000,0.1409 +-0.9900,0.0000,0.0000,0.1409 +-0.9900,0.0000,0.0000,0.1409 +-0.9921,0.0000,0.0000,0.1253 +-0.9921,0.0000,0.0000,0.1253 +-0.9921,0.0000,0.0000,0.1253 +-0.9921,0.0000,0.0000,0.1253 +-0.9940,0.0000,0.0000,0.1097 +-0.9940,0.0000,0.0000,0.1097 +-0.9940,0.0000,0.0000,0.1097 +-0.9940,0.0000,0.0000,0.1097 +-0.9956,0.0000,0.0000,0.0941 +-0.9956,0.0000,0.0000,0.0941 +-0.9956,0.0000,0.0000,0.0941 +-0.9956,0.0000,0.0000,0.0941 +-0.9969,0.0000,0.0000,0.0785 +-0.9969,0.0000,0.0000,0.0785 +-0.9969,0.0000,0.0000,0.0785 +-0.9969,0.0000,0.0000,0.0785 +-0.9980,0.0000,0.0000,0.0628 +-0.9980,0.0000,0.0000,0.0628 +-0.9980,0.0000,0.0000,0.0628 +-0.9980,0.0000,0.0000,0.0628 +-0.9989,0.0000,0.0000,0.0471 +-0.9989,0.0000,0.0000,0.0471 +-0.9989,0.0000,0.0000,0.0471 +-0.9989,0.0000,0.0000,0.0471 +-0.9995,0.0000,0.0000,0.0314 +-0.9995,0.0000,0.0000,0.0314 +-0.9995,0.0000,0.0000,0.0314 +-0.9995,0.0000,0.0000,0.0314 +-0.9999,0.0000,0.0000,0.0157 +-0.9999,0.0000,0.0000,0.0157 +-0.9999,0.0000,0.0000,0.0157 +-0.9999,0.0000,0.0000,0.0157 +1.0000,0.0000,0.0000,0.0000 +1.0000,0.0000,0.0000,0.0000 +1.0000,0.0000,0.0000,0.0000 +1.0000,0.0000,0.0000,0.0000 diff --git a/scripts/trajectories/full-circle-4s.csv b/scripts/trajectories/full-circle-4s.csv new file mode 100644 index 0000000000..4174a531b7 --- /dev/null +++ b/scripts/trajectories/full-circle-4s.csv @@ -0,0 +1,800 @@ +0.9999,0.0000,0.0000,-0.0157 +0.9999,0.0000,0.0000,-0.0157 +0.9999,0.0000,0.0000,-0.0157 +0.9999,0.0000,0.0000,-0.0157 +0.9995,0.0000,0.0000,-0.0314 +0.9995,0.0000,0.0000,-0.0314 +0.9995,0.0000,0.0000,-0.0314 +0.9995,0.0000,0.0000,-0.0314 +0.9989,0.0000,0.0000,-0.0471 +0.9989,0.0000,0.0000,-0.0471 +0.9989,0.0000,0.0000,-0.0471 +0.9989,0.0000,0.0000,-0.0471 +0.9980,0.0000,0.0000,-0.0628 +0.9980,0.0000,0.0000,-0.0628 +0.9980,0.0000,0.0000,-0.0628 +0.9980,0.0000,0.0000,-0.0628 +0.9969,0.0000,0.0000,-0.0785 +0.9969,0.0000,0.0000,-0.0785 +0.9969,0.0000,0.0000,-0.0785 +0.9969,0.0000,0.0000,-0.0785 +0.9956,0.0000,0.0000,-0.0941 +0.9956,0.0000,0.0000,-0.0941 +0.9956,0.0000,0.0000,-0.0941 +0.9956,0.0000,0.0000,-0.0941 +0.9940,0.0000,0.0000,-0.1097 +0.9940,0.0000,0.0000,-0.1097 +0.9940,0.0000,0.0000,-0.1097 +0.9940,0.0000,0.0000,-0.1097 +0.9921,0.0000,0.0000,-0.1253 +0.9921,0.0000,0.0000,-0.1253 +0.9921,0.0000,0.0000,-0.1253 +0.9921,0.0000,0.0000,-0.1253 +0.9900,0.0000,0.0000,-0.1409 +0.9900,0.0000,0.0000,-0.1409 +0.9900,0.0000,0.0000,-0.1409 +0.9900,0.0000,0.0000,-0.1409 +0.9877,0.0000,0.0000,-0.1564 +0.9877,0.0000,0.0000,-0.1564 +0.9877,0.0000,0.0000,-0.1564 +0.9877,0.0000,0.0000,-0.1564 +0.9851,0.0000,0.0000,-0.1719 +0.9851,0.0000,0.0000,-0.1719 +0.9851,0.0000,0.0000,-0.1719 +0.9851,0.0000,0.0000,-0.1719 +0.9823,0.0000,0.0000,-0.1874 +0.9823,0.0000,0.0000,-0.1874 +0.9823,0.0000,0.0000,-0.1874 +0.9823,0.0000,0.0000,-0.1874 +0.9792,0.0000,0.0000,-0.2028 +0.9792,0.0000,0.0000,-0.2028 +0.9792,0.0000,0.0000,-0.2028 +0.9792,0.0000,0.0000,-0.2028 +0.9759,0.0000,0.0000,-0.2181 +0.9759,0.0000,0.0000,-0.2181 +0.9759,0.0000,0.0000,-0.2181 +0.9759,0.0000,0.0000,-0.2181 +0.9724,0.0000,0.0000,-0.2334 +0.9724,0.0000,0.0000,-0.2334 +0.9724,0.0000,0.0000,-0.2334 +0.9724,0.0000,0.0000,-0.2334 +0.9686,0.0000,0.0000,-0.2487 +0.9686,0.0000,0.0000,-0.2487 +0.9686,0.0000,0.0000,-0.2487 +0.9686,0.0000,0.0000,-0.2487 +0.9646,0.0000,0.0000,-0.2639 +0.9646,0.0000,0.0000,-0.2639 +0.9646,0.0000,0.0000,-0.2639 +0.9646,0.0000,0.0000,-0.2639 +0.9603,0.0000,0.0000,-0.2790 +0.9603,0.0000,0.0000,-0.2790 +0.9603,0.0000,0.0000,-0.2790 +0.9603,0.0000,0.0000,-0.2790 +0.9558,0.0000,0.0000,-0.2940 +0.9558,0.0000,0.0000,-0.2940 +0.9558,0.0000,0.0000,-0.2940 +0.9558,0.0000,0.0000,-0.2940 +0.9511,0.0000,0.0000,-0.3090 +0.9511,0.0000,0.0000,-0.3090 +0.9511,0.0000,0.0000,-0.3090 +0.9511,0.0000,0.0000,-0.3090 +0.9461,0.0000,0.0000,-0.3239 +0.9461,0.0000,0.0000,-0.3239 +0.9461,0.0000,0.0000,-0.3239 +0.9461,0.0000,0.0000,-0.3239 +0.9409,0.0000,0.0000,-0.3387 +0.9409,0.0000,0.0000,-0.3387 +0.9409,0.0000,0.0000,-0.3387 +0.9409,0.0000,0.0000,-0.3387 +0.9354,0.0000,0.0000,-0.3535 +0.9354,0.0000,0.0000,-0.3535 +0.9354,0.0000,0.0000,-0.3535 +0.9354,0.0000,0.0000,-0.3535 +0.9298,0.0000,0.0000,-0.3681 +0.9298,0.0000,0.0000,-0.3681 +0.9298,0.0000,0.0000,-0.3681 +0.9298,0.0000,0.0000,-0.3681 +0.9239,0.0000,0.0000,-0.3827 +0.9239,0.0000,0.0000,-0.3827 +0.9239,0.0000,0.0000,-0.3827 +0.9239,0.0000,0.0000,-0.3827 +0.9178,0.0000,0.0000,-0.3971 +0.9178,0.0000,0.0000,-0.3971 +0.9178,0.0000,0.0000,-0.3971 +0.9178,0.0000,0.0000,-0.3971 +0.9114,0.0000,0.0000,-0.4115 +0.9114,0.0000,0.0000,-0.4115 +0.9114,0.0000,0.0000,-0.4115 +0.9114,0.0000,0.0000,-0.4115 +0.9048,0.0000,0.0000,-0.4258 +0.9048,0.0000,0.0000,-0.4258 +0.9048,0.0000,0.0000,-0.4258 +0.9048,0.0000,0.0000,-0.4258 +0.8980,0.0000,0.0000,-0.4399 +0.8980,0.0000,0.0000,-0.4399 +0.8980,0.0000,0.0000,-0.4399 +0.8980,0.0000,0.0000,-0.4399 +0.8910,0.0000,0.0000,-0.4540 +0.8910,0.0000,0.0000,-0.4540 +0.8910,0.0000,0.0000,-0.4540 +0.8910,0.0000,0.0000,-0.4540 +0.8838,0.0000,0.0000,-0.4679 +0.8838,0.0000,0.0000,-0.4679 +0.8838,0.0000,0.0000,-0.4679 +0.8838,0.0000,0.0000,-0.4679 +0.8763,0.0000,0.0000,-0.4818 +0.8763,0.0000,0.0000,-0.4818 +0.8763,0.0000,0.0000,-0.4818 +0.8763,0.0000,0.0000,-0.4818 +0.8686,0.0000,0.0000,-0.4955 +0.8686,0.0000,0.0000,-0.4955 +0.8686,0.0000,0.0000,-0.4955 +0.8686,0.0000,0.0000,-0.4955 +0.8607,0.0000,0.0000,-0.5090 +0.8607,0.0000,0.0000,-0.5090 +0.8607,0.0000,0.0000,-0.5090 +0.8607,0.0000,0.0000,-0.5090 +0.8526,0.0000,0.0000,-0.5225 +0.8526,0.0000,0.0000,-0.5225 +0.8526,0.0000,0.0000,-0.5225 +0.8526,0.0000,0.0000,-0.5225 +0.8443,0.0000,0.0000,-0.5358 +0.8443,0.0000,0.0000,-0.5358 +0.8443,0.0000,0.0000,-0.5358 +0.8443,0.0000,0.0000,-0.5358 +0.8358,0.0000,0.0000,-0.5490 +0.8358,0.0000,0.0000,-0.5490 +0.8358,0.0000,0.0000,-0.5490 +0.8358,0.0000,0.0000,-0.5490 +0.8271,0.0000,0.0000,-0.5621 +0.8271,0.0000,0.0000,-0.5621 +0.8271,0.0000,0.0000,-0.5621 +0.8271,0.0000,0.0000,-0.5621 +0.8181,0.0000,0.0000,-0.5750 +0.8181,0.0000,0.0000,-0.5750 +0.8181,0.0000,0.0000,-0.5750 +0.8181,0.0000,0.0000,-0.5750 +0.8090,0.0000,0.0000,-0.5878 +0.8090,0.0000,0.0000,-0.5878 +0.8090,0.0000,0.0000,-0.5878 +0.8090,0.0000,0.0000,-0.5878 +0.7997,0.0000,0.0000,-0.6004 +0.7997,0.0000,0.0000,-0.6004 +0.7997,0.0000,0.0000,-0.6004 +0.7997,0.0000,0.0000,-0.6004 +0.7902,0.0000,0.0000,-0.6129 +0.7902,0.0000,0.0000,-0.6129 +0.7902,0.0000,0.0000,-0.6129 +0.7902,0.0000,0.0000,-0.6129 +0.7804,0.0000,0.0000,-0.6252 +0.7804,0.0000,0.0000,-0.6252 +0.7804,0.0000,0.0000,-0.6252 +0.7804,0.0000,0.0000,-0.6252 +0.7705,0.0000,0.0000,-0.6374 +0.7705,0.0000,0.0000,-0.6374 +0.7705,0.0000,0.0000,-0.6374 +0.7705,0.0000,0.0000,-0.6374 +0.7604,0.0000,0.0000,-0.6494 +0.7604,0.0000,0.0000,-0.6494 +0.7604,0.0000,0.0000,-0.6494 +0.7604,0.0000,0.0000,-0.6494 +0.7501,0.0000,0.0000,-0.6613 +0.7501,0.0000,0.0000,-0.6613 +0.7501,0.0000,0.0000,-0.6613 +0.7501,0.0000,0.0000,-0.6613 +0.7396,0.0000,0.0000,-0.6730 +0.7396,0.0000,0.0000,-0.6730 +0.7396,0.0000,0.0000,-0.6730 +0.7396,0.0000,0.0000,-0.6730 +0.7290,0.0000,0.0000,-0.6845 +0.7290,0.0000,0.0000,-0.6845 +0.7290,0.0000,0.0000,-0.6845 +0.7290,0.0000,0.0000,-0.6845 +0.7181,0.0000,0.0000,-0.6959 +0.7181,0.0000,0.0000,-0.6959 +0.7181,0.0000,0.0000,-0.6959 +0.7181,0.0000,0.0000,-0.6959 +0.7071,0.0000,0.0000,-0.7071 +0.7071,0.0000,0.0000,-0.7071 +0.7071,0.0000,0.0000,-0.7071 +0.7071,0.0000,0.0000,-0.7071 +0.6959,0.0000,0.0000,-0.7181 +0.6959,0.0000,0.0000,-0.7181 +0.6959,0.0000,0.0000,-0.7181 +0.6959,0.0000,0.0000,-0.7181 +0.6845,0.0000,0.0000,-0.7290 +0.6845,0.0000,0.0000,-0.7290 +0.6845,0.0000,0.0000,-0.7290 +0.6845,0.0000,0.0000,-0.7290 +0.6730,0.0000,0.0000,-0.7396 +0.6730,0.0000,0.0000,-0.7396 +0.6730,0.0000,0.0000,-0.7396 +0.6730,0.0000,0.0000,-0.7396 +0.6613,0.0000,0.0000,-0.7501 +0.6613,0.0000,0.0000,-0.7501 +0.6613,0.0000,0.0000,-0.7501 +0.6613,0.0000,0.0000,-0.7501 +0.6494,0.0000,0.0000,-0.7604 +0.6494,0.0000,0.0000,-0.7604 +0.6494,0.0000,0.0000,-0.7604 +0.6494,0.0000,0.0000,-0.7604 +0.6374,0.0000,0.0000,-0.7705 +0.6374,0.0000,0.0000,-0.7705 +0.6374,0.0000,0.0000,-0.7705 +0.6374,0.0000,0.0000,-0.7705 +0.6252,0.0000,0.0000,-0.7804 +0.6252,0.0000,0.0000,-0.7804 +0.6252,0.0000,0.0000,-0.7804 +0.6252,0.0000,0.0000,-0.7804 +0.6129,0.0000,0.0000,-0.7902 +0.6129,0.0000,0.0000,-0.7902 +0.6129,0.0000,0.0000,-0.7902 +0.6129,0.0000,0.0000,-0.7902 +0.6004,0.0000,0.0000,-0.7997 +0.6004,0.0000,0.0000,-0.7997 +0.6004,0.0000,0.0000,-0.7997 +0.6004,0.0000,0.0000,-0.7997 +0.5878,0.0000,0.0000,-0.8090 +0.5878,0.0000,0.0000,-0.8090 +0.5878,0.0000,0.0000,-0.8090 +0.5878,0.0000,0.0000,-0.8090 +0.5750,0.0000,0.0000,-0.8181 +0.5750,0.0000,0.0000,-0.8181 +0.5750,0.0000,0.0000,-0.8181 +0.5750,0.0000,0.0000,-0.8181 +0.5621,0.0000,0.0000,-0.8271 +0.5621,0.0000,0.0000,-0.8271 +0.5621,0.0000,0.0000,-0.8271 +0.5621,0.0000,0.0000,-0.8271 +0.5490,0.0000,0.0000,-0.8358 +0.5490,0.0000,0.0000,-0.8358 +0.5490,0.0000,0.0000,-0.8358 +0.5490,0.0000,0.0000,-0.8358 +0.5358,0.0000,0.0000,-0.8443 +0.5358,0.0000,0.0000,-0.8443 +0.5358,0.0000,0.0000,-0.8443 +0.5358,0.0000,0.0000,-0.8443 +0.5225,0.0000,0.0000,-0.8526 +0.5225,0.0000,0.0000,-0.8526 +0.5225,0.0000,0.0000,-0.8526 +0.5225,0.0000,0.0000,-0.8526 +0.5090,0.0000,0.0000,-0.8607 +0.5090,0.0000,0.0000,-0.8607 +0.5090,0.0000,0.0000,-0.8607 +0.5090,0.0000,0.0000,-0.8607 +0.4955,0.0000,0.0000,-0.8686 +0.4955,0.0000,0.0000,-0.8686 +0.4955,0.0000,0.0000,-0.8686 +0.4955,0.0000,0.0000,-0.8686 +0.4818,0.0000,0.0000,-0.8763 +0.4818,0.0000,0.0000,-0.8763 +0.4818,0.0000,0.0000,-0.8763 +0.4818,0.0000,0.0000,-0.8763 +0.4679,0.0000,0.0000,-0.8838 +0.4679,0.0000,0.0000,-0.8838 +0.4679,0.0000,0.0000,-0.8838 +0.4679,0.0000,0.0000,-0.8838 +0.4540,0.0000,0.0000,-0.8910 +0.4540,0.0000,0.0000,-0.8910 +0.4540,0.0000,0.0000,-0.8910 +0.4540,0.0000,0.0000,-0.8910 +0.4399,0.0000,0.0000,-0.8980 +0.4399,0.0000,0.0000,-0.8980 +0.4399,0.0000,0.0000,-0.8980 +0.4399,0.0000,0.0000,-0.8980 +0.4258,0.0000,0.0000,-0.9048 +0.4258,0.0000,0.0000,-0.9048 +0.4258,0.0000,0.0000,-0.9048 +0.4258,0.0000,0.0000,-0.9048 +0.4115,0.0000,0.0000,-0.9114 +0.4115,0.0000,0.0000,-0.9114 +0.4115,0.0000,0.0000,-0.9114 +0.4115,0.0000,0.0000,-0.9114 +0.3971,0.0000,0.0000,-0.9178 +0.3971,0.0000,0.0000,-0.9178 +0.3971,0.0000,0.0000,-0.9178 +0.3971,0.0000,0.0000,-0.9178 +0.3827,0.0000,0.0000,-0.9239 +0.3827,0.0000,0.0000,-0.9239 +0.3827,0.0000,0.0000,-0.9239 +0.3827,0.0000,0.0000,-0.9239 +0.3681,0.0000,0.0000,-0.9298 +0.3681,0.0000,0.0000,-0.9298 +0.3681,0.0000,0.0000,-0.9298 +0.3681,0.0000,0.0000,-0.9298 +0.3535,0.0000,0.0000,-0.9354 +0.3535,0.0000,0.0000,-0.9354 +0.3535,0.0000,0.0000,-0.9354 +0.3535,0.0000,0.0000,-0.9354 +0.3387,0.0000,0.0000,-0.9409 +0.3387,0.0000,0.0000,-0.9409 +0.3387,0.0000,0.0000,-0.9409 +0.3387,0.0000,0.0000,-0.9409 +0.3239,0.0000,0.0000,-0.9461 +0.3239,0.0000,0.0000,-0.9461 +0.3239,0.0000,0.0000,-0.9461 +0.3239,0.0000,0.0000,-0.9461 +0.3090,0.0000,0.0000,-0.9511 +0.3090,0.0000,0.0000,-0.9511 +0.3090,0.0000,0.0000,-0.9511 +0.3090,0.0000,0.0000,-0.9511 +0.2940,0.0000,0.0000,-0.9558 +0.2940,0.0000,0.0000,-0.9558 +0.2940,0.0000,0.0000,-0.9558 +0.2940,0.0000,0.0000,-0.9558 +0.2790,0.0000,0.0000,-0.9603 +0.2790,0.0000,0.0000,-0.9603 +0.2790,0.0000,0.0000,-0.9603 +0.2790,0.0000,0.0000,-0.9603 +0.2639,0.0000,0.0000,-0.9646 +0.2639,0.0000,0.0000,-0.9646 +0.2639,0.0000,0.0000,-0.9646 +0.2639,0.0000,0.0000,-0.9646 +0.2487,0.0000,0.0000,-0.9686 +0.2487,0.0000,0.0000,-0.9686 +0.2487,0.0000,0.0000,-0.9686 +0.2487,0.0000,0.0000,-0.9686 +0.2334,0.0000,0.0000,-0.9724 +0.2334,0.0000,0.0000,-0.9724 +0.2334,0.0000,0.0000,-0.9724 +0.2334,0.0000,0.0000,-0.9724 +0.2181,0.0000,0.0000,-0.9759 +0.2181,0.0000,0.0000,-0.9759 +0.2181,0.0000,0.0000,-0.9759 +0.2181,0.0000,0.0000,-0.9759 +0.2028,0.0000,0.0000,-0.9792 +0.2028,0.0000,0.0000,-0.9792 +0.2028,0.0000,0.0000,-0.9792 +0.2028,0.0000,0.0000,-0.9792 +0.1874,0.0000,0.0000,-0.9823 +0.1874,0.0000,0.0000,-0.9823 +0.1874,0.0000,0.0000,-0.9823 +0.1874,0.0000,0.0000,-0.9823 +0.1719,0.0000,0.0000,-0.9851 +0.1719,0.0000,0.0000,-0.9851 +0.1719,0.0000,0.0000,-0.9851 +0.1719,0.0000,0.0000,-0.9851 +0.1564,0.0000,0.0000,-0.9877 +0.1564,0.0000,0.0000,-0.9877 +0.1564,0.0000,0.0000,-0.9877 +0.1564,0.0000,0.0000,-0.9877 +0.1409,0.0000,0.0000,-0.9900 +0.1409,0.0000,0.0000,-0.9900 +0.1409,0.0000,0.0000,-0.9900 +0.1409,0.0000,0.0000,-0.9900 +0.1253,0.0000,0.0000,-0.9921 +0.1253,0.0000,0.0000,-0.9921 +0.1253,0.0000,0.0000,-0.9921 +0.1253,0.0000,0.0000,-0.9921 +0.1097,0.0000,0.0000,-0.9940 +0.1097,0.0000,0.0000,-0.9940 +0.1097,0.0000,0.0000,-0.9940 +0.1097,0.0000,0.0000,-0.9940 +0.0941,0.0000,0.0000,-0.9956 +0.0941,0.0000,0.0000,-0.9956 +0.0941,0.0000,0.0000,-0.9956 +0.0941,0.0000,0.0000,-0.9956 +0.0785,0.0000,0.0000,-0.9969 +0.0785,0.0000,0.0000,-0.9969 +0.0785,0.0000,0.0000,-0.9969 +0.0785,0.0000,0.0000,-0.9969 +0.0628,0.0000,0.0000,-0.9980 +0.0628,0.0000,0.0000,-0.9980 +0.0628,0.0000,0.0000,-0.9980 +0.0628,0.0000,0.0000,-0.9980 +0.0471,0.0000,0.0000,-0.9989 +0.0471,0.0000,0.0000,-0.9989 +0.0471,0.0000,0.0000,-0.9989 +0.0471,0.0000,0.0000,-0.9989 +0.0314,0.0000,0.0000,-0.9995 +0.0314,0.0000,0.0000,-0.9995 +0.0314,0.0000,0.0000,-0.9995 +0.0314,0.0000,0.0000,-0.9995 +0.0157,0.0000,0.0000,-0.9999 +0.0157,0.0000,0.0000,-0.9999 +0.0157,0.0000,0.0000,-0.9999 +0.0157,0.0000,0.0000,-0.9999 +-0.0000,0.0000,0.0000,-1.0000 +-0.0000,0.0000,0.0000,-1.0000 +-0.0000,0.0000,0.0000,-1.0000 +-0.0000,0.0000,0.0000,-1.0000 +-0.0157,0.0000,0.0000,-0.9999 +-0.0157,0.0000,0.0000,-0.9999 +-0.0157,0.0000,0.0000,-0.9999 +-0.0157,0.0000,0.0000,-0.9999 +-0.0314,0.0000,0.0000,-0.9995 +-0.0314,0.0000,0.0000,-0.9995 +-0.0314,0.0000,0.0000,-0.9995 +-0.0314,0.0000,0.0000,-0.9995 +-0.0471,0.0000,0.0000,-0.9989 +-0.0471,0.0000,0.0000,-0.9989 +-0.0471,0.0000,0.0000,-0.9989 +-0.0471,0.0000,0.0000,-0.9989 +-0.0628,0.0000,0.0000,-0.9980 +-0.0628,0.0000,0.0000,-0.9980 +-0.0628,0.0000,0.0000,-0.9980 +-0.0628,0.0000,0.0000,-0.9980 +-0.0785,0.0000,0.0000,-0.9969 +-0.0785,0.0000,0.0000,-0.9969 +-0.0785,0.0000,0.0000,-0.9969 +-0.0785,0.0000,0.0000,-0.9969 +-0.0941,0.0000,0.0000,-0.9956 +-0.0941,0.0000,0.0000,-0.9956 +-0.0941,0.0000,0.0000,-0.9956 +-0.0941,0.0000,0.0000,-0.9956 +-0.1097,0.0000,0.0000,-0.9940 +-0.1097,0.0000,0.0000,-0.9940 +-0.1097,0.0000,0.0000,-0.9940 +-0.1097,0.0000,0.0000,-0.9940 +-0.1253,0.0000,0.0000,-0.9921 +-0.1253,0.0000,0.0000,-0.9921 +-0.1253,0.0000,0.0000,-0.9921 +-0.1253,0.0000,0.0000,-0.9921 +-0.1409,0.0000,0.0000,-0.9900 +-0.1409,0.0000,0.0000,-0.9900 +-0.1409,0.0000,0.0000,-0.9900 +-0.1409,0.0000,0.0000,-0.9900 +-0.1564,0.0000,0.0000,-0.9877 +-0.1564,0.0000,0.0000,-0.9877 +-0.1564,0.0000,0.0000,-0.9877 +-0.1564,0.0000,0.0000,-0.9877 +-0.1719,0.0000,0.0000,-0.9851 +-0.1719,0.0000,0.0000,-0.9851 +-0.1719,0.0000,0.0000,-0.9851 +-0.1719,0.0000,0.0000,-0.9851 +-0.1874,0.0000,0.0000,-0.9823 +-0.1874,0.0000,0.0000,-0.9823 +-0.1874,0.0000,0.0000,-0.9823 +-0.1874,0.0000,0.0000,-0.9823 +-0.2028,0.0000,0.0000,-0.9792 +-0.2028,0.0000,0.0000,-0.9792 +-0.2028,0.0000,0.0000,-0.9792 +-0.2028,0.0000,0.0000,-0.9792 +-0.2181,0.0000,0.0000,-0.9759 +-0.2181,0.0000,0.0000,-0.9759 +-0.2181,0.0000,0.0000,-0.9759 +-0.2181,0.0000,0.0000,-0.9759 +-0.2334,0.0000,0.0000,-0.9724 +-0.2334,0.0000,0.0000,-0.9724 +-0.2334,0.0000,0.0000,-0.9724 +-0.2334,0.0000,0.0000,-0.9724 +-0.2487,0.0000,0.0000,-0.9686 +-0.2487,0.0000,0.0000,-0.9686 +-0.2487,0.0000,0.0000,-0.9686 +-0.2487,0.0000,0.0000,-0.9686 +-0.2639,0.0000,0.0000,-0.9646 +-0.2639,0.0000,0.0000,-0.9646 +-0.2639,0.0000,0.0000,-0.9646 +-0.2639,0.0000,0.0000,-0.9646 +-0.2790,0.0000,0.0000,-0.9603 +-0.2790,0.0000,0.0000,-0.9603 +-0.2790,0.0000,0.0000,-0.9603 +-0.2790,0.0000,0.0000,-0.9603 +-0.2940,0.0000,0.0000,-0.9558 +-0.2940,0.0000,0.0000,-0.9558 +-0.2940,0.0000,0.0000,-0.9558 +-0.2940,0.0000,0.0000,-0.9558 +-0.3090,0.0000,0.0000,-0.9511 +-0.3090,0.0000,0.0000,-0.9511 +-0.3090,0.0000,0.0000,-0.9511 +-0.3090,0.0000,0.0000,-0.9511 +-0.3239,0.0000,0.0000,-0.9461 +-0.3239,0.0000,0.0000,-0.9461 +-0.3239,0.0000,0.0000,-0.9461 +-0.3239,0.0000,0.0000,-0.9461 +-0.3387,0.0000,0.0000,-0.9409 +-0.3387,0.0000,0.0000,-0.9409 +-0.3387,0.0000,0.0000,-0.9409 +-0.3387,0.0000,0.0000,-0.9409 +-0.3535,0.0000,0.0000,-0.9354 +-0.3535,0.0000,0.0000,-0.9354 +-0.3535,0.0000,0.0000,-0.9354 +-0.3535,0.0000,0.0000,-0.9354 +-0.3681,0.0000,0.0000,-0.9298 +-0.3681,0.0000,0.0000,-0.9298 +-0.3681,0.0000,0.0000,-0.9298 +-0.3681,0.0000,0.0000,-0.9298 +-0.3827,0.0000,0.0000,-0.9239 +-0.3827,0.0000,0.0000,-0.9239 +-0.3827,0.0000,0.0000,-0.9239 +-0.3827,0.0000,0.0000,-0.9239 +-0.3971,0.0000,0.0000,-0.9178 +-0.3971,0.0000,0.0000,-0.9178 +-0.3971,0.0000,0.0000,-0.9178 +-0.3971,0.0000,0.0000,-0.9178 +-0.4115,0.0000,0.0000,-0.9114 +-0.4115,0.0000,0.0000,-0.9114 +-0.4115,0.0000,0.0000,-0.9114 +-0.4115,0.0000,0.0000,-0.9114 +-0.4258,0.0000,0.0000,-0.9048 +-0.4258,0.0000,0.0000,-0.9048 +-0.4258,0.0000,0.0000,-0.9048 +-0.4258,0.0000,0.0000,-0.9048 +-0.4399,0.0000,0.0000,-0.8980 +-0.4399,0.0000,0.0000,-0.8980 +-0.4399,0.0000,0.0000,-0.8980 +-0.4399,0.0000,0.0000,-0.8980 +-0.4540,0.0000,0.0000,-0.8910 +-0.4540,0.0000,0.0000,-0.8910 +-0.4540,0.0000,0.0000,-0.8910 +-0.4540,0.0000,0.0000,-0.8910 +-0.4679,0.0000,0.0000,-0.8838 +-0.4679,0.0000,0.0000,-0.8838 +-0.4679,0.0000,0.0000,-0.8838 +-0.4679,0.0000,0.0000,-0.8838 +-0.4818,0.0000,0.0000,-0.8763 +-0.4818,0.0000,0.0000,-0.8763 +-0.4818,0.0000,0.0000,-0.8763 +-0.4818,0.0000,0.0000,-0.8763 +-0.4955,0.0000,0.0000,-0.8686 +-0.4955,0.0000,0.0000,-0.8686 +-0.4955,0.0000,0.0000,-0.8686 +-0.4955,0.0000,0.0000,-0.8686 +-0.5090,0.0000,0.0000,-0.8607 +-0.5090,0.0000,0.0000,-0.8607 +-0.5090,0.0000,0.0000,-0.8607 +-0.5090,0.0000,0.0000,-0.8607 +-0.5225,0.0000,0.0000,-0.8526 +-0.5225,0.0000,0.0000,-0.8526 +-0.5225,0.0000,0.0000,-0.8526 +-0.5225,0.0000,0.0000,-0.8526 +-0.5358,0.0000,0.0000,-0.8443 +-0.5358,0.0000,0.0000,-0.8443 +-0.5358,0.0000,0.0000,-0.8443 +-0.5358,0.0000,0.0000,-0.8443 +-0.5490,0.0000,0.0000,-0.8358 +-0.5490,0.0000,0.0000,-0.8358 +-0.5490,0.0000,0.0000,-0.8358 +-0.5490,0.0000,0.0000,-0.8358 +-0.5621,0.0000,0.0000,-0.8271 +-0.5621,0.0000,0.0000,-0.8271 +-0.5621,0.0000,0.0000,-0.8271 +-0.5621,0.0000,0.0000,-0.8271 +-0.5750,0.0000,0.0000,-0.8181 +-0.5750,0.0000,0.0000,-0.8181 +-0.5750,0.0000,0.0000,-0.8181 +-0.5750,0.0000,0.0000,-0.8181 +-0.5878,0.0000,0.0000,-0.8090 +-0.5878,0.0000,0.0000,-0.8090 +-0.5878,0.0000,0.0000,-0.8090 +-0.5878,0.0000,0.0000,-0.8090 +-0.6004,0.0000,0.0000,-0.7997 +-0.6004,0.0000,0.0000,-0.7997 +-0.6004,0.0000,0.0000,-0.7997 +-0.6004,0.0000,0.0000,-0.7997 +-0.6129,0.0000,0.0000,-0.7902 +-0.6129,0.0000,0.0000,-0.7902 +-0.6129,0.0000,0.0000,-0.7902 +-0.6129,0.0000,0.0000,-0.7902 +-0.6252,0.0000,0.0000,-0.7804 +-0.6252,0.0000,0.0000,-0.7804 +-0.6252,0.0000,0.0000,-0.7804 +-0.6252,0.0000,0.0000,-0.7804 +-0.6374,0.0000,0.0000,-0.7705 +-0.6374,0.0000,0.0000,-0.7705 +-0.6374,0.0000,0.0000,-0.7705 +-0.6374,0.0000,0.0000,-0.7705 +-0.6494,0.0000,0.0000,-0.7604 +-0.6494,0.0000,0.0000,-0.7604 +-0.6494,0.0000,0.0000,-0.7604 +-0.6494,0.0000,0.0000,-0.7604 +-0.6613,0.0000,0.0000,-0.7501 +-0.6613,0.0000,0.0000,-0.7501 +-0.6613,0.0000,0.0000,-0.7501 +-0.6613,0.0000,0.0000,-0.7501 +-0.6730,0.0000,0.0000,-0.7396 +-0.6730,0.0000,0.0000,-0.7396 +-0.6730,0.0000,0.0000,-0.7396 +-0.6730,0.0000,0.0000,-0.7396 +-0.6845,0.0000,0.0000,-0.7290 +-0.6845,0.0000,0.0000,-0.7290 +-0.6845,0.0000,0.0000,-0.7290 +-0.6845,0.0000,0.0000,-0.7290 +-0.6959,0.0000,0.0000,-0.7181 +-0.6959,0.0000,0.0000,-0.7181 +-0.6959,0.0000,0.0000,-0.7181 +-0.6959,0.0000,0.0000,-0.7181 +-0.7071,0.0000,0.0000,-0.7071 +-0.7071,0.0000,0.0000,-0.7071 +-0.7071,0.0000,0.0000,-0.7071 +-0.7071,0.0000,0.0000,-0.7071 +-0.7181,0.0000,0.0000,-0.6959 +-0.7181,0.0000,0.0000,-0.6959 +-0.7181,0.0000,0.0000,-0.6959 +-0.7181,0.0000,0.0000,-0.6959 +-0.7290,0.0000,0.0000,-0.6845 +-0.7290,0.0000,0.0000,-0.6845 +-0.7290,0.0000,0.0000,-0.6845 +-0.7290,0.0000,0.0000,-0.6845 +-0.7396,0.0000,0.0000,-0.6730 +-0.7396,0.0000,0.0000,-0.6730 +-0.7396,0.0000,0.0000,-0.6730 +-0.7396,0.0000,0.0000,-0.6730 +-0.7501,0.0000,0.0000,-0.6613 +-0.7501,0.0000,0.0000,-0.6613 +-0.7501,0.0000,0.0000,-0.6613 +-0.7501,0.0000,0.0000,-0.6613 +-0.7604,0.0000,0.0000,-0.6494 +-0.7604,0.0000,0.0000,-0.6494 +-0.7604,0.0000,0.0000,-0.6494 +-0.7604,0.0000,0.0000,-0.6494 +-0.7705,0.0000,0.0000,-0.6374 +-0.7705,0.0000,0.0000,-0.6374 +-0.7705,0.0000,0.0000,-0.6374 +-0.7705,0.0000,0.0000,-0.6374 +-0.7804,0.0000,0.0000,-0.6252 +-0.7804,0.0000,0.0000,-0.6252 +-0.7804,0.0000,0.0000,-0.6252 +-0.7804,0.0000,0.0000,-0.6252 +-0.7902,0.0000,0.0000,-0.6129 +-0.7902,0.0000,0.0000,-0.6129 +-0.7902,0.0000,0.0000,-0.6129 +-0.7902,0.0000,0.0000,-0.6129 +-0.7997,0.0000,0.0000,-0.6004 +-0.7997,0.0000,0.0000,-0.6004 +-0.7997,0.0000,0.0000,-0.6004 +-0.7997,0.0000,0.0000,-0.6004 +-0.8090,0.0000,0.0000,-0.5878 +-0.8090,0.0000,0.0000,-0.5878 +-0.8090,0.0000,0.0000,-0.5878 +-0.8090,0.0000,0.0000,-0.5878 +-0.8182,0.0000,0.0000,-0.5750 +-0.8182,0.0000,0.0000,-0.5750 +-0.8182,0.0000,0.0000,-0.5750 +-0.8182,0.0000,0.0000,-0.5750 +-0.8271,0.0000,0.0000,-0.5621 +-0.8271,0.0000,0.0000,-0.5621 +-0.8271,0.0000,0.0000,-0.5621 +-0.8271,0.0000,0.0000,-0.5621 +-0.8358,0.0000,0.0000,-0.5490 +-0.8358,0.0000,0.0000,-0.5490 +-0.8358,0.0000,0.0000,-0.5490 +-0.8358,0.0000,0.0000,-0.5490 +-0.8443,0.0000,0.0000,-0.5358 +-0.8443,0.0000,0.0000,-0.5358 +-0.8443,0.0000,0.0000,-0.5358 +-0.8443,0.0000,0.0000,-0.5358 +-0.8526,0.0000,0.0000,-0.5225 +-0.8526,0.0000,0.0000,-0.5225 +-0.8526,0.0000,0.0000,-0.5225 +-0.8526,0.0000,0.0000,-0.5225 +-0.8607,0.0000,0.0000,-0.5090 +-0.8607,0.0000,0.0000,-0.5090 +-0.8607,0.0000,0.0000,-0.5090 +-0.8607,0.0000,0.0000,-0.5090 +-0.8686,0.0000,0.0000,-0.4955 +-0.8686,0.0000,0.0000,-0.4955 +-0.8686,0.0000,0.0000,-0.4955 +-0.8686,0.0000,0.0000,-0.4955 +-0.8763,0.0000,0.0000,-0.4818 +-0.8763,0.0000,0.0000,-0.4818 +-0.8763,0.0000,0.0000,-0.4818 +-0.8763,0.0000,0.0000,-0.4818 +-0.8838,0.0000,0.0000,-0.4679 +-0.8838,0.0000,0.0000,-0.4679 +-0.8838,0.0000,0.0000,-0.4679 +-0.8838,0.0000,0.0000,-0.4679 +-0.8910,0.0000,0.0000,-0.4540 +-0.8910,0.0000,0.0000,-0.4540 +-0.8910,0.0000,0.0000,-0.4540 +-0.8910,0.0000,0.0000,-0.4540 +-0.8980,0.0000,0.0000,-0.4399 +-0.8980,0.0000,0.0000,-0.4399 +-0.8980,0.0000,0.0000,-0.4399 +-0.8980,0.0000,0.0000,-0.4399 +-0.9048,0.0000,0.0000,-0.4258 +-0.9048,0.0000,0.0000,-0.4258 +-0.9048,0.0000,0.0000,-0.4258 +-0.9048,0.0000,0.0000,-0.4258 +-0.9114,0.0000,0.0000,-0.4115 +-0.9114,0.0000,0.0000,-0.4115 +-0.9114,0.0000,0.0000,-0.4115 +-0.9114,0.0000,0.0000,-0.4115 +-0.9178,0.0000,0.0000,-0.3971 +-0.9178,0.0000,0.0000,-0.3971 +-0.9178,0.0000,0.0000,-0.3971 +-0.9178,0.0000,0.0000,-0.3971 +-0.9239,0.0000,0.0000,-0.3827 +-0.9239,0.0000,0.0000,-0.3827 +-0.9239,0.0000,0.0000,-0.3827 +-0.9239,0.0000,0.0000,-0.3827 +-0.9298,0.0000,0.0000,-0.3681 +-0.9298,0.0000,0.0000,-0.3681 +-0.9298,0.0000,0.0000,-0.3681 +-0.9298,0.0000,0.0000,-0.3681 +-0.9354,0.0000,0.0000,-0.3535 +-0.9354,0.0000,0.0000,-0.3535 +-0.9354,0.0000,0.0000,-0.3535 +-0.9354,0.0000,0.0000,-0.3535 +-0.9409,0.0000,0.0000,-0.3387 +-0.9409,0.0000,0.0000,-0.3387 +-0.9409,0.0000,0.0000,-0.3387 +-0.9409,0.0000,0.0000,-0.3387 +-0.9461,0.0000,0.0000,-0.3239 +-0.9461,0.0000,0.0000,-0.3239 +-0.9461,0.0000,0.0000,-0.3239 +-0.9461,0.0000,0.0000,-0.3239 +-0.9511,0.0000,0.0000,-0.3090 +-0.9511,0.0000,0.0000,-0.3090 +-0.9511,0.0000,0.0000,-0.3090 +-0.9511,0.0000,0.0000,-0.3090 +-0.9558,0.0000,0.0000,-0.2940 +-0.9558,0.0000,0.0000,-0.2940 +-0.9558,0.0000,0.0000,-0.2940 +-0.9558,0.0000,0.0000,-0.2940 +-0.9603,0.0000,0.0000,-0.2790 +-0.9603,0.0000,0.0000,-0.2790 +-0.9603,0.0000,0.0000,-0.2790 +-0.9603,0.0000,0.0000,-0.2790 +-0.9646,0.0000,0.0000,-0.2639 +-0.9646,0.0000,0.0000,-0.2639 +-0.9646,0.0000,0.0000,-0.2639 +-0.9646,0.0000,0.0000,-0.2639 +-0.9686,0.0000,0.0000,-0.2487 +-0.9686,0.0000,0.0000,-0.2487 +-0.9686,0.0000,0.0000,-0.2487 +-0.9686,0.0000,0.0000,-0.2487 +-0.9724,0.0000,0.0000,-0.2334 +-0.9724,0.0000,0.0000,-0.2334 +-0.9724,0.0000,0.0000,-0.2334 +-0.9724,0.0000,0.0000,-0.2334 +-0.9759,0.0000,0.0000,-0.2181 +-0.9759,0.0000,0.0000,-0.2181 +-0.9759,0.0000,0.0000,-0.2181 +-0.9759,0.0000,0.0000,-0.2181 +-0.9792,0.0000,0.0000,-0.2028 +-0.9792,0.0000,0.0000,-0.2028 +-0.9792,0.0000,0.0000,-0.2028 +-0.9792,0.0000,0.0000,-0.2028 +-0.9823,0.0000,0.0000,-0.1874 +-0.9823,0.0000,0.0000,-0.1874 +-0.9823,0.0000,0.0000,-0.1874 +-0.9823,0.0000,0.0000,-0.1874 +-0.9851,0.0000,0.0000,-0.1719 +-0.9851,0.0000,0.0000,-0.1719 +-0.9851,0.0000,0.0000,-0.1719 +-0.9851,0.0000,0.0000,-0.1719 +-0.9877,0.0000,0.0000,-0.1564 +-0.9877,0.0000,0.0000,-0.1564 +-0.9877,0.0000,0.0000,-0.1564 +-0.9877,0.0000,0.0000,-0.1564 +-0.9900,0.0000,0.0000,-0.1409 +-0.9900,0.0000,0.0000,-0.1409 +-0.9900,0.0000,0.0000,-0.1409 +-0.9900,0.0000,0.0000,-0.1409 +-0.9921,0.0000,0.0000,-0.1253 +-0.9921,0.0000,0.0000,-0.1253 +-0.9921,0.0000,0.0000,-0.1253 +-0.9921,0.0000,0.0000,-0.1253 +-0.9940,0.0000,0.0000,-0.1097 +-0.9940,0.0000,0.0000,-0.1097 +-0.9940,0.0000,0.0000,-0.1097 +-0.9940,0.0000,0.0000,-0.1097 +-0.9956,0.0000,0.0000,-0.0941 +-0.9956,0.0000,0.0000,-0.0941 +-0.9956,0.0000,0.0000,-0.0941 +-0.9956,0.0000,0.0000,-0.0941 +-0.9969,0.0000,0.0000,-0.0785 +-0.9969,0.0000,0.0000,-0.0785 +-0.9969,0.0000,0.0000,-0.0785 +-0.9969,0.0000,0.0000,-0.0785 +-0.9980,0.0000,0.0000,-0.0628 +-0.9980,0.0000,0.0000,-0.0628 +-0.9980,0.0000,0.0000,-0.0628 +-0.9980,0.0000,0.0000,-0.0628 +-0.9989,0.0000,0.0000,-0.0471 +-0.9989,0.0000,0.0000,-0.0471 +-0.9989,0.0000,0.0000,-0.0471 +-0.9989,0.0000,0.0000,-0.0471 +-0.9995,0.0000,0.0000,-0.0314 +-0.9995,0.0000,0.0000,-0.0314 +-0.9995,0.0000,0.0000,-0.0314 +-0.9995,0.0000,0.0000,-0.0314 +-0.9999,0.0000,0.0000,-0.0157 +-0.9999,0.0000,0.0000,-0.0157 +-0.9999,0.0000,0.0000,-0.0157 +-0.9999,0.0000,0.0000,-0.0157 +1.0000,0.0000,0.0000,-0.0000 +1.0000,0.0000,0.0000,-0.0000 +1.0000,0.0000,0.0000,-0.0000 +1.0000,0.0000,0.0000,-0.0000 diff --git a/scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv b/scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv new file mode 100644 index 0000000000..8fe2d2fe05 --- /dev/null +++ b/scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv @@ -0,0 +1,200 @@ +0.0000,0.0000,0.0000,0.7012,-0.0220,-0.7126 +0.0000,0.0000,0.0000,0.7057,-0.0444,-0.7071 +0.0000,0.0000,0.0000,0.7095,-0.0671,-0.7015 +0.0000,0.0000,0.0000,0.7125,-0.0900,-0.6959 +0.0000,0.0000,0.0000,0.7147,-0.1132,-0.6903 +0.0000,0.0000,0.0000,0.7161,-0.1366,-0.6845 +0.0000,0.0000,0.0000,0.7166,-0.1602,-0.6788 +0.0000,0.0000,0.0000,0.7164,-0.1839,-0.6730 +0.0000,0.0000,0.0000,0.7153,-0.2078,-0.6672 +0.0000,0.0000,0.0000,0.7134,-0.2318,-0.6613 +0.0000,0.0000,0.0000,0.7106,-0.2558,-0.6554 +0.0000,0.0000,0.0000,0.7070,-0.2799,-0.6494 +0.0000,0.0000,0.0000,0.7025,-0.3040,-0.6435 +0.0000,0.0000,0.0000,0.6972,-0.3281,-0.6374 +0.0000,0.0000,0.0000,0.6910,-0.3521,-0.6314 +0.0000,0.0000,0.0000,0.6839,-0.3760,-0.6252 +0.0000,0.0000,0.0000,0.6760,-0.3998,-0.6191 +0.0000,0.0000,0.0000,0.6671,-0.4234,-0.6129 +0.0000,0.0000,0.0000,0.6575,-0.4468,-0.6067 +0.0000,0.0000,0.0000,0.6470,-0.4700,-0.6004 +0.0000,0.0000,0.0000,0.6356,-0.4930,-0.5941 +0.0000,0.0000,0.0000,0.6234,-0.5157,-0.5878 +0.0000,0.0000,0.0000,0.6103,-0.5380,-0.5814 +0.0000,0.0000,0.0000,0.5964,-0.5601,-0.5750 +0.0000,0.0000,0.0000,0.5817,-0.5817,-0.5686 +0.0000,0.0000,0.0000,0.5662,-0.6029,-0.5621 +0.0000,0.0000,0.0000,0.5499,-0.6237,-0.5556 +0.0000,0.0000,0.0000,0.5328,-0.6440,-0.5490 +0.0000,0.0000,0.0000,0.5149,-0.6638,-0.5424 +0.0000,0.0000,0.0000,0.4963,-0.6831,-0.5358 +0.0000,0.0000,0.0000,0.4769,-0.7018,-0.5292 +0.0000,0.0000,0.0000,0.4569,-0.7199,-0.5225 +0.0000,0.0000,0.0000,0.4361,-0.7374,-0.5158 +0.0000,0.0000,0.0000,0.4147,-0.7543,-0.5090 +0.0000,0.0000,0.0000,0.3926,-0.7705,-0.5023 +0.0000,0.0000,0.0000,0.3698,-0.7860,-0.4955 +0.0000,0.0000,0.0000,0.3465,-0.8007,-0.4886 +0.0000,0.0000,0.0000,0.3226,-0.8148,-0.4818 +0.0000,0.0000,0.0000,0.2981,-0.8280,-0.4749 +0.0000,0.0000,0.0000,0.2731,-0.8405,-0.4679 +0.0000,0.0000,0.0000,0.2476,-0.8522,-0.4610 +0.0000,0.0000,0.0000,0.2216,-0.8630,-0.4540 +0.0000,0.0000,0.0000,0.1951,-0.8730,-0.4470 +0.0000,0.0000,0.0000,0.1683,-0.8821,-0.4399 +0.0000,0.0000,0.0000,0.1410,-0.8904,-0.4329 +0.0000,0.0000,0.0000,0.1134,-0.8977,-0.4258 +0.0000,0.0000,0.0000,0.0855,-0.9041,-0.4187 +0.0000,0.0000,0.0000,0.0572,-0.9096,-0.4115 +0.0000,0.0000,0.0000,0.0287,-0.9142,-0.4043 +0.0000,0.0000,0.0000,-0.0000,-0.9178,-0.3971 +0.0000,0.0000,0.0000,-0.0289,-0.9204,-0.3899 +0.0000,0.0000,0.0000,-0.0580,-0.9221,-0.3827 +0.0000,0.0000,0.0000,-0.0872,-0.9227,-0.3754 +0.0000,0.0000,0.0000,-0.1165,-0.9224,-0.3681 +0.0000,0.0000,0.0000,-0.1459,-0.9212,-0.3608 +0.0000,0.0000,0.0000,-0.1753,-0.9189,-0.3535 +0.0000,0.0000,0.0000,-0.2047,-0.9156,-0.3461 +0.0000,0.0000,0.0000,-0.2340,-0.9113,-0.3387 +0.0000,0.0000,0.0000,-0.2632,-0.9060,-0.3313 +0.0000,0.0000,0.0000,-0.2924,-0.8998,-0.3239 +0.0000,0.0000,0.0000,-0.3213,-0.8925,-0.3165 +0.0000,0.0000,0.0000,-0.3501,-0.8843,-0.3090 +0.0000,0.0000,0.0000,-0.3787,-0.8750,-0.3015 +0.0000,0.0000,0.0000,-0.4070,-0.8648,-0.2940 +0.0000,0.0000,0.0000,-0.4350,-0.8536,-0.2865 +0.0000,0.0000,0.0000,-0.4626,-0.8415,-0.2790 +0.0000,0.0000,0.0000,-0.4899,-0.8284,-0.2714 +0.0000,0.0000,0.0000,-0.5168,-0.8144,-0.2639 +0.0000,0.0000,0.0000,-0.5433,-0.7995,-0.2563 +0.0000,0.0000,0.0000,-0.5693,-0.7836,-0.2487 +0.0000,0.0000,0.0000,-0.5948,-0.7669,-0.2411 +0.0000,0.0000,0.0000,-0.6198,-0.7492,-0.2334 +0.0000,0.0000,0.0000,-0.6442,-0.7307,-0.2258 +0.0000,0.0000,0.0000,-0.6681,-0.7114,-0.2181 +0.0000,0.0000,0.0000,-0.6913,-0.6913,-0.2105 +0.0000,0.0000,0.0000,-0.7138,-0.6703,-0.2028 +0.0000,0.0000,0.0000,-0.7357,-0.6486,-0.1951 +0.0000,0.0000,0.0000,-0.7569,-0.6261,-0.1874 +0.0000,0.0000,0.0000,-0.7773,-0.6029,-0.1797 +0.0000,0.0000,0.0000,-0.7970,-0.5790,-0.1719 +0.0000,0.0000,0.0000,-0.8159,-0.5545,-0.1642 +0.0000,0.0000,0.0000,-0.8339,-0.5292,-0.1564 +0.0000,0.0000,0.0000,-0.8512,-0.5034,-0.1487 +0.0000,0.0000,0.0000,-0.8676,-0.4769,-0.1409 +0.0000,0.0000,0.0000,-0.8831,-0.4499,-0.1331 +0.0000,0.0000,0.0000,-0.8977,-0.4224,-0.1253 +0.0000,0.0000,0.0000,-0.9114,-0.3944,-0.1175 +0.0000,0.0000,0.0000,-0.9242,-0.3659,-0.1097 +0.0000,0.0000,0.0000,-0.9360,-0.3370,-0.1019 +0.0000,0.0000,0.0000,-0.9468,-0.3076,-0.0941 +0.0000,0.0000,0.0000,-0.9567,-0.2779,-0.0863 +0.0000,0.0000,0.0000,-0.9656,-0.2479,-0.0785 +0.0000,0.0000,0.0000,-0.9735,-0.2176,-0.0706 +0.0000,0.0000,0.0000,-0.9803,-0.1870,-0.0628 +0.0000,0.0000,0.0000,-0.9862,-0.1562,-0.0549 +0.0000,0.0000,0.0000,-0.9910,-0.1252,-0.0471 +0.0000,0.0000,0.0000,-0.9948,-0.0940,-0.0393 +0.0000,0.0000,0.0000,-0.9975,-0.0628,-0.0314 +0.0000,0.0000,0.0000,-0.9992,-0.0314,-0.0236 +0.0000,0.0000,0.0000,-0.9999,0.0000,-0.0157 +0.0000,0.0000,0.0000,-0.9995,0.0314,-0.0079 +0.0000,0.0000,0.0000,-0.9980,0.0628,0.0000 +0.0000,0.0000,0.0000,-0.9955,0.0941,0.0079 +0.0000,0.0000,0.0000,-0.9920,0.1253,0.0157 +0.0000,0.0000,0.0000,-0.9874,0.1564,0.0236 +0.0000,0.0000,0.0000,-0.9818,0.1873,0.0314 +0.0000,0.0000,0.0000,-0.9752,0.2180,0.0393 +0.0000,0.0000,0.0000,-0.9675,0.2484,0.0471 +0.0000,0.0000,0.0000,-0.9588,0.2786,0.0550 +0.0000,0.0000,0.0000,-0.9492,0.3084,0.0628 +0.0000,0.0000,0.0000,-0.9385,0.3379,0.0706 +0.0000,0.0000,0.0000,-0.9269,0.3670,0.0785 +0.0000,0.0000,0.0000,-0.9143,0.3957,0.0863 +0.0000,0.0000,0.0000,-0.9008,0.4239,0.0941 +0.0000,0.0000,0.0000,-0.8864,0.4516,0.1019 +0.0000,0.0000,0.0000,-0.8710,0.4788,0.1097 +0.0000,0.0000,0.0000,-0.8548,0.5055,0.1175 +0.0000,0.0000,0.0000,-0.8377,0.5316,0.1253 +0.0000,0.0000,0.0000,-0.8197,0.5571,0.1331 +0.0000,0.0000,0.0000,-0.8009,0.5819,0.1409 +0.0000,0.0000,0.0000,-0.7814,0.6061,0.1487 +0.0000,0.0000,0.0000,-0.7610,0.6296,0.1564 +0.0000,0.0000,0.0000,-0.7399,0.6523,0.1642 +0.0000,0.0000,0.0000,-0.7181,0.6744,0.1719 +0.0000,0.0000,0.0000,-0.6956,0.6956,0.1797 +0.0000,0.0000,0.0000,-0.6724,0.7161,0.1874 +0.0000,0.0000,0.0000,-0.6486,0.7357,0.1951 +0.0000,0.0000,0.0000,-0.6242,0.7545,0.2028 +0.0000,0.0000,0.0000,-0.5992,0.7725,0.2105 +0.0000,0.0000,0.0000,-0.5736,0.7895,0.2181 +0.0000,0.0000,0.0000,-0.5476,0.8057,0.2258 +0.0000,0.0000,0.0000,-0.5210,0.8210,0.2334 +0.0000,0.0000,0.0000,-0.4940,0.8354,0.2411 +0.0000,0.0000,0.0000,-0.4666,0.8488,0.2487 +0.0000,0.0000,0.0000,-0.4388,0.8612,0.2563 +0.0000,0.0000,0.0000,-0.4107,0.8728,0.2639 +0.0000,0.0000,0.0000,-0.3822,0.8833,0.2714 +0.0000,0.0000,0.0000,-0.3535,0.8929,0.2790 +0.0000,0.0000,0.0000,-0.3245,0.9014,0.2865 +0.0000,0.0000,0.0000,-0.2954,0.9090,0.2940 +0.0000,0.0000,0.0000,-0.2660,0.9156,0.3015 +0.0000,0.0000,0.0000,-0.2365,0.9212,0.3090 +0.0000,0.0000,0.0000,-0.2069,0.9258,0.3165 +0.0000,0.0000,0.0000,-0.1773,0.9293,0.3239 +0.0000,0.0000,0.0000,-0.1476,0.9319,0.3313 +0.0000,0.0000,0.0000,-0.1179,0.9335,0.3387 +0.0000,0.0000,0.0000,-0.0883,0.9340,0.3461 +0.0000,0.0000,0.0000,-0.0587,0.9336,0.3535 +0.0000,0.0000,0.0000,-0.0293,0.9322,0.3608 +0.0000,0.0000,0.0000,0.0000,0.9298,0.3681 +0.0000,0.0000,0.0000,0.0291,0.9264,0.3754 +0.0000,0.0000,0.0000,0.0580,0.9221,0.3827 +0.0000,0.0000,0.0000,0.0867,0.9168,0.3899 +0.0000,0.0000,0.0000,0.1150,0.9105,0.3971 +0.0000,0.0000,0.0000,0.1431,0.9033,0.4043 +0.0000,0.0000,0.0000,0.1708,0.8953,0.4115 +0.0000,0.0000,0.0000,0.1981,0.8863,0.4187 +0.0000,0.0000,0.0000,0.2250,0.8764,0.4258 +0.0000,0.0000,0.0000,0.2515,0.8657,0.4329 +0.0000,0.0000,0.0000,0.2775,0.8541,0.4399 +0.0000,0.0000,0.0000,0.3030,0.8417,0.4470 +0.0000,0.0000,0.0000,0.3280,0.8284,0.4540 +0.0000,0.0000,0.0000,0.3524,0.8144,0.4610 +0.0000,0.0000,0.0000,0.3763,0.7997,0.4679 +0.0000,0.0000,0.0000,0.3995,0.7841,0.4749 +0.0000,0.0000,0.0000,0.4222,0.7679,0.4818 +0.0000,0.0000,0.0000,0.4441,0.7510,0.4886 +0.0000,0.0000,0.0000,0.4654,0.7334,0.4955 +0.0000,0.0000,0.0000,0.4860,0.7152,0.5023 +0.0000,0.0000,0.0000,0.5059,0.6964,0.5090 +0.0000,0.0000,0.0000,0.5251,0.6769,0.5158 +0.0000,0.0000,0.0000,0.5435,0.6570,0.5225 +0.0000,0.0000,0.0000,0.5611,0.6365,0.5292 +0.0000,0.0000,0.0000,0.5780,0.6155,0.5358 +0.0000,0.0000,0.0000,0.5940,0.5940,0.5424 +0.0000,0.0000,0.0000,0.6093,0.5721,0.5490 +0.0000,0.0000,0.0000,0.6237,0.5499,0.5556 +0.0000,0.0000,0.0000,0.6373,0.5272,0.5621 +0.0000,0.0000,0.0000,0.6500,0.5042,0.5686 +0.0000,0.0000,0.0000,0.6619,0.4809,0.5750 +0.0000,0.0000,0.0000,0.6729,0.4573,0.5814 +0.0000,0.0000,0.0000,0.6831,0.4335,0.5878 +0.0000,0.0000,0.0000,0.6924,0.4095,0.5941 +0.0000,0.0000,0.0000,0.7008,0.3852,0.6004 +0.0000,0.0000,0.0000,0.7083,0.3609,0.6067 +0.0000,0.0000,0.0000,0.7150,0.3364,0.6129 +0.0000,0.0000,0.0000,0.7207,0.3119,0.6191 +0.0000,0.0000,0.0000,0.7256,0.2873,0.6252 +0.0000,0.0000,0.0000,0.7296,0.2627,0.6314 +0.0000,0.0000,0.0000,0.7328,0.2381,0.6374 +0.0000,0.0000,0.0000,0.7351,0.2136,0.6435 +0.0000,0.0000,0.0000,0.7365,0.1891,0.6494 +0.0000,0.0000,0.0000,0.7371,0.1648,0.6554 +0.0000,0.0000,0.0000,0.7368,0.1406,0.6613 +0.0000,0.0000,0.0000,0.7357,0.1165,0.6672 +0.0000,0.0000,0.0000,0.7338,0.0927,0.6730 +0.0000,0.0000,0.0000,0.7311,0.0691,0.6788 +0.0000,0.0000,0.0000,0.7275,0.0458,0.6845 +0.0000,0.0000,0.0000,0.7232,0.0227,0.6903 +0.0000,0.0000,0.0000,0.7181,-0.0000,0.6959 diff --git a/scripts/trajectories/full-circle-with-up-and-down-4s-ccw-Vector3.csv b/scripts/trajectories/full-circle-with-up-and-down-4s-ccw-Vector3.csv new file mode 100644 index 0000000000..6310889020 --- /dev/null +++ b/scripts/trajectories/full-circle-with-up-and-down-4s-ccw-Vector3.csv @@ -0,0 +1,200 @@ +0.0000,0.0000,0.0000,0.7012,0.0220,0.7126 +0.0000,0.0000,0.0000,0.7057,0.0444,0.7071 +0.0000,0.0000,0.0000,0.7095,0.0671,0.7015 +0.0000,0.0000,0.0000,0.7125,0.0900,0.6959 +0.0000,0.0000,0.0000,0.7147,0.1132,0.6903 +0.0000,0.0000,0.0000,0.7161,0.1366,0.6845 +0.0000,0.0000,0.0000,0.7166,0.1602,0.6788 +0.0000,0.0000,0.0000,0.7164,0.1839,0.6730 +0.0000,0.0000,0.0000,0.7153,0.2078,0.6672 +0.0000,0.0000,0.0000,0.7134,0.2318,0.6613 +0.0000,0.0000,0.0000,0.7106,0.2558,0.6554 +0.0000,0.0000,0.0000,0.7070,0.2799,0.6494 +0.0000,0.0000,0.0000,0.7025,0.3040,0.6435 +0.0000,0.0000,0.0000,0.6972,0.3281,0.6374 +0.0000,0.0000,0.0000,0.6910,0.3521,0.6314 +0.0000,0.0000,0.0000,0.6839,0.3760,0.6252 +0.0000,0.0000,0.0000,0.6760,0.3998,0.6191 +0.0000,0.0000,0.0000,0.6671,0.4234,0.6129 +0.0000,0.0000,0.0000,0.6575,0.4468,0.6067 +0.0000,0.0000,0.0000,0.6470,0.4700,0.6004 +0.0000,0.0000,0.0000,0.6356,0.4930,0.5941 +0.0000,0.0000,0.0000,0.6234,0.5157,0.5878 +0.0000,0.0000,0.0000,0.6103,0.5380,0.5814 +0.0000,0.0000,0.0000,0.5964,0.5601,0.5750 +0.0000,0.0000,0.0000,0.5817,0.5817,0.5686 +0.0000,0.0000,0.0000,0.5662,0.6029,0.5621 +0.0000,0.0000,0.0000,0.5499,0.6237,0.5556 +0.0000,0.0000,0.0000,0.5328,0.6440,0.5490 +0.0000,0.0000,0.0000,0.5149,0.6638,0.5424 +0.0000,0.0000,0.0000,0.4963,0.6831,0.5358 +0.0000,0.0000,0.0000,0.4769,0.7018,0.5292 +0.0000,0.0000,0.0000,0.4569,0.7199,0.5225 +0.0000,0.0000,0.0000,0.4361,0.7374,0.5158 +0.0000,0.0000,0.0000,0.4147,0.7543,0.5090 +0.0000,0.0000,0.0000,0.3926,0.7705,0.5023 +0.0000,0.0000,0.0000,0.3698,0.7860,0.4955 +0.0000,0.0000,0.0000,0.3465,0.8007,0.4886 +0.0000,0.0000,0.0000,0.3226,0.8148,0.4818 +0.0000,0.0000,0.0000,0.2981,0.8280,0.4749 +0.0000,0.0000,0.0000,0.2731,0.8405,0.4679 +0.0000,0.0000,0.0000,0.2476,0.8522,0.4610 +0.0000,0.0000,0.0000,0.2216,0.8630,0.4540 +0.0000,0.0000,0.0000,0.1951,0.8730,0.4470 +0.0000,0.0000,0.0000,0.1683,0.8821,0.4399 +0.0000,0.0000,0.0000,0.1410,0.8904,0.4329 +0.0000,0.0000,0.0000,0.1134,0.8977,0.4258 +0.0000,0.0000,0.0000,0.0855,0.9041,0.4187 +0.0000,0.0000,0.0000,0.0572,0.9096,0.4115 +0.0000,0.0000,0.0000,0.0287,0.9142,0.4043 +0.0000,0.0000,0.0000,-0.0000,0.9178,0.3971 +0.0000,0.0000,0.0000,-0.0289,0.9204,0.3899 +0.0000,0.0000,0.0000,-0.0580,0.9221,0.3827 +0.0000,0.0000,0.0000,-0.0872,0.9227,0.3754 +0.0000,0.0000,0.0000,-0.1165,0.9224,0.3681 +0.0000,0.0000,0.0000,-0.1459,0.9212,0.3608 +0.0000,0.0000,0.0000,-0.1753,0.9189,0.3535 +0.0000,0.0000,0.0000,-0.2047,0.9156,0.3461 +0.0000,0.0000,0.0000,-0.2340,0.9113,0.3387 +0.0000,0.0000,0.0000,-0.2632,0.9060,0.3313 +0.0000,0.0000,0.0000,-0.2924,0.8998,0.3239 +0.0000,0.0000,0.0000,-0.3213,0.8925,0.3165 +0.0000,0.0000,0.0000,-0.3501,0.8843,0.3090 +0.0000,0.0000,0.0000,-0.3787,0.8750,0.3015 +0.0000,0.0000,0.0000,-0.4070,0.8648,0.2940 +0.0000,0.0000,0.0000,-0.4350,0.8536,0.2865 +0.0000,0.0000,0.0000,-0.4626,0.8415,0.2790 +0.0000,0.0000,0.0000,-0.4899,0.8284,0.2714 +0.0000,0.0000,0.0000,-0.5168,0.8144,0.2639 +0.0000,0.0000,0.0000,-0.5433,0.7995,0.2563 +0.0000,0.0000,0.0000,-0.5693,0.7836,0.2487 +0.0000,0.0000,0.0000,-0.5948,0.7669,0.2411 +0.0000,0.0000,0.0000,-0.6198,0.7492,0.2334 +0.0000,0.0000,0.0000,-0.6442,0.7307,0.2258 +0.0000,0.0000,0.0000,-0.6681,0.7114,0.2181 +0.0000,0.0000,0.0000,-0.6913,0.6913,0.2105 +0.0000,0.0000,0.0000,-0.7138,0.6703,0.2028 +0.0000,0.0000,0.0000,-0.7357,0.6486,0.1951 +0.0000,0.0000,0.0000,-0.7569,0.6261,0.1874 +0.0000,0.0000,0.0000,-0.7773,0.6029,0.1797 +0.0000,0.0000,0.0000,-0.7970,0.5790,0.1719 +0.0000,0.0000,0.0000,-0.8159,0.5545,0.1642 +0.0000,0.0000,0.0000,-0.8339,0.5292,0.1564 +0.0000,0.0000,0.0000,-0.8512,0.5034,0.1487 +0.0000,0.0000,0.0000,-0.8676,0.4769,0.1409 +0.0000,0.0000,0.0000,-0.8831,0.4499,0.1331 +0.0000,0.0000,0.0000,-0.8977,0.4224,0.1253 +0.0000,0.0000,0.0000,-0.9114,0.3944,0.1175 +0.0000,0.0000,0.0000,-0.9242,0.3659,0.1097 +0.0000,0.0000,0.0000,-0.9360,0.3370,0.1019 +0.0000,0.0000,0.0000,-0.9468,0.3076,0.0941 +0.0000,0.0000,0.0000,-0.9567,0.2779,0.0863 +0.0000,0.0000,0.0000,-0.9656,0.2479,0.0785 +0.0000,0.0000,0.0000,-0.9735,0.2176,0.0706 +0.0000,0.0000,0.0000,-0.9803,0.1870,0.0628 +0.0000,0.0000,0.0000,-0.9862,0.1562,0.0549 +0.0000,0.0000,0.0000,-0.9910,0.1252,0.0471 +0.0000,0.0000,0.0000,-0.9948,0.0940,0.0393 +0.0000,0.0000,0.0000,-0.9975,0.0628,0.0314 +0.0000,0.0000,0.0000,-0.9992,0.0314,0.0236 +0.0000,0.0000,0.0000,-0.9999,-0.0000,0.0157 +0.0000,0.0000,0.0000,-0.9995,-0.0314,0.0079 +0.0000,0.0000,0.0000,-0.9980,-0.0628,-0.0000 +0.0000,0.0000,0.0000,-0.9955,-0.0941,-0.0079 +0.0000,0.0000,0.0000,-0.9920,-0.1253,-0.0157 +0.0000,0.0000,0.0000,-0.9874,-0.1564,-0.0236 +0.0000,0.0000,0.0000,-0.9818,-0.1873,-0.0314 +0.0000,0.0000,0.0000,-0.9752,-0.2180,-0.0393 +0.0000,0.0000,0.0000,-0.9675,-0.2484,-0.0471 +0.0000,0.0000,0.0000,-0.9588,-0.2786,-0.0550 +0.0000,0.0000,0.0000,-0.9492,-0.3084,-0.0628 +0.0000,0.0000,0.0000,-0.9385,-0.3379,-0.0706 +0.0000,0.0000,0.0000,-0.9269,-0.3670,-0.0785 +0.0000,0.0000,0.0000,-0.9143,-0.3957,-0.0863 +0.0000,0.0000,0.0000,-0.9008,-0.4239,-0.0941 +0.0000,0.0000,0.0000,-0.8864,-0.4516,-0.1019 +0.0000,0.0000,0.0000,-0.8710,-0.4788,-0.1097 +0.0000,0.0000,0.0000,-0.8548,-0.5055,-0.1175 +0.0000,0.0000,0.0000,-0.8377,-0.5316,-0.1253 +0.0000,0.0000,0.0000,-0.8197,-0.5571,-0.1331 +0.0000,0.0000,0.0000,-0.8009,-0.5819,-0.1409 +0.0000,0.0000,0.0000,-0.7814,-0.6061,-0.1487 +0.0000,0.0000,0.0000,-0.7610,-0.6296,-0.1564 +0.0000,0.0000,0.0000,-0.7399,-0.6523,-0.1642 +0.0000,0.0000,0.0000,-0.7181,-0.6744,-0.1719 +0.0000,0.0000,0.0000,-0.6956,-0.6956,-0.1797 +0.0000,0.0000,0.0000,-0.6724,-0.7161,-0.1874 +0.0000,0.0000,0.0000,-0.6486,-0.7357,-0.1951 +0.0000,0.0000,0.0000,-0.6242,-0.7545,-0.2028 +0.0000,0.0000,0.0000,-0.5992,-0.7725,-0.2105 +0.0000,0.0000,0.0000,-0.5736,-0.7895,-0.2181 +0.0000,0.0000,0.0000,-0.5476,-0.8057,-0.2258 +0.0000,0.0000,0.0000,-0.5210,-0.8210,-0.2334 +0.0000,0.0000,0.0000,-0.4940,-0.8354,-0.2411 +0.0000,0.0000,0.0000,-0.4666,-0.8488,-0.2487 +0.0000,0.0000,0.0000,-0.4388,-0.8612,-0.2563 +0.0000,0.0000,0.0000,-0.4107,-0.8728,-0.2639 +0.0000,0.0000,0.0000,-0.3822,-0.8833,-0.2714 +0.0000,0.0000,0.0000,-0.3535,-0.8929,-0.2790 +0.0000,0.0000,0.0000,-0.3245,-0.9014,-0.2865 +0.0000,0.0000,0.0000,-0.2954,-0.9090,-0.2940 +0.0000,0.0000,0.0000,-0.2660,-0.9156,-0.3015 +0.0000,0.0000,0.0000,-0.2365,-0.9212,-0.3090 +0.0000,0.0000,0.0000,-0.2069,-0.9258,-0.3165 +0.0000,0.0000,0.0000,-0.1773,-0.9293,-0.3239 +0.0000,0.0000,0.0000,-0.1476,-0.9319,-0.3313 +0.0000,0.0000,0.0000,-0.1179,-0.9335,-0.3387 +0.0000,0.0000,0.0000,-0.0883,-0.9340,-0.3461 +0.0000,0.0000,0.0000,-0.0587,-0.9336,-0.3535 +0.0000,0.0000,0.0000,-0.0293,-0.9322,-0.3608 +0.0000,0.0000,0.0000,0.0000,-0.9298,-0.3681 +0.0000,0.0000,0.0000,0.0291,-0.9264,-0.3754 +0.0000,0.0000,0.0000,0.0580,-0.9221,-0.3827 +0.0000,0.0000,0.0000,0.0867,-0.9168,-0.3899 +0.0000,0.0000,0.0000,0.1150,-0.9105,-0.3971 +0.0000,0.0000,0.0000,0.1431,-0.9033,-0.4043 +0.0000,0.0000,0.0000,0.1708,-0.8953,-0.4115 +0.0000,0.0000,0.0000,0.1981,-0.8863,-0.4187 +0.0000,0.0000,0.0000,0.2250,-0.8764,-0.4258 +0.0000,0.0000,0.0000,0.2515,-0.8657,-0.4329 +0.0000,0.0000,0.0000,0.2775,-0.8541,-0.4399 +0.0000,0.0000,0.0000,0.3030,-0.8417,-0.4470 +0.0000,0.0000,0.0000,0.3280,-0.8284,-0.4540 +0.0000,0.0000,0.0000,0.3524,-0.8144,-0.4610 +0.0000,0.0000,0.0000,0.3763,-0.7997,-0.4679 +0.0000,0.0000,0.0000,0.3995,-0.7841,-0.4749 +0.0000,0.0000,0.0000,0.4222,-0.7679,-0.4818 +0.0000,0.0000,0.0000,0.4441,-0.7510,-0.4886 +0.0000,0.0000,0.0000,0.4654,-0.7334,-0.4955 +0.0000,0.0000,0.0000,0.4860,-0.7152,-0.5023 +0.0000,0.0000,0.0000,0.5059,-0.6964,-0.5090 +0.0000,0.0000,0.0000,0.5251,-0.6769,-0.5158 +0.0000,0.0000,0.0000,0.5435,-0.6570,-0.5225 +0.0000,0.0000,0.0000,0.5611,-0.6365,-0.5292 +0.0000,0.0000,0.0000,0.5780,-0.6155,-0.5358 +0.0000,0.0000,0.0000,0.5940,-0.5940,-0.5424 +0.0000,0.0000,0.0000,0.6093,-0.5721,-0.5490 +0.0000,0.0000,0.0000,0.6237,-0.5499,-0.5556 +0.0000,0.0000,0.0000,0.6373,-0.5272,-0.5621 +0.0000,0.0000,0.0000,0.6500,-0.5042,-0.5686 +0.0000,0.0000,0.0000,0.6619,-0.4809,-0.5750 +0.0000,0.0000,0.0000,0.6729,-0.4573,-0.5814 +0.0000,0.0000,0.0000,0.6831,-0.4335,-0.5878 +0.0000,0.0000,0.0000,0.6924,-0.4095,-0.5941 +0.0000,0.0000,0.0000,0.7008,-0.3852,-0.6004 +0.0000,0.0000,0.0000,0.7083,-0.3609,-0.6067 +0.0000,0.0000,0.0000,0.7150,-0.3364,-0.6129 +0.0000,0.0000,0.0000,0.7207,-0.3119,-0.6191 +0.0000,0.0000,0.0000,0.7256,-0.2873,-0.6252 +0.0000,0.0000,0.0000,0.7296,-0.2627,-0.6314 +0.0000,0.0000,0.0000,0.7328,-0.2381,-0.6374 +0.0000,0.0000,0.0000,0.7351,-0.2136,-0.6435 +0.0000,0.0000,0.0000,0.7365,-0.1891,-0.6494 +0.0000,0.0000,0.0000,0.7371,-0.1648,-0.6554 +0.0000,0.0000,0.0000,0.7368,-0.1406,-0.6613 +0.0000,0.0000,0.0000,0.7357,-0.1165,-0.6672 +0.0000,0.0000,0.0000,0.7338,-0.0927,-0.6730 +0.0000,0.0000,0.0000,0.7311,-0.0691,-0.6788 +0.0000,0.0000,0.0000,0.7275,-0.0458,-0.6845 +0.0000,0.0000,0.0000,0.7232,-0.0227,-0.6903 +0.0000,0.0000,0.0000,0.7181,0.0000,-0.6959 diff --git a/scripts/trajectories/full-circle-with-up-and-down-4s-ccw.csv b/scripts/trajectories/full-circle-with-up-and-down-4s-ccw.csv new file mode 100644 index 0000000000..1e4a316720 --- /dev/null +++ b/scripts/trajectories/full-circle-with-up-and-down-4s-ccw.csv @@ -0,0 +1,800 @@ +0.9223,-0.0000,-0.3863,0.0119 +0.9223,-0.0000,-0.3863,0.0119 +0.9223,-0.0000,-0.3863,0.0119 +0.9223,-0.0000,-0.3863,0.0119 +0.9235,-0.0000,-0.3828,0.0240 +0.9235,-0.0000,-0.3828,0.0240 +0.9235,-0.0000,-0.3828,0.0240 +0.9235,-0.0000,-0.3828,0.0240 +0.9245,-0.0000,-0.3794,0.0363 +0.9245,-0.0000,-0.3794,0.0363 +0.9245,-0.0000,-0.3794,0.0363 +0.9245,-0.0000,-0.3794,0.0363 +0.9253,-0.0000,-0.3760,0.0486 +0.9253,-0.0000,-0.3760,0.0486 +0.9253,-0.0000,-0.3760,0.0486 +0.9253,-0.0000,-0.3760,0.0486 +0.9259,-0.0000,-0.3727,0.0611 +0.9259,-0.0000,-0.3727,0.0611 +0.9259,-0.0000,-0.3727,0.0611 +0.9259,-0.0000,-0.3727,0.0611 +0.9263,-0.0000,-0.3695,0.0737 +0.9263,-0.0000,-0.3695,0.0737 +0.9263,-0.0000,-0.3695,0.0737 +0.9263,-0.0000,-0.3695,0.0737 +0.9265,-0.0000,-0.3663,0.0865 +0.9265,-0.0000,-0.3663,0.0865 +0.9265,-0.0000,-0.3663,0.0865 +0.9265,-0.0000,-0.3663,0.0865 +0.9264,-0.0000,-0.3632,0.0993 +0.9264,-0.0000,-0.3632,0.0993 +0.9264,-0.0000,-0.3632,0.0993 +0.9264,-0.0000,-0.3632,0.0993 +0.9261,-0.0000,-0.3602,0.1122 +0.9261,-0.0000,-0.3602,0.1122 +0.9261,-0.0000,-0.3602,0.1122 +0.9261,-0.0000,-0.3602,0.1122 +0.9256,-0.0000,-0.3572,0.1252 +0.9256,-0.0000,-0.3572,0.1252 +0.9256,-0.0000,-0.3572,0.1252 +0.9256,-0.0000,-0.3572,0.1252 +0.9248,-0.0000,-0.3543,0.1383 +0.9248,-0.0000,-0.3543,0.1383 +0.9248,-0.0000,-0.3543,0.1383 +0.9248,-0.0000,-0.3543,0.1383 +0.9239,-0.0000,-0.3515,0.1515 +0.9239,-0.0000,-0.3515,0.1515 +0.9239,-0.0000,-0.3515,0.1515 +0.9239,-0.0000,-0.3515,0.1515 +0.9226,-0.0000,-0.3487,0.1648 +0.9226,-0.0000,-0.3487,0.1648 +0.9226,-0.0000,-0.3487,0.1648 +0.9226,-0.0000,-0.3487,0.1648 +0.9212,-0.0000,-0.3460,0.1781 +0.9212,-0.0000,-0.3460,0.1781 +0.9212,-0.0000,-0.3460,0.1781 +0.9212,-0.0000,-0.3460,0.1781 +0.9195,-0.0000,-0.3433,0.1914 +0.9195,-0.0000,-0.3433,0.1914 +0.9195,-0.0000,-0.3433,0.1914 +0.9195,-0.0000,-0.3433,0.1914 +0.9176,-0.0000,-0.3407,0.2049 +0.9176,-0.0000,-0.3407,0.2049 +0.9176,-0.0000,-0.3407,0.2049 +0.9176,-0.0000,-0.3407,0.2049 +0.9154,-0.0000,-0.3382,0.2183 +0.9154,-0.0000,-0.3382,0.2183 +0.9154,-0.0000,-0.3382,0.2183 +0.9154,-0.0000,-0.3382,0.2183 +0.9130,-0.0000,-0.3357,0.2319 +0.9130,-0.0000,-0.3357,0.2319 +0.9130,-0.0000,-0.3357,0.2319 +0.9130,-0.0000,-0.3357,0.2319 +0.9104,-0.0000,-0.3332,0.2454 +0.9104,-0.0000,-0.3332,0.2454 +0.9104,-0.0000,-0.3332,0.2454 +0.9104,-0.0000,-0.3332,0.2454 +0.9075,-0.0000,-0.3308,0.2590 +0.9075,-0.0000,-0.3308,0.2590 +0.9075,-0.0000,-0.3308,0.2590 +0.9075,-0.0000,-0.3308,0.2590 +0.9043,-0.0000,-0.3285,0.2726 +0.9043,-0.0000,-0.3285,0.2726 +0.9043,-0.0000,-0.3285,0.2726 +0.9043,-0.0000,-0.3285,0.2726 +0.9009,-0.0000,-0.3262,0.2862 +0.9009,-0.0000,-0.3262,0.2862 +0.9009,-0.0000,-0.3262,0.2862 +0.9009,-0.0000,-0.3262,0.2862 +0.8973,-0.0000,-0.3240,0.2998 +0.8973,-0.0000,-0.3240,0.2998 +0.8973,-0.0000,-0.3240,0.2998 +0.8973,-0.0000,-0.3240,0.2998 +0.8934,-0.0000,-0.3218,0.3134 +0.8934,-0.0000,-0.3218,0.3134 +0.8934,-0.0000,-0.3218,0.3134 +0.8934,-0.0000,-0.3218,0.3134 +0.8893,-0.0000,-0.3197,0.3271 +0.8893,-0.0000,-0.3197,0.3271 +0.8893,-0.0000,-0.3197,0.3271 +0.8893,-0.0000,-0.3197,0.3271 +0.8849,-0.0000,-0.3176,0.3407 +0.8849,-0.0000,-0.3176,0.3407 +0.8849,-0.0000,-0.3176,0.3407 +0.8849,-0.0000,-0.3176,0.3407 +0.8803,-0.0000,-0.3156,0.3543 +0.8803,-0.0000,-0.3156,0.3543 +0.8803,-0.0000,-0.3156,0.3543 +0.8803,-0.0000,-0.3156,0.3543 +0.8754,-0.0000,-0.3136,0.3678 +0.8754,-0.0000,-0.3136,0.3678 +0.8754,-0.0000,-0.3136,0.3678 +0.8754,-0.0000,-0.3136,0.3678 +0.8703,-0.0000,-0.3116,0.3814 +0.8703,-0.0000,-0.3116,0.3814 +0.8703,-0.0000,-0.3116,0.3814 +0.8703,-0.0000,-0.3116,0.3814 +0.8650,-0.0000,-0.3097,0.3949 +0.8650,-0.0000,-0.3097,0.3949 +0.8650,-0.0000,-0.3097,0.3949 +0.8650,-0.0000,-0.3097,0.3949 +0.8593,-0.0000,-0.3079,0.4083 +0.8593,-0.0000,-0.3079,0.4083 +0.8593,-0.0000,-0.3079,0.4083 +0.8593,-0.0000,-0.3079,0.4083 +0.8535,-0.0000,-0.3061,0.4217 +0.8535,-0.0000,-0.3061,0.4217 +0.8535,-0.0000,-0.3061,0.4217 +0.8535,-0.0000,-0.3061,0.4217 +0.8474,-0.0000,-0.3043,0.4351 +0.8474,-0.0000,-0.3043,0.4351 +0.8474,-0.0000,-0.3043,0.4351 +0.8474,-0.0000,-0.3043,0.4351 +0.8410,-0.0000,-0.3026,0.4484 +0.8410,-0.0000,-0.3026,0.4484 +0.8410,-0.0000,-0.3026,0.4484 +0.8410,-0.0000,-0.3026,0.4484 +0.8344,-0.0000,-0.3010,0.4617 +0.8344,-0.0000,-0.3010,0.4617 +0.8344,-0.0000,-0.3010,0.4617 +0.8344,-0.0000,-0.3010,0.4617 +0.8276,-0.0000,-0.2993,0.4748 +0.8276,-0.0000,-0.2993,0.4748 +0.8276,-0.0000,-0.2993,0.4748 +0.8276,-0.0000,-0.2993,0.4748 +0.8205,-0.0000,-0.2978,0.4879 +0.8205,-0.0000,-0.2978,0.4879 +0.8205,-0.0000,-0.2978,0.4879 +0.8205,-0.0000,-0.2978,0.4879 +0.8132,-0.0000,-0.2962,0.5010 +0.8132,-0.0000,-0.2962,0.5010 +0.8132,-0.0000,-0.2962,0.5010 +0.8132,-0.0000,-0.2962,0.5010 +0.8056,-0.0000,-0.2947,0.5139 +0.8056,-0.0000,-0.2947,0.5139 +0.8056,-0.0000,-0.2947,0.5139 +0.8056,-0.0000,-0.2947,0.5139 +0.7978,-0.0000,-0.2932,0.5267 +0.7978,-0.0000,-0.2932,0.5267 +0.7978,-0.0000,-0.2932,0.5267 +0.7978,-0.0000,-0.2932,0.5267 +0.7898,-0.0000,-0.2918,0.5395 +0.7898,-0.0000,-0.2918,0.5395 +0.7898,-0.0000,-0.2918,0.5395 +0.7898,-0.0000,-0.2918,0.5395 +0.7815,-0.0000,-0.2904,0.5521 +0.7815,-0.0000,-0.2904,0.5521 +0.7815,-0.0000,-0.2904,0.5521 +0.7815,-0.0000,-0.2904,0.5521 +0.7730,-0.0000,-0.2891,0.5647 +0.7730,-0.0000,-0.2891,0.5647 +0.7730,-0.0000,-0.2891,0.5647 +0.7730,-0.0000,-0.2891,0.5647 +0.7643,-0.0000,-0.2878,0.5771 +0.7643,-0.0000,-0.2878,0.5771 +0.7643,-0.0000,-0.2878,0.5771 +0.7643,-0.0000,-0.2878,0.5771 +0.7553,-0.0000,-0.2865,0.5894 +0.7553,-0.0000,-0.2865,0.5894 +0.7553,-0.0000,-0.2865,0.5894 +0.7553,-0.0000,-0.2865,0.5894 +0.7461,-0.0000,-0.2853,0.6016 +0.7461,-0.0000,-0.2853,0.6016 +0.7461,-0.0000,-0.2853,0.6016 +0.7461,-0.0000,-0.2853,0.6016 +0.7367,-0.0000,-0.2841,0.6136 +0.7367,-0.0000,-0.2841,0.6136 +0.7367,-0.0000,-0.2841,0.6136 +0.7367,-0.0000,-0.2841,0.6136 +0.7271,-0.0000,-0.2830,0.6255 +0.7271,-0.0000,-0.2830,0.6255 +0.7271,-0.0000,-0.2830,0.6255 +0.7271,-0.0000,-0.2830,0.6255 +0.7172,-0.0000,-0.2819,0.6373 +0.7172,-0.0000,-0.2819,0.6373 +0.7172,-0.0000,-0.2819,0.6373 +0.7172,-0.0000,-0.2819,0.6373 +0.7071,-0.0000,-0.2808,0.6490 +0.7071,-0.0000,-0.2808,0.6490 +0.7071,-0.0000,-0.2808,0.6490 +0.7071,-0.0000,-0.2808,0.6490 +0.6968,-0.0000,-0.2798,0.6604 +0.6968,-0.0000,-0.2798,0.6604 +0.6968,-0.0000,-0.2798,0.6604 +0.6968,-0.0000,-0.2798,0.6604 +0.6863,-0.0000,-0.2788,0.6718 +0.6863,-0.0000,-0.2788,0.6718 +0.6863,-0.0000,-0.2788,0.6718 +0.6863,-0.0000,-0.2788,0.6718 +0.6756,-0.0000,-0.2779,0.6829 +0.6756,-0.0000,-0.2779,0.6829 +0.6756,-0.0000,-0.2779,0.6829 +0.6756,-0.0000,-0.2779,0.6829 +0.6646,-0.0000,-0.2769,0.6940 +0.6646,-0.0000,-0.2769,0.6940 +0.6646,-0.0000,-0.2769,0.6940 +0.6646,-0.0000,-0.2769,0.6940 +0.6535,-0.0000,-0.2761,0.7048 +0.6535,-0.0000,-0.2761,0.7048 +0.6535,-0.0000,-0.2761,0.7048 +0.6535,-0.0000,-0.2761,0.7048 +0.6422,-0.0000,-0.2752,0.7155 +0.6422,-0.0000,-0.2752,0.7155 +0.6422,-0.0000,-0.2752,0.7155 +0.6422,-0.0000,-0.2752,0.7155 +0.6306,-0.0000,-0.2744,0.7260 +0.6306,-0.0000,-0.2744,0.7260 +0.6306,-0.0000,-0.2744,0.7260 +0.6306,-0.0000,-0.2744,0.7260 +0.6189,-0.0000,-0.2737,0.7363 +0.6189,-0.0000,-0.2737,0.7363 +0.6189,-0.0000,-0.2737,0.7363 +0.6189,-0.0000,-0.2737,0.7363 +0.6069,-0.0000,-0.2730,0.7464 +0.6069,-0.0000,-0.2730,0.7464 +0.6069,-0.0000,-0.2730,0.7464 +0.6069,-0.0000,-0.2730,0.7464 +0.5948,-0.0000,-0.2723,0.7563 +0.5948,-0.0000,-0.2723,0.7563 +0.5948,-0.0000,-0.2723,0.7563 +0.5948,-0.0000,-0.2723,0.7563 +0.5825,-0.0000,-0.2716,0.7661 +0.5825,-0.0000,-0.2716,0.7661 +0.5825,-0.0000,-0.2716,0.7661 +0.5825,-0.0000,-0.2716,0.7661 +0.5700,-0.0000,-0.2710,0.7756 +0.5700,-0.0000,-0.2710,0.7756 +0.5700,-0.0000,-0.2710,0.7756 +0.5700,-0.0000,-0.2710,0.7756 +0.5574,-0.0000,-0.2705,0.7850 +0.5574,-0.0000,-0.2705,0.7850 +0.5574,-0.0000,-0.2705,0.7850 +0.5574,-0.0000,-0.2705,0.7850 +0.5445,-0.0000,-0.2700,0.7941 +0.5445,-0.0000,-0.2700,0.7941 +0.5445,-0.0000,-0.2700,0.7941 +0.5445,-0.0000,-0.2700,0.7941 +0.5315,-0.0000,-0.2695,0.8030 +0.5315,-0.0000,-0.2695,0.8030 +0.5315,-0.0000,-0.2695,0.8030 +0.5315,-0.0000,-0.2695,0.8030 +0.5184,-0.0000,-0.2691,0.8117 +0.5184,-0.0000,-0.2691,0.8117 +0.5184,-0.0000,-0.2691,0.8117 +0.5184,-0.0000,-0.2691,0.8117 +0.5050,-0.0000,-0.2687,0.8202 +0.5050,-0.0000,-0.2687,0.8202 +0.5050,-0.0000,-0.2687,0.8202 +0.5050,-0.0000,-0.2687,0.8202 +0.4915,-0.0000,-0.2684,0.8285 +0.4915,-0.0000,-0.2684,0.8285 +0.4915,-0.0000,-0.2684,0.8285 +0.4915,-0.0000,-0.2684,0.8285 +0.4779,-0.0000,-0.2682,0.8365 +0.4779,-0.0000,-0.2682,0.8365 +0.4779,-0.0000,-0.2682,0.8365 +0.4779,-0.0000,-0.2682,0.8365 +0.4640,-0.0000,-0.2680,0.8443 +0.4640,-0.0000,-0.2680,0.8443 +0.4640,-0.0000,-0.2680,0.8443 +0.4640,-0.0000,-0.2680,0.8443 +0.4501,-0.0000,-0.2678,0.8519 +0.4501,-0.0000,-0.2678,0.8519 +0.4501,-0.0000,-0.2678,0.8519 +0.4501,-0.0000,-0.2678,0.8519 +0.4360,-0.0000,-0.2677,0.8592 +0.4360,-0.0000,-0.2677,0.8592 +0.4360,-0.0000,-0.2677,0.8592 +0.4360,-0.0000,-0.2677,0.8592 +0.4218,-0.0000,-0.2677,0.8663 +0.4218,-0.0000,-0.2677,0.8663 +0.4218,-0.0000,-0.2677,0.8663 +0.4218,-0.0000,-0.2677,0.8663 +0.4074,-0.0000,-0.2677,0.8731 +0.4074,-0.0000,-0.2677,0.8731 +0.4074,-0.0000,-0.2677,0.8731 +0.4074,-0.0000,-0.2677,0.8731 +0.3929,-0.0000,-0.2678,0.8797 +0.3929,-0.0000,-0.2678,0.8797 +0.3929,-0.0000,-0.2678,0.8797 +0.3929,-0.0000,-0.2678,0.8797 +0.3783,-0.0000,-0.2680,0.8860 +0.3783,-0.0000,-0.2680,0.8860 +0.3783,-0.0000,-0.2680,0.8860 +0.3783,-0.0000,-0.2680,0.8860 +0.3635,-0.0000,-0.2683,0.8921 +0.3635,-0.0000,-0.2683,0.8921 +0.3635,-0.0000,-0.2683,0.8921 +0.3635,-0.0000,-0.2683,0.8921 +0.3487,-0.0000,-0.2687,0.8979 +0.3487,-0.0000,-0.2687,0.8979 +0.3487,-0.0000,-0.2687,0.8979 +0.3487,-0.0000,-0.2687,0.8979 +0.3337,-0.0000,-0.2692,0.9034 +0.3337,-0.0000,-0.2692,0.9034 +0.3337,-0.0000,-0.2692,0.9034 +0.3337,-0.0000,-0.2692,0.9034 +0.3186,-0.0000,-0.2698,0.9087 +0.3186,-0.0000,-0.2698,0.9087 +0.3186,-0.0000,-0.2698,0.9087 +0.3186,-0.0000,-0.2698,0.9087 +0.3034,-0.0000,-0.2705,0.9136 +0.3034,-0.0000,-0.2705,0.9136 +0.3034,-0.0000,-0.2705,0.9136 +0.3034,-0.0000,-0.2705,0.9136 +0.2882,-0.0000,-0.2714,0.9183 +0.2882,-0.0000,-0.2714,0.9183 +0.2882,-0.0000,-0.2714,0.9183 +0.2882,-0.0000,-0.2714,0.9183 +0.2728,-0.0000,-0.2725,0.9227 +0.2728,-0.0000,-0.2725,0.9227 +0.2728,-0.0000,-0.2725,0.9227 +0.2728,-0.0000,-0.2725,0.9227 +0.2573,-0.0000,-0.2738,0.9267 +0.2573,-0.0000,-0.2738,0.9267 +0.2573,-0.0000,-0.2738,0.9267 +0.2573,-0.0000,-0.2738,0.9267 +0.2418,-0.0000,-0.2753,0.9305 +0.2418,-0.0000,-0.2753,0.9305 +0.2418,-0.0000,-0.2753,0.9305 +0.2418,-0.0000,-0.2753,0.9305 +0.2262,-0.0000,-0.2771,0.9339 +0.2262,-0.0000,-0.2771,0.9339 +0.2262,-0.0000,-0.2771,0.9339 +0.2262,-0.0000,-0.2771,0.9339 +0.2105,-0.0000,-0.2792,0.9369 +0.2105,-0.0000,-0.2792,0.9369 +0.2105,-0.0000,-0.2792,0.9369 +0.2105,-0.0000,-0.2792,0.9369 +0.1947,-0.0000,-0.2818,0.9395 +0.1947,-0.0000,-0.2818,0.9395 +0.1947,-0.0000,-0.2818,0.9395 +0.1947,-0.0000,-0.2818,0.9395 +0.1789,-0.0000,-0.2848,0.9417 +0.1789,-0.0000,-0.2848,0.9417 +0.1789,-0.0000,-0.2848,0.9417 +0.1789,-0.0000,-0.2848,0.9417 +0.1630,-0.0000,-0.2886,0.9435 +0.1630,-0.0000,-0.2886,0.9435 +0.1630,-0.0000,-0.2886,0.9435 +0.1630,-0.0000,-0.2886,0.9435 +0.1471,-0.0000,-0.2933,0.9446 +0.1471,-0.0000,-0.2933,0.9446 +0.1471,-0.0000,-0.2933,0.9446 +0.1471,-0.0000,-0.2933,0.9446 +0.1312,-0.0000,-0.2991,0.9452 +0.1312,-0.0000,-0.2991,0.9452 +0.1312,-0.0000,-0.2991,0.9452 +0.1312,-0.0000,-0.2991,0.9452 +0.1152,-0.0000,-0.3067,0.9448 +0.1152,-0.0000,-0.3067,0.9448 +0.1152,-0.0000,-0.3067,0.9448 +0.1152,-0.0000,-0.3067,0.9448 +0.0991,-0.0000,-0.3167,0.9433 +0.0991,-0.0000,-0.3167,0.9433 +0.0991,-0.0000,-0.3167,0.9433 +0.0991,-0.0000,-0.3167,0.9433 +0.0831,-0.0000,-0.3307,0.9401 +0.0831,-0.0000,-0.3307,0.9401 +0.0831,-0.0000,-0.3307,0.9401 +0.0831,-0.0000,-0.3307,0.9401 +0.0670,-0.0000,-0.3514,0.9338 +0.0670,-0.0000,-0.3514,0.9338 +0.0670,-0.0000,-0.3514,0.9338 +0.0670,-0.0000,-0.3514,0.9338 +0.0510,-0.0000,-0.3848,0.9216 +0.0510,-0.0000,-0.3848,0.9216 +0.0510,-0.0000,-0.3848,0.9216 +0.0510,-0.0000,-0.3848,0.9216 +0.0351,-0.0000,-0.4473,0.8937 +0.0351,-0.0000,-0.4473,0.8937 +0.0351,-0.0000,-0.4473,0.8937 +0.0351,-0.0000,-0.4473,0.8937 +0.0196,-0.0000,-0.6000,0.7997 +0.0196,-0.0000,-0.6000,0.7997 +0.0196,-0.0000,-0.6000,0.7997 +0.0196,-0.0000,-0.6000,0.7997 +0.0079,-0.0000,-1.0000,-0.0001 +0.0079,-0.0000,-1.0000,-0.0001 +0.0079,-0.0000,-1.0000,-0.0001 +0.0079,-0.0000,-1.0000,-0.0001 +0.0162,-0.0000,-0.2425,-0.9700 +0.0162,-0.0000,-0.2425,-0.9700 +0.0162,-0.0000,-0.2425,-0.9700 +0.0162,-0.0000,-0.2425,-0.9700 +0.0314,-0.0000,0.0000,-0.9995 +0.0314,-0.0000,0.0000,-0.9995 +0.0314,-0.0000,0.0000,-0.9995 +0.0314,-0.0000,0.0000,-0.9995 +0.0473,-0.0000,0.0831,-0.9954 +0.0473,-0.0000,0.0831,-0.9954 +0.0473,-0.0000,0.0831,-0.9954 +0.0473,-0.0000,0.0831,-0.9954 +0.0633,-0.0000,0.1241,-0.9902 +0.0633,-0.0000,0.1241,-0.9902 +0.0633,-0.0000,0.1241,-0.9902 +0.0633,-0.0000,0.1241,-0.9902 +0.0793,-0.0000,0.1485,-0.9857 +0.0793,-0.0000,0.1485,-0.9857 +0.0793,-0.0000,0.1485,-0.9857 +0.0793,-0.0000,0.1485,-0.9857 +0.0954,-0.0000,0.1646,-0.9817 +0.0954,-0.0000,0.1646,-0.9817 +0.0954,-0.0000,0.1646,-0.9817 +0.0954,-0.0000,0.1646,-0.9817 +0.1114,-0.0000,0.1762,-0.9780 +0.1114,-0.0000,0.1762,-0.9780 +0.1114,-0.0000,0.1762,-0.9780 +0.1114,-0.0000,0.1762,-0.9780 +0.1275,-0.0000,0.1848,-0.9745 +0.1275,-0.0000,0.1848,-0.9745 +0.1275,-0.0000,0.1848,-0.9745 +0.1275,-0.0000,0.1848,-0.9745 +0.1435,-0.0000,0.1915,-0.9709 +0.1435,-0.0000,0.1915,-0.9709 +0.1435,-0.0000,0.1915,-0.9709 +0.1435,-0.0000,0.1915,-0.9709 +0.1594,-0.0000,0.1970,-0.9674 +0.1594,-0.0000,0.1970,-0.9674 +0.1594,-0.0000,0.1970,-0.9674 +0.1594,-0.0000,0.1970,-0.9674 +0.1753,-0.0000,0.2014,-0.9637 +0.1753,-0.0000,0.2014,-0.9637 +0.1753,-0.0000,0.2014,-0.9637 +0.1753,-0.0000,0.2014,-0.9637 +0.1912,-0.0000,0.2052,-0.9599 +0.1912,-0.0000,0.2052,-0.9599 +0.1912,-0.0000,0.2052,-0.9599 +0.1912,-0.0000,0.2052,-0.9599 +0.2070,-0.0000,0.2085,-0.9559 +0.2070,-0.0000,0.2085,-0.9559 +0.2070,-0.0000,0.2085,-0.9559 +0.2070,-0.0000,0.2085,-0.9559 +0.2227,-0.0000,0.2113,-0.9517 +0.2227,-0.0000,0.2113,-0.9517 +0.2227,-0.0000,0.2113,-0.9517 +0.2227,-0.0000,0.2113,-0.9517 +0.2384,-0.0000,0.2138,-0.9473 +0.2384,-0.0000,0.2138,-0.9473 +0.2384,-0.0000,0.2138,-0.9473 +0.2384,-0.0000,0.2138,-0.9473 +0.2540,-0.0000,0.2161,-0.9428 +0.2540,-0.0000,0.2161,-0.9428 +0.2540,-0.0000,0.2161,-0.9428 +0.2540,-0.0000,0.2161,-0.9428 +0.2695,-0.0000,0.2181,-0.9380 +0.2695,-0.0000,0.2181,-0.9380 +0.2695,-0.0000,0.2181,-0.9380 +0.2695,-0.0000,0.2181,-0.9380 +0.2849,-0.0000,0.2200,-0.9330 +0.2849,-0.0000,0.2200,-0.9330 +0.2849,-0.0000,0.2200,-0.9330 +0.2849,-0.0000,0.2200,-0.9330 +0.3002,-0.0000,0.2217,-0.9277 +0.3002,-0.0000,0.2217,-0.9277 +0.3002,-0.0000,0.2217,-0.9277 +0.3002,-0.0000,0.2217,-0.9277 +0.3155,-0.0000,0.2233,-0.9223 +0.3155,-0.0000,0.2233,-0.9223 +0.3155,-0.0000,0.2233,-0.9223 +0.3155,-0.0000,0.2233,-0.9223 +0.3306,-0.0000,0.2248,-0.9166 +0.3306,-0.0000,0.2248,-0.9166 +0.3306,-0.0000,0.2248,-0.9166 +0.3306,-0.0000,0.2248,-0.9166 +0.3457,-0.0000,0.2263,-0.9107 +0.3457,-0.0000,0.2263,-0.9107 +0.3457,-0.0000,0.2263,-0.9107 +0.3457,-0.0000,0.2263,-0.9107 +0.3606,-0.0000,0.2277,-0.9045 +0.3606,-0.0000,0.2277,-0.9045 +0.3606,-0.0000,0.2277,-0.9045 +0.3606,-0.0000,0.2277,-0.9045 +0.3754,-0.0000,0.2290,-0.8981 +0.3754,-0.0000,0.2290,-0.8981 +0.3754,-0.0000,0.2290,-0.8981 +0.3754,-0.0000,0.2290,-0.8981 +0.3901,-0.0000,0.2303,-0.8915 +0.3901,-0.0000,0.2303,-0.8915 +0.3901,-0.0000,0.2303,-0.8915 +0.3901,-0.0000,0.2303,-0.8915 +0.4047,-0.0000,0.2315,-0.8847 +0.4047,-0.0000,0.2315,-0.8847 +0.4047,-0.0000,0.2315,-0.8847 +0.4047,-0.0000,0.2315,-0.8847 +0.4192,-0.0000,0.2327,-0.8776 +0.4192,-0.0000,0.2327,-0.8776 +0.4192,-0.0000,0.2327,-0.8776 +0.4192,-0.0000,0.2327,-0.8776 +0.4335,-0.0000,0.2339,-0.8703 +0.4335,-0.0000,0.2339,-0.8703 +0.4335,-0.0000,0.2339,-0.8703 +0.4335,-0.0000,0.2339,-0.8703 +0.4477,-0.0000,0.2351,-0.8627 +0.4477,-0.0000,0.2351,-0.8627 +0.4477,-0.0000,0.2351,-0.8627 +0.4477,-0.0000,0.2351,-0.8627 +0.4617,-0.0000,0.2362,-0.8550 +0.4617,-0.0000,0.2362,-0.8550 +0.4617,-0.0000,0.2362,-0.8550 +0.4617,-0.0000,0.2362,-0.8550 +0.4756,-0.0000,0.2374,-0.8470 +0.4756,-0.0000,0.2374,-0.8470 +0.4756,-0.0000,0.2374,-0.8470 +0.4756,-0.0000,0.2374,-0.8470 +0.4894,-0.0000,0.2385,-0.8388 +0.4894,-0.0000,0.2385,-0.8388 +0.4894,-0.0000,0.2385,-0.8388 +0.4894,-0.0000,0.2385,-0.8388 +0.5030,-0.0000,0.2396,-0.8304 +0.5030,-0.0000,0.2396,-0.8304 +0.5030,-0.0000,0.2396,-0.8304 +0.5030,-0.0000,0.2396,-0.8304 +0.5164,-0.0000,0.2408,-0.8218 +0.5164,-0.0000,0.2408,-0.8218 +0.5164,-0.0000,0.2408,-0.8218 +0.5164,-0.0000,0.2408,-0.8218 +0.5297,-0.0000,0.2419,-0.8130 +0.5297,-0.0000,0.2419,-0.8130 +0.5297,-0.0000,0.2419,-0.8130 +0.5297,-0.0000,0.2419,-0.8130 +0.5428,-0.0000,0.2431,-0.8039 +0.5428,-0.0000,0.2431,-0.8039 +0.5428,-0.0000,0.2431,-0.8039 +0.5428,-0.0000,0.2431,-0.8039 +0.5558,-0.0000,0.2442,-0.7947 +0.5558,-0.0000,0.2442,-0.7947 +0.5558,-0.0000,0.2442,-0.7947 +0.5558,-0.0000,0.2442,-0.7947 +0.5685,-0.0000,0.2454,-0.7852 +0.5685,-0.0000,0.2454,-0.7852 +0.5685,-0.0000,0.2454,-0.7852 +0.5685,-0.0000,0.2454,-0.7852 +0.5811,-0.0000,0.2465,-0.7756 +0.5811,-0.0000,0.2465,-0.7756 +0.5811,-0.0000,0.2465,-0.7756 +0.5811,-0.0000,0.2465,-0.7756 +0.5936,-0.0000,0.2477,-0.7657 +0.5936,-0.0000,0.2477,-0.7657 +0.5936,-0.0000,0.2477,-0.7657 +0.5936,-0.0000,0.2477,-0.7657 +0.6058,-0.0000,0.2489,-0.7557 +0.6058,-0.0000,0.2489,-0.7557 +0.6058,-0.0000,0.2489,-0.7557 +0.6058,-0.0000,0.2489,-0.7557 +0.6179,-0.0000,0.2501,-0.7455 +0.6179,-0.0000,0.2501,-0.7455 +0.6179,-0.0000,0.2501,-0.7455 +0.6179,-0.0000,0.2501,-0.7455 +0.6297,-0.0000,0.2513,-0.7351 +0.6297,-0.0000,0.2513,-0.7351 +0.6297,-0.0000,0.2513,-0.7351 +0.6297,-0.0000,0.2513,-0.7351 +0.6414,-0.0000,0.2525,-0.7245 +0.6414,-0.0000,0.2525,-0.7245 +0.6414,-0.0000,0.2525,-0.7245 +0.6414,-0.0000,0.2525,-0.7245 +0.6528,-0.0000,0.2538,-0.7137 +0.6528,-0.0000,0.2538,-0.7137 +0.6528,-0.0000,0.2538,-0.7137 +0.6528,-0.0000,0.2538,-0.7137 +0.6641,-0.0000,0.2550,-0.7028 +0.6641,-0.0000,0.2550,-0.7028 +0.6641,-0.0000,0.2550,-0.7028 +0.6641,-0.0000,0.2550,-0.7028 +0.6752,-0.0000,0.2563,-0.6917 +0.6752,-0.0000,0.2563,-0.6917 +0.6752,-0.0000,0.2563,-0.6917 +0.6752,-0.0000,0.2563,-0.6917 +0.6860,-0.0000,0.2576,-0.6804 +0.6860,-0.0000,0.2576,-0.6804 +0.6860,-0.0000,0.2576,-0.6804 +0.6860,-0.0000,0.2576,-0.6804 +0.6967,-0.0000,0.2590,-0.6690 +0.6967,-0.0000,0.2590,-0.6690 +0.6967,-0.0000,0.2590,-0.6690 +0.6967,-0.0000,0.2590,-0.6690 +0.7071,-0.0000,0.2603,-0.6575 +0.7071,-0.0000,0.2603,-0.6575 +0.7071,-0.0000,0.2603,-0.6575 +0.7071,-0.0000,0.2603,-0.6575 +0.7173,-0.0000,0.2617,-0.6457 +0.7173,-0.0000,0.2617,-0.6457 +0.7173,-0.0000,0.2617,-0.6457 +0.7173,-0.0000,0.2617,-0.6457 +0.7273,-0.0000,0.2631,-0.6339 +0.7273,-0.0000,0.2631,-0.6339 +0.7273,-0.0000,0.2631,-0.6339 +0.7273,-0.0000,0.2631,-0.6339 +0.7371,-0.0000,0.2645,-0.6219 +0.7371,-0.0000,0.2645,-0.6219 +0.7371,-0.0000,0.2645,-0.6219 +0.7371,-0.0000,0.2645,-0.6219 +0.7467,-0.0000,0.2659,-0.6097 +0.7467,-0.0000,0.2659,-0.6097 +0.7467,-0.0000,0.2659,-0.6097 +0.7467,-0.0000,0.2659,-0.6097 +0.7560,-0.0000,0.2674,-0.5974 +0.7560,-0.0000,0.2674,-0.5974 +0.7560,-0.0000,0.2674,-0.5974 +0.7560,-0.0000,0.2674,-0.5974 +0.7651,-0.0000,0.2689,-0.5851 +0.7651,-0.0000,0.2689,-0.5851 +0.7651,-0.0000,0.2689,-0.5851 +0.7651,-0.0000,0.2689,-0.5851 +0.7740,-0.0000,0.2705,-0.5725 +0.7740,-0.0000,0.2705,-0.5725 +0.7740,-0.0000,0.2705,-0.5725 +0.7740,-0.0000,0.2705,-0.5725 +0.7826,-0.0000,0.2720,-0.5599 +0.7826,-0.0000,0.2720,-0.5599 +0.7826,-0.0000,0.2720,-0.5599 +0.7826,-0.0000,0.2720,-0.5599 +0.7910,-0.0000,0.2736,-0.5472 +0.7910,-0.0000,0.2736,-0.5472 +0.7910,-0.0000,0.2736,-0.5472 +0.7910,-0.0000,0.2736,-0.5472 +0.7992,-0.0000,0.2752,-0.5343 +0.7992,-0.0000,0.2752,-0.5343 +0.7992,-0.0000,0.2752,-0.5343 +0.7992,-0.0000,0.2752,-0.5343 +0.8072,-0.0000,0.2769,-0.5214 +0.8072,-0.0000,0.2769,-0.5214 +0.8072,-0.0000,0.2769,-0.5214 +0.8072,-0.0000,0.2769,-0.5214 +0.8149,-0.0000,0.2786,-0.5083 +0.8149,-0.0000,0.2786,-0.5083 +0.8149,-0.0000,0.2786,-0.5083 +0.8149,-0.0000,0.2786,-0.5083 +0.8223,-0.0000,0.2803,-0.4952 +0.8223,-0.0000,0.2803,-0.4952 +0.8223,-0.0000,0.2803,-0.4952 +0.8223,-0.0000,0.2803,-0.4952 +0.8295,-0.0000,0.2820,-0.4820 +0.8295,-0.0000,0.2820,-0.4820 +0.8295,-0.0000,0.2820,-0.4820 +0.8295,-0.0000,0.2820,-0.4820 +0.8365,-0.0000,0.2838,-0.4687 +0.8365,-0.0000,0.2838,-0.4687 +0.8365,-0.0000,0.2838,-0.4687 +0.8365,-0.0000,0.2838,-0.4687 +0.8433,-0.0000,0.2857,-0.4553 +0.8433,-0.0000,0.2857,-0.4553 +0.8433,-0.0000,0.2857,-0.4553 +0.8433,-0.0000,0.2857,-0.4553 +0.8497,-0.0000,0.2875,-0.4419 +0.8497,-0.0000,0.2875,-0.4419 +0.8497,-0.0000,0.2875,-0.4419 +0.8497,-0.0000,0.2875,-0.4419 +0.8560,-0.0000,0.2894,-0.4284 +0.8560,-0.0000,0.2894,-0.4284 +0.8560,-0.0000,0.2894,-0.4284 +0.8560,-0.0000,0.2894,-0.4284 +0.8620,-0.0000,0.2913,-0.4148 +0.8620,-0.0000,0.2913,-0.4148 +0.8620,-0.0000,0.2913,-0.4148 +0.8620,-0.0000,0.2913,-0.4148 +0.8677,-0.0000,0.2933,-0.4012 +0.8677,-0.0000,0.2933,-0.4012 +0.8677,-0.0000,0.2933,-0.4012 +0.8677,-0.0000,0.2933,-0.4012 +0.8732,-0.0000,0.2953,-0.3876 +0.8732,-0.0000,0.2953,-0.3876 +0.8732,-0.0000,0.2953,-0.3876 +0.8732,-0.0000,0.2953,-0.3876 +0.8785,-0.0000,0.2974,-0.3739 +0.8785,-0.0000,0.2974,-0.3739 +0.8785,-0.0000,0.2974,-0.3739 +0.8785,-0.0000,0.2974,-0.3739 +0.8835,-0.0000,0.2995,-0.3602 +0.8835,-0.0000,0.2995,-0.3602 +0.8835,-0.0000,0.2995,-0.3602 +0.8835,-0.0000,0.2995,-0.3602 +0.8883,-0.0000,0.3016,-0.3465 +0.8883,-0.0000,0.3016,-0.3465 +0.8883,-0.0000,0.3016,-0.3465 +0.8883,-0.0000,0.3016,-0.3465 +0.8928,-0.0000,0.3038,-0.3327 +0.8928,-0.0000,0.3038,-0.3327 +0.8928,-0.0000,0.3038,-0.3327 +0.8928,-0.0000,0.3038,-0.3327 +0.8970,-0.0000,0.3060,-0.3189 +0.8970,-0.0000,0.3060,-0.3189 +0.8970,-0.0000,0.3060,-0.3189 +0.8970,-0.0000,0.3060,-0.3189 +0.9010,-0.0000,0.3083,-0.3051 +0.9010,-0.0000,0.3083,-0.3051 +0.9010,-0.0000,0.3083,-0.3051 +0.9010,-0.0000,0.3083,-0.3051 +0.9048,-0.0000,0.3106,-0.2913 +0.9048,-0.0000,0.3106,-0.2913 +0.9048,-0.0000,0.3106,-0.2913 +0.9048,-0.0000,0.3106,-0.2913 +0.9083,-0.0000,0.3130,-0.2776 +0.9083,-0.0000,0.3130,-0.2776 +0.9083,-0.0000,0.3130,-0.2776 +0.9083,-0.0000,0.3130,-0.2776 +0.9116,-0.0000,0.3154,-0.2638 +0.9116,-0.0000,0.3154,-0.2638 +0.9116,-0.0000,0.3154,-0.2638 +0.9116,-0.0000,0.3154,-0.2638 +0.9146,-0.0000,0.3179,-0.2500 +0.9146,-0.0000,0.3179,-0.2500 +0.9146,-0.0000,0.3179,-0.2500 +0.9146,-0.0000,0.3179,-0.2500 +0.9174,-0.0000,0.3204,-0.2363 +0.9174,-0.0000,0.3204,-0.2363 +0.9174,-0.0000,0.3204,-0.2363 +0.9174,-0.0000,0.3204,-0.2363 +0.9199,-0.0000,0.3229,-0.2226 +0.9199,-0.0000,0.3229,-0.2226 +0.9199,-0.0000,0.3229,-0.2226 +0.9199,-0.0000,0.3229,-0.2226 +0.9222,-0.0000,0.3256,-0.2089 +0.9222,-0.0000,0.3256,-0.2089 +0.9222,-0.0000,0.3256,-0.2089 +0.9222,-0.0000,0.3256,-0.2089 +0.9242,-0.0000,0.3282,-0.1952 +0.9242,-0.0000,0.3282,-0.1952 +0.9242,-0.0000,0.3282,-0.1952 +0.9242,-0.0000,0.3282,-0.1952 +0.9260,-0.0000,0.3309,-0.1817 +0.9260,-0.0000,0.3309,-0.1817 +0.9260,-0.0000,0.3309,-0.1817 +0.9260,-0.0000,0.3309,-0.1817 +0.9276,-0.0000,0.3337,-0.1681 +0.9276,-0.0000,0.3337,-0.1681 +0.9276,-0.0000,0.3337,-0.1681 +0.9276,-0.0000,0.3337,-0.1681 +0.9289,-0.0000,0.3366,-0.1546 +0.9289,-0.0000,0.3366,-0.1546 +0.9289,-0.0000,0.3366,-0.1546 +0.9289,-0.0000,0.3366,-0.1546 +0.9300,-0.0000,0.3395,-0.1412 +0.9300,-0.0000,0.3395,-0.1412 +0.9300,-0.0000,0.3395,-0.1412 +0.9300,-0.0000,0.3395,-0.1412 +0.9308,-0.0000,0.3424,-0.1279 +0.9308,-0.0000,0.3424,-0.1279 +0.9308,-0.0000,0.3424,-0.1279 +0.9308,-0.0000,0.3424,-0.1279 +0.9314,-0.0000,0.3454,-0.1146 +0.9314,-0.0000,0.3454,-0.1146 +0.9314,-0.0000,0.3454,-0.1146 +0.9314,-0.0000,0.3454,-0.1146 +0.9318,-0.0000,0.3485,-0.1015 +0.9318,-0.0000,0.3485,-0.1015 +0.9318,-0.0000,0.3485,-0.1015 +0.9318,-0.0000,0.3485,-0.1015 +0.9320,-0.0000,0.3516,-0.0884 +0.9320,-0.0000,0.3516,-0.0884 +0.9320,-0.0000,0.3516,-0.0884 +0.9320,-0.0000,0.3516,-0.0884 +0.9319,-0.0000,0.3548,-0.0754 +0.9319,-0.0000,0.3548,-0.0754 +0.9319,-0.0000,0.3548,-0.0754 +0.9319,-0.0000,0.3548,-0.0754 +0.9316,-0.0000,0.3581,-0.0625 +0.9316,-0.0000,0.3581,-0.0625 +0.9316,-0.0000,0.3581,-0.0625 +0.9316,-0.0000,0.3581,-0.0625 +0.9311,-0.0000,0.3614,-0.0498 +0.9311,-0.0000,0.3614,-0.0498 +0.9311,-0.0000,0.3614,-0.0498 +0.9311,-0.0000,0.3614,-0.0498 +0.9303,-0.0000,0.3648,-0.0371 +0.9303,-0.0000,0.3648,-0.0371 +0.9303,-0.0000,0.3648,-0.0371 +0.9303,-0.0000,0.3648,-0.0371 +0.9294,-0.0000,0.3683,-0.0246 +0.9294,-0.0000,0.3683,-0.0246 +0.9294,-0.0000,0.3683,-0.0246 +0.9294,-0.0000,0.3683,-0.0246 +0.9282,-0.0000,0.3718,-0.0122 +0.9282,-0.0000,0.3718,-0.0122 +0.9282,-0.0000,0.3718,-0.0122 +0.9282,-0.0000,0.3718,-0.0122 +0.9269,0.0000,0.3754,0.0000 +0.9269,0.0000,0.3754,0.0000 +0.9269,0.0000,0.3754,0.0000 +0.9269,0.0000,0.3754,0.0000 diff --git a/scripts/trajectories/full-circle-with-up-and-down-4s-fixed-pos-offset-Vector3.csv b/scripts/trajectories/full-circle-with-up-and-down-4s-fixed-pos-offset-Vector3.csv new file mode 100644 index 0000000000..c858131d94 --- /dev/null +++ b/scripts/trajectories/full-circle-with-up-and-down-4s-fixed-pos-offset-Vector3.csv @@ -0,0 +1,200 @@ +10.0000,10.0000,10.0000,10.7012,9.9780,9.2874 +10.0000,10.0000,10.0000,10.7057,9.9556,9.2929 +10.0000,10.0000,10.0000,10.7095,9.9329,9.2985 +10.0000,10.0000,10.0000,10.7125,9.9100,9.3041 +10.0000,10.0000,10.0000,10.7147,9.8868,9.3097 +10.0000,10.0000,10.0000,10.7161,9.8634,9.3155 +10.0000,10.0000,10.0000,10.7166,9.8398,9.3212 +10.0000,10.0000,10.0000,10.7164,9.8161,9.3270 +10.0000,10.0000,10.0000,10.7153,9.7922,9.3328 +10.0000,10.0000,10.0000,10.7134,9.7682,9.3387 +10.0000,10.0000,10.0000,10.7106,9.7442,9.3446 +10.0000,10.0000,10.0000,10.7070,9.7201,9.3506 +10.0000,10.0000,10.0000,10.7025,9.6960,9.3565 +10.0000,10.0000,10.0000,10.6972,9.6719,9.3626 +10.0000,10.0000,10.0000,10.6910,9.6479,9.3686 +10.0000,10.0000,10.0000,10.6839,9.6240,9.3748 +10.0000,10.0000,10.0000,10.6760,9.6002,9.3809 +10.0000,10.0000,10.0000,10.6671,9.5766,9.3871 +10.0000,10.0000,10.0000,10.6575,9.5532,9.3933 +10.0000,10.0000,10.0000,10.6470,9.5300,9.3996 +10.0000,10.0000,10.0000,10.6356,9.5070,9.4059 +10.0000,10.0000,10.0000,10.6234,9.4843,9.4122 +10.0000,10.0000,10.0000,10.6103,9.4620,9.4186 +10.0000,10.0000,10.0000,10.5964,9.4399,9.4250 +10.0000,10.0000,10.0000,10.5817,9.4183,9.4314 +10.0000,10.0000,10.0000,10.5662,9.3971,9.4379 +10.0000,10.0000,10.0000,10.5499,9.3763,9.4444 +10.0000,10.0000,10.0000,10.5328,9.3560,9.4510 +10.0000,10.0000,10.0000,10.5149,9.3362,9.4576 +10.0000,10.0000,10.0000,10.4963,9.3169,9.4642 +10.0000,10.0000,10.0000,10.4769,9.2982,9.4708 +10.0000,10.0000,10.0000,10.4569,9.2801,9.4775 +10.0000,10.0000,10.0000,10.4361,9.2626,9.4842 +10.0000,10.0000,10.0000,10.4147,9.2457,9.4910 +10.0000,10.0000,10.0000,10.3926,9.2295,9.4977 +10.0000,10.0000,10.0000,10.3698,9.2140,9.5045 +10.0000,10.0000,10.0000,10.3465,9.1993,9.5114 +10.0000,10.0000,10.0000,10.3226,9.1852,9.5182 +10.0000,10.0000,10.0000,10.2981,9.1720,9.5251 +10.0000,10.0000,10.0000,10.2731,9.1595,9.5321 +10.0000,10.0000,10.0000,10.2476,9.1478,9.5390 +10.0000,10.0000,10.0000,10.2216,9.1370,9.5460 +10.0000,10.0000,10.0000,10.1951,9.1270,9.5530 +10.0000,10.0000,10.0000,10.1683,9.1179,9.5601 +10.0000,10.0000,10.0000,10.1410,9.1096,9.5671 +10.0000,10.0000,10.0000,10.1134,9.1023,9.5742 +10.0000,10.0000,10.0000,10.0855,9.0959,9.5813 +10.0000,10.0000,10.0000,10.0572,9.0904,9.5885 +10.0000,10.0000,10.0000,10.0287,9.0858,9.5957 +10.0000,10.0000,10.0000,10.0000,9.0822,9.6029 +10.0000,10.0000,10.0000,9.9711,9.0796,9.6101 +10.0000,10.0000,10.0000,9.9420,9.0779,9.6173 +10.0000,10.0000,10.0000,9.9128,9.0773,9.6246 +10.0000,10.0000,10.0000,9.8835,9.0776,9.6319 +10.0000,10.0000,10.0000,9.8541,9.0788,9.6392 +10.0000,10.0000,10.0000,9.8247,9.0811,9.6465 +10.0000,10.0000,10.0000,9.7953,9.0844,9.6539 +10.0000,10.0000,10.0000,9.7660,9.0887,9.6613 +10.0000,10.0000,10.0000,9.7368,9.0940,9.6687 +10.0000,10.0000,10.0000,9.7076,9.1002,9.6761 +10.0000,10.0000,10.0000,9.6787,9.1075,9.6835 +10.0000,10.0000,10.0000,9.6499,9.1157,9.6910 +10.0000,10.0000,10.0000,9.6213,9.1250,9.6985 +10.0000,10.0000,10.0000,9.5930,9.1352,9.7060 +10.0000,10.0000,10.0000,9.5650,9.1464,9.7135 +10.0000,10.0000,10.0000,9.5374,9.1585,9.7210 +10.0000,10.0000,10.0000,9.5101,9.1716,9.7286 +10.0000,10.0000,10.0000,9.4832,9.1856,9.7361 +10.0000,10.0000,10.0000,9.4567,9.2005,9.7437 +10.0000,10.0000,10.0000,9.4307,9.2164,9.7513 +10.0000,10.0000,10.0000,9.4052,9.2331,9.7589 +10.0000,10.0000,10.0000,9.3802,9.2508,9.7666 +10.0000,10.0000,10.0000,9.3558,9.2693,9.7742 +10.0000,10.0000,10.0000,9.3319,9.2886,9.7819 +10.0000,10.0000,10.0000,9.3087,9.3087,9.7895 +10.0000,10.0000,10.0000,9.2862,9.3297,9.7972 +10.0000,10.0000,10.0000,9.2643,9.3514,9.8049 +10.0000,10.0000,10.0000,9.2431,9.3739,9.8126 +10.0000,10.0000,10.0000,9.2227,9.3971,9.8203 +10.0000,10.0000,10.0000,9.2030,9.4210,9.8281 +10.0000,10.0000,10.0000,9.1841,9.4455,9.8358 +10.0000,10.0000,10.0000,9.1661,9.4708,9.8436 +10.0000,10.0000,10.0000,9.1488,9.4966,9.8513 +10.0000,10.0000,10.0000,9.1324,9.5231,9.8591 +10.0000,10.0000,10.0000,9.1169,9.5501,9.8669 +10.0000,10.0000,10.0000,9.1023,9.5776,9.8747 +10.0000,10.0000,10.0000,9.0886,9.6056,9.8825 +10.0000,10.0000,10.0000,9.0758,9.6341,9.8903 +10.0000,10.0000,10.0000,9.0640,9.6630,9.8981 +10.0000,10.0000,10.0000,9.0532,9.6924,9.9059 +10.0000,10.0000,10.0000,9.0433,9.7221,9.9137 +10.0000,10.0000,10.0000,9.0344,9.7521,9.9215 +10.0000,10.0000,10.0000,9.0265,9.7824,9.9294 +10.0000,10.0000,10.0000,9.0197,9.8130,9.9372 +10.0000,10.0000,10.0000,9.0138,9.8438,9.9451 +10.0000,10.0000,10.0000,9.0090,9.8748,9.9529 +10.0000,10.0000,10.0000,9.0052,9.9060,9.9607 +10.0000,10.0000,10.0000,9.0025,9.9372,9.9686 +10.0000,10.0000,10.0000,9.0008,9.9686,9.9764 +10.0000,10.0000,10.0000,9.0001,10.0000,9.9843 +10.0000,10.0000,10.0000,9.0005,10.0314,9.9921 +10.0000,10.0000,10.0000,9.0020,10.0628,10.0000 +10.0000,10.0000,10.0000,9.0045,10.0941,10.0079 +10.0000,10.0000,10.0000,9.0080,10.1253,10.0157 +10.0000,10.0000,10.0000,9.0126,10.1564,10.0236 +10.0000,10.0000,10.0000,9.0182,10.1873,10.0314 +10.0000,10.0000,10.0000,9.0248,10.2180,10.0393 +10.0000,10.0000,10.0000,9.0325,10.2484,10.0471 +10.0000,10.0000,10.0000,9.0412,10.2786,10.0550 +10.0000,10.0000,10.0000,9.0508,10.3084,10.0628 +10.0000,10.0000,10.0000,9.0615,10.3379,10.0706 +10.0000,10.0000,10.0000,9.0731,10.3670,10.0785 +10.0000,10.0000,10.0000,9.0857,10.3957,10.0863 +10.0000,10.0000,10.0000,9.0992,10.4239,10.0941 +10.0000,10.0000,10.0000,9.1136,10.4516,10.1019 +10.0000,10.0000,10.0000,9.1290,10.4788,10.1097 +10.0000,10.0000,10.0000,9.1452,10.5055,10.1175 +10.0000,10.0000,10.0000,9.1623,10.5316,10.1253 +10.0000,10.0000,10.0000,9.1803,10.5571,10.1331 +10.0000,10.0000,10.0000,9.1991,10.5819,10.1409 +10.0000,10.0000,10.0000,9.2186,10.6061,10.1487 +10.0000,10.0000,10.0000,9.2390,10.6296,10.1564 +10.0000,10.0000,10.0000,9.2601,10.6523,10.1642 +10.0000,10.0000,10.0000,9.2819,10.6744,10.1719 +10.0000,10.0000,10.0000,9.3044,10.6956,10.1797 +10.0000,10.0000,10.0000,9.3276,10.7161,10.1874 +10.0000,10.0000,10.0000,9.3514,10.7357,10.1951 +10.0000,10.0000,10.0000,9.3758,10.7545,10.2028 +10.0000,10.0000,10.0000,9.4008,10.7725,10.2105 +10.0000,10.0000,10.0000,9.4264,10.7895,10.2181 +10.0000,10.0000,10.0000,9.4524,10.8057,10.2258 +10.0000,10.0000,10.0000,9.4790,10.8210,10.2334 +10.0000,10.0000,10.0000,9.5060,10.8354,10.2411 +10.0000,10.0000,10.0000,9.5334,10.8488,10.2487 +10.0000,10.0000,10.0000,9.5612,10.8612,10.2563 +10.0000,10.0000,10.0000,9.5893,10.8728,10.2639 +10.0000,10.0000,10.0000,9.6178,10.8833,10.2714 +10.0000,10.0000,10.0000,9.6465,10.8929,10.2790 +10.0000,10.0000,10.0000,9.6755,10.9014,10.2865 +10.0000,10.0000,10.0000,9.7046,10.9090,10.2940 +10.0000,10.0000,10.0000,9.7340,10.9156,10.3015 +10.0000,10.0000,10.0000,9.7635,10.9212,10.3090 +10.0000,10.0000,10.0000,9.7931,10.9258,10.3165 +10.0000,10.0000,10.0000,9.8227,10.9293,10.3239 +10.0000,10.0000,10.0000,9.8524,10.9319,10.3313 +10.0000,10.0000,10.0000,9.8821,10.9335,10.3387 +10.0000,10.0000,10.0000,9.9117,10.9340,10.3461 +10.0000,10.0000,10.0000,9.9413,10.9336,10.3535 +10.0000,10.0000,10.0000,9.9707,10.9322,10.3608 +10.0000,10.0000,10.0000,10.0000,10.9298,10.3681 +10.0000,10.0000,10.0000,10.0291,10.9264,10.3754 +10.0000,10.0000,10.0000,10.0580,10.9221,10.3827 +10.0000,10.0000,10.0000,10.0867,10.9168,10.3899 +10.0000,10.0000,10.0000,10.1150,10.9105,10.3971 +10.0000,10.0000,10.0000,10.1431,10.9033,10.4043 +10.0000,10.0000,10.0000,10.1708,10.8953,10.4115 +10.0000,10.0000,10.0000,10.1981,10.8863,10.4187 +10.0000,10.0000,10.0000,10.2250,10.8764,10.4258 +10.0000,10.0000,10.0000,10.2515,10.8657,10.4329 +10.0000,10.0000,10.0000,10.2775,10.8541,10.4399 +10.0000,10.0000,10.0000,10.3030,10.8417,10.4470 +10.0000,10.0000,10.0000,10.3280,10.8284,10.4540 +10.0000,10.0000,10.0000,10.3524,10.8144,10.4610 +10.0000,10.0000,10.0000,10.3763,10.7997,10.4679 +10.0000,10.0000,10.0000,10.3995,10.7841,10.4749 +10.0000,10.0000,10.0000,10.4222,10.7679,10.4818 +10.0000,10.0000,10.0000,10.4441,10.7510,10.4886 +10.0000,10.0000,10.0000,10.4654,10.7334,10.4955 +10.0000,10.0000,10.0000,10.4860,10.7152,10.5023 +10.0000,10.0000,10.0000,10.5059,10.6964,10.5090 +10.0000,10.0000,10.0000,10.5251,10.6769,10.5158 +10.0000,10.0000,10.0000,10.5435,10.6570,10.5225 +10.0000,10.0000,10.0000,10.5611,10.6365,10.5292 +10.0000,10.0000,10.0000,10.5780,10.6155,10.5358 +10.0000,10.0000,10.0000,10.5940,10.5940,10.5424 +10.0000,10.0000,10.0000,10.6093,10.5721,10.5490 +10.0000,10.0000,10.0000,10.6237,10.5499,10.5556 +10.0000,10.0000,10.0000,10.6373,10.5272,10.5621 +10.0000,10.0000,10.0000,10.6500,10.5042,10.5686 +10.0000,10.0000,10.0000,10.6619,10.4809,10.5750 +10.0000,10.0000,10.0000,10.6729,10.4573,10.5814 +10.0000,10.0000,10.0000,10.6831,10.4335,10.5878 +10.0000,10.0000,10.0000,10.6924,10.4095,10.5941 +10.0000,10.0000,10.0000,10.7008,10.3852,10.6004 +10.0000,10.0000,10.0000,10.7083,10.3609,10.6067 +10.0000,10.0000,10.0000,10.7150,10.3364,10.6129 +10.0000,10.0000,10.0000,10.7207,10.3119,10.6191 +10.0000,10.0000,10.0000,10.7256,10.2873,10.6252 +10.0000,10.0000,10.0000,10.7296,10.2627,10.6314 +10.0000,10.0000,10.0000,10.7328,10.2381,10.6374 +10.0000,10.0000,10.0000,10.7351,10.2136,10.6435 +10.0000,10.0000,10.0000,10.7365,10.1891,10.6494 +10.0000,10.0000,10.0000,10.7371,10.1648,10.6554 +10.0000,10.0000,10.0000,10.7368,10.1406,10.6613 +10.0000,10.0000,10.0000,10.7357,10.1165,10.6672 +10.0000,10.0000,10.0000,10.7338,10.0927,10.6730 +10.0000,10.0000,10.0000,10.7311,10.0691,10.6788 +10.0000,10.0000,10.0000,10.7275,10.0458,10.6845 +10.0000,10.0000,10.0000,10.7232,10.0227,10.6903 +10.0000,10.0000,10.0000,10.7181,10.0000,10.6959 diff --git a/scripts/trajectories/full-circle-with-up-and-down-4s.csv b/scripts/trajectories/full-circle-with-up-and-down-4s.csv new file mode 100644 index 0000000000..31692f4673 --- /dev/null +++ b/scripts/trajectories/full-circle-with-up-and-down-4s.csv @@ -0,0 +1,800 @@ +0.9223,-0.0000,0.3863,-0.0119 +0.9223,-0.0000,0.3863,-0.0119 +0.9223,-0.0000,0.3863,-0.0119 +0.9223,-0.0000,0.3863,-0.0119 +0.9235,-0.0000,0.3828,-0.0240 +0.9235,-0.0000,0.3828,-0.0240 +0.9235,-0.0000,0.3828,-0.0240 +0.9235,-0.0000,0.3828,-0.0240 +0.9245,-0.0000,0.3794,-0.0363 +0.9245,-0.0000,0.3794,-0.0363 +0.9245,-0.0000,0.3794,-0.0363 +0.9245,-0.0000,0.3794,-0.0363 +0.9253,-0.0000,0.3760,-0.0486 +0.9253,-0.0000,0.3760,-0.0486 +0.9253,-0.0000,0.3760,-0.0486 +0.9253,-0.0000,0.3760,-0.0486 +0.9259,-0.0000,0.3727,-0.0611 +0.9259,-0.0000,0.3727,-0.0611 +0.9259,-0.0000,0.3727,-0.0611 +0.9259,-0.0000,0.3727,-0.0611 +0.9263,-0.0000,0.3695,-0.0737 +0.9263,-0.0000,0.3695,-0.0737 +0.9263,-0.0000,0.3695,-0.0737 +0.9263,-0.0000,0.3695,-0.0737 +0.9265,-0.0000,0.3663,-0.0865 +0.9265,-0.0000,0.3663,-0.0865 +0.9265,-0.0000,0.3663,-0.0865 +0.9265,-0.0000,0.3663,-0.0865 +0.9264,-0.0000,0.3632,-0.0993 +0.9264,-0.0000,0.3632,-0.0993 +0.9264,-0.0000,0.3632,-0.0993 +0.9264,-0.0000,0.3632,-0.0993 +0.9261,-0.0000,0.3602,-0.1122 +0.9261,-0.0000,0.3602,-0.1122 +0.9261,-0.0000,0.3602,-0.1122 +0.9261,-0.0000,0.3602,-0.1122 +0.9256,-0.0000,0.3572,-0.1252 +0.9256,-0.0000,0.3572,-0.1252 +0.9256,-0.0000,0.3572,-0.1252 +0.9256,-0.0000,0.3572,-0.1252 +0.9248,-0.0000,0.3543,-0.1383 +0.9248,-0.0000,0.3543,-0.1383 +0.9248,-0.0000,0.3543,-0.1383 +0.9248,-0.0000,0.3543,-0.1383 +0.9239,-0.0000,0.3515,-0.1515 +0.9239,-0.0000,0.3515,-0.1515 +0.9239,-0.0000,0.3515,-0.1515 +0.9239,-0.0000,0.3515,-0.1515 +0.9226,-0.0000,0.3487,-0.1648 +0.9226,-0.0000,0.3487,-0.1648 +0.9226,-0.0000,0.3487,-0.1648 +0.9226,-0.0000,0.3487,-0.1648 +0.9212,-0.0000,0.3460,-0.1781 +0.9212,-0.0000,0.3460,-0.1781 +0.9212,-0.0000,0.3460,-0.1781 +0.9212,-0.0000,0.3460,-0.1781 +0.9195,-0.0000,0.3433,-0.1914 +0.9195,-0.0000,0.3433,-0.1914 +0.9195,-0.0000,0.3433,-0.1914 +0.9195,-0.0000,0.3433,-0.1914 +0.9176,-0.0000,0.3407,-0.2049 +0.9176,-0.0000,0.3407,-0.2049 +0.9176,-0.0000,0.3407,-0.2049 +0.9176,-0.0000,0.3407,-0.2049 +0.9154,-0.0000,0.3382,-0.2183 +0.9154,-0.0000,0.3382,-0.2183 +0.9154,-0.0000,0.3382,-0.2183 +0.9154,-0.0000,0.3382,-0.2183 +0.9130,-0.0000,0.3357,-0.2319 +0.9130,-0.0000,0.3357,-0.2319 +0.9130,-0.0000,0.3357,-0.2319 +0.9130,-0.0000,0.3357,-0.2319 +0.9104,-0.0000,0.3332,-0.2454 +0.9104,-0.0000,0.3332,-0.2454 +0.9104,-0.0000,0.3332,-0.2454 +0.9104,-0.0000,0.3332,-0.2454 +0.9075,-0.0000,0.3308,-0.2590 +0.9075,-0.0000,0.3308,-0.2590 +0.9075,-0.0000,0.3308,-0.2590 +0.9075,-0.0000,0.3308,-0.2590 +0.9043,-0.0000,0.3285,-0.2726 +0.9043,-0.0000,0.3285,-0.2726 +0.9043,-0.0000,0.3285,-0.2726 +0.9043,-0.0000,0.3285,-0.2726 +0.9009,-0.0000,0.3262,-0.2862 +0.9009,-0.0000,0.3262,-0.2862 +0.9009,-0.0000,0.3262,-0.2862 +0.9009,-0.0000,0.3262,-0.2862 +0.8973,-0.0000,0.3240,-0.2998 +0.8973,-0.0000,0.3240,-0.2998 +0.8973,-0.0000,0.3240,-0.2998 +0.8973,-0.0000,0.3240,-0.2998 +0.8934,-0.0000,0.3218,-0.3134 +0.8934,-0.0000,0.3218,-0.3134 +0.8934,-0.0000,0.3218,-0.3134 +0.8934,-0.0000,0.3218,-0.3134 +0.8893,-0.0000,0.3197,-0.3271 +0.8893,-0.0000,0.3197,-0.3271 +0.8893,-0.0000,0.3197,-0.3271 +0.8893,-0.0000,0.3197,-0.3271 +0.8849,-0.0000,0.3176,-0.3407 +0.8849,-0.0000,0.3176,-0.3407 +0.8849,-0.0000,0.3176,-0.3407 +0.8849,-0.0000,0.3176,-0.3407 +0.8803,-0.0000,0.3156,-0.3543 +0.8803,-0.0000,0.3156,-0.3543 +0.8803,-0.0000,0.3156,-0.3543 +0.8803,-0.0000,0.3156,-0.3543 +0.8754,-0.0000,0.3136,-0.3678 +0.8754,-0.0000,0.3136,-0.3678 +0.8754,-0.0000,0.3136,-0.3678 +0.8754,-0.0000,0.3136,-0.3678 +0.8703,-0.0000,0.3116,-0.3814 +0.8703,-0.0000,0.3116,-0.3814 +0.8703,-0.0000,0.3116,-0.3814 +0.8703,-0.0000,0.3116,-0.3814 +0.8650,-0.0000,0.3097,-0.3949 +0.8650,-0.0000,0.3097,-0.3949 +0.8650,-0.0000,0.3097,-0.3949 +0.8650,-0.0000,0.3097,-0.3949 +0.8593,-0.0000,0.3079,-0.4083 +0.8593,-0.0000,0.3079,-0.4083 +0.8593,-0.0000,0.3079,-0.4083 +0.8593,-0.0000,0.3079,-0.4083 +0.8535,-0.0000,0.3061,-0.4217 +0.8535,-0.0000,0.3061,-0.4217 +0.8535,-0.0000,0.3061,-0.4217 +0.8535,-0.0000,0.3061,-0.4217 +0.8474,-0.0000,0.3043,-0.4351 +0.8474,-0.0000,0.3043,-0.4351 +0.8474,-0.0000,0.3043,-0.4351 +0.8474,-0.0000,0.3043,-0.4351 +0.8410,-0.0000,0.3026,-0.4484 +0.8410,-0.0000,0.3026,-0.4484 +0.8410,-0.0000,0.3026,-0.4484 +0.8410,-0.0000,0.3026,-0.4484 +0.8344,-0.0000,0.3010,-0.4617 +0.8344,-0.0000,0.3010,-0.4617 +0.8344,-0.0000,0.3010,-0.4617 +0.8344,-0.0000,0.3010,-0.4617 +0.8276,-0.0000,0.2993,-0.4748 +0.8276,-0.0000,0.2993,-0.4748 +0.8276,-0.0000,0.2993,-0.4748 +0.8276,-0.0000,0.2993,-0.4748 +0.8205,-0.0000,0.2978,-0.4879 +0.8205,-0.0000,0.2978,-0.4879 +0.8205,-0.0000,0.2978,-0.4879 +0.8205,-0.0000,0.2978,-0.4879 +0.8132,-0.0000,0.2962,-0.5010 +0.8132,-0.0000,0.2962,-0.5010 +0.8132,-0.0000,0.2962,-0.5010 +0.8132,-0.0000,0.2962,-0.5010 +0.8056,-0.0000,0.2947,-0.5139 +0.8056,-0.0000,0.2947,-0.5139 +0.8056,-0.0000,0.2947,-0.5139 +0.8056,-0.0000,0.2947,-0.5139 +0.7978,-0.0000,0.2932,-0.5267 +0.7978,-0.0000,0.2932,-0.5267 +0.7978,-0.0000,0.2932,-0.5267 +0.7978,-0.0000,0.2932,-0.5267 +0.7898,-0.0000,0.2918,-0.5395 +0.7898,-0.0000,0.2918,-0.5395 +0.7898,-0.0000,0.2918,-0.5395 +0.7898,-0.0000,0.2918,-0.5395 +0.7815,-0.0000,0.2904,-0.5521 +0.7815,-0.0000,0.2904,-0.5521 +0.7815,-0.0000,0.2904,-0.5521 +0.7815,-0.0000,0.2904,-0.5521 +0.7730,-0.0000,0.2891,-0.5647 +0.7730,-0.0000,0.2891,-0.5647 +0.7730,-0.0000,0.2891,-0.5647 +0.7730,-0.0000,0.2891,-0.5647 +0.7643,-0.0000,0.2878,-0.5771 +0.7643,-0.0000,0.2878,-0.5771 +0.7643,-0.0000,0.2878,-0.5771 +0.7643,-0.0000,0.2878,-0.5771 +0.7553,-0.0000,0.2865,-0.5894 +0.7553,-0.0000,0.2865,-0.5894 +0.7553,-0.0000,0.2865,-0.5894 +0.7553,-0.0000,0.2865,-0.5894 +0.7461,-0.0000,0.2853,-0.6016 +0.7461,-0.0000,0.2853,-0.6016 +0.7461,-0.0000,0.2853,-0.6016 +0.7461,-0.0000,0.2853,-0.6016 +0.7367,-0.0000,0.2841,-0.6136 +0.7367,-0.0000,0.2841,-0.6136 +0.7367,-0.0000,0.2841,-0.6136 +0.7367,-0.0000,0.2841,-0.6136 +0.7271,-0.0000,0.2830,-0.6255 +0.7271,-0.0000,0.2830,-0.6255 +0.7271,-0.0000,0.2830,-0.6255 +0.7271,-0.0000,0.2830,-0.6255 +0.7172,-0.0000,0.2819,-0.6373 +0.7172,-0.0000,0.2819,-0.6373 +0.7172,-0.0000,0.2819,-0.6373 +0.7172,-0.0000,0.2819,-0.6373 +0.7071,-0.0000,0.2808,-0.6490 +0.7071,-0.0000,0.2808,-0.6490 +0.7071,-0.0000,0.2808,-0.6490 +0.7071,-0.0000,0.2808,-0.6490 +0.6968,-0.0000,0.2798,-0.6604 +0.6968,-0.0000,0.2798,-0.6604 +0.6968,-0.0000,0.2798,-0.6604 +0.6968,-0.0000,0.2798,-0.6604 +0.6863,-0.0000,0.2788,-0.6718 +0.6863,-0.0000,0.2788,-0.6718 +0.6863,-0.0000,0.2788,-0.6718 +0.6863,-0.0000,0.2788,-0.6718 +0.6756,-0.0000,0.2779,-0.6829 +0.6756,-0.0000,0.2779,-0.6829 +0.6756,-0.0000,0.2779,-0.6829 +0.6756,-0.0000,0.2779,-0.6829 +0.6646,-0.0000,0.2769,-0.6940 +0.6646,-0.0000,0.2769,-0.6940 +0.6646,-0.0000,0.2769,-0.6940 +0.6646,-0.0000,0.2769,-0.6940 +0.6535,-0.0000,0.2761,-0.7048 +0.6535,-0.0000,0.2761,-0.7048 +0.6535,-0.0000,0.2761,-0.7048 +0.6535,-0.0000,0.2761,-0.7048 +0.6422,-0.0000,0.2752,-0.7155 +0.6422,-0.0000,0.2752,-0.7155 +0.6422,-0.0000,0.2752,-0.7155 +0.6422,-0.0000,0.2752,-0.7155 +0.6306,-0.0000,0.2744,-0.7260 +0.6306,-0.0000,0.2744,-0.7260 +0.6306,-0.0000,0.2744,-0.7260 +0.6306,-0.0000,0.2744,-0.7260 +0.6189,-0.0000,0.2737,-0.7363 +0.6189,-0.0000,0.2737,-0.7363 +0.6189,-0.0000,0.2737,-0.7363 +0.6189,-0.0000,0.2737,-0.7363 +0.6069,-0.0000,0.2730,-0.7464 +0.6069,-0.0000,0.2730,-0.7464 +0.6069,-0.0000,0.2730,-0.7464 +0.6069,-0.0000,0.2730,-0.7464 +0.5948,-0.0000,0.2723,-0.7563 +0.5948,-0.0000,0.2723,-0.7563 +0.5948,-0.0000,0.2723,-0.7563 +0.5948,-0.0000,0.2723,-0.7563 +0.5825,-0.0000,0.2716,-0.7661 +0.5825,-0.0000,0.2716,-0.7661 +0.5825,-0.0000,0.2716,-0.7661 +0.5825,-0.0000,0.2716,-0.7661 +0.5700,-0.0000,0.2710,-0.7756 +0.5700,-0.0000,0.2710,-0.7756 +0.5700,-0.0000,0.2710,-0.7756 +0.5700,-0.0000,0.2710,-0.7756 +0.5574,-0.0000,0.2705,-0.7850 +0.5574,-0.0000,0.2705,-0.7850 +0.5574,-0.0000,0.2705,-0.7850 +0.5574,-0.0000,0.2705,-0.7850 +0.5445,-0.0000,0.2700,-0.7941 +0.5445,-0.0000,0.2700,-0.7941 +0.5445,-0.0000,0.2700,-0.7941 +0.5445,-0.0000,0.2700,-0.7941 +0.5315,-0.0000,0.2695,-0.8030 +0.5315,-0.0000,0.2695,-0.8030 +0.5315,-0.0000,0.2695,-0.8030 +0.5315,-0.0000,0.2695,-0.8030 +0.5184,-0.0000,0.2691,-0.8117 +0.5184,-0.0000,0.2691,-0.8117 +0.5184,-0.0000,0.2691,-0.8117 +0.5184,-0.0000,0.2691,-0.8117 +0.5050,-0.0000,0.2687,-0.8202 +0.5050,-0.0000,0.2687,-0.8202 +0.5050,-0.0000,0.2687,-0.8202 +0.5050,-0.0000,0.2687,-0.8202 +0.4915,-0.0000,0.2684,-0.8285 +0.4915,-0.0000,0.2684,-0.8285 +0.4915,-0.0000,0.2684,-0.8285 +0.4915,-0.0000,0.2684,-0.8285 +0.4779,-0.0000,0.2682,-0.8365 +0.4779,-0.0000,0.2682,-0.8365 +0.4779,-0.0000,0.2682,-0.8365 +0.4779,-0.0000,0.2682,-0.8365 +0.4640,-0.0000,0.2680,-0.8443 +0.4640,-0.0000,0.2680,-0.8443 +0.4640,-0.0000,0.2680,-0.8443 +0.4640,-0.0000,0.2680,-0.8443 +0.4501,-0.0000,0.2678,-0.8519 +0.4501,-0.0000,0.2678,-0.8519 +0.4501,-0.0000,0.2678,-0.8519 +0.4501,-0.0000,0.2678,-0.8519 +0.4360,-0.0000,0.2677,-0.8592 +0.4360,-0.0000,0.2677,-0.8592 +0.4360,-0.0000,0.2677,-0.8592 +0.4360,-0.0000,0.2677,-0.8592 +0.4218,-0.0000,0.2677,-0.8663 +0.4218,-0.0000,0.2677,-0.8663 +0.4218,-0.0000,0.2677,-0.8663 +0.4218,-0.0000,0.2677,-0.8663 +0.4074,-0.0000,0.2677,-0.8731 +0.4074,-0.0000,0.2677,-0.8731 +0.4074,-0.0000,0.2677,-0.8731 +0.4074,-0.0000,0.2677,-0.8731 +0.3929,-0.0000,0.2678,-0.8797 +0.3929,-0.0000,0.2678,-0.8797 +0.3929,-0.0000,0.2678,-0.8797 +0.3929,-0.0000,0.2678,-0.8797 +0.3783,-0.0000,0.2680,-0.8860 +0.3783,-0.0000,0.2680,-0.8860 +0.3783,-0.0000,0.2680,-0.8860 +0.3783,-0.0000,0.2680,-0.8860 +0.3635,-0.0000,0.2683,-0.8921 +0.3635,-0.0000,0.2683,-0.8921 +0.3635,-0.0000,0.2683,-0.8921 +0.3635,-0.0000,0.2683,-0.8921 +0.3487,-0.0000,0.2687,-0.8979 +0.3487,-0.0000,0.2687,-0.8979 +0.3487,-0.0000,0.2687,-0.8979 +0.3487,-0.0000,0.2687,-0.8979 +0.3337,-0.0000,0.2692,-0.9034 +0.3337,-0.0000,0.2692,-0.9034 +0.3337,-0.0000,0.2692,-0.9034 +0.3337,-0.0000,0.2692,-0.9034 +0.3186,-0.0000,0.2698,-0.9087 +0.3186,-0.0000,0.2698,-0.9087 +0.3186,-0.0000,0.2698,-0.9087 +0.3186,-0.0000,0.2698,-0.9087 +0.3034,-0.0000,0.2705,-0.9136 +0.3034,-0.0000,0.2705,-0.9136 +0.3034,-0.0000,0.2705,-0.9136 +0.3034,-0.0000,0.2705,-0.9136 +0.2882,-0.0000,0.2714,-0.9183 +0.2882,-0.0000,0.2714,-0.9183 +0.2882,-0.0000,0.2714,-0.9183 +0.2882,-0.0000,0.2714,-0.9183 +0.2728,-0.0000,0.2725,-0.9227 +0.2728,-0.0000,0.2725,-0.9227 +0.2728,-0.0000,0.2725,-0.9227 +0.2728,-0.0000,0.2725,-0.9227 +0.2573,-0.0000,0.2738,-0.9267 +0.2573,-0.0000,0.2738,-0.9267 +0.2573,-0.0000,0.2738,-0.9267 +0.2573,-0.0000,0.2738,-0.9267 +0.2418,-0.0000,0.2753,-0.9305 +0.2418,-0.0000,0.2753,-0.9305 +0.2418,-0.0000,0.2753,-0.9305 +0.2418,-0.0000,0.2753,-0.9305 +0.2262,-0.0000,0.2771,-0.9339 +0.2262,-0.0000,0.2771,-0.9339 +0.2262,-0.0000,0.2771,-0.9339 +0.2262,-0.0000,0.2771,-0.9339 +0.2105,-0.0000,0.2792,-0.9369 +0.2105,-0.0000,0.2792,-0.9369 +0.2105,-0.0000,0.2792,-0.9369 +0.2105,-0.0000,0.2792,-0.9369 +0.1947,-0.0000,0.2818,-0.9395 +0.1947,-0.0000,0.2818,-0.9395 +0.1947,-0.0000,0.2818,-0.9395 +0.1947,-0.0000,0.2818,-0.9395 +0.1789,-0.0000,0.2848,-0.9417 +0.1789,-0.0000,0.2848,-0.9417 +0.1789,-0.0000,0.2848,-0.9417 +0.1789,-0.0000,0.2848,-0.9417 +0.1630,-0.0000,0.2886,-0.9435 +0.1630,-0.0000,0.2886,-0.9435 +0.1630,-0.0000,0.2886,-0.9435 +0.1630,-0.0000,0.2886,-0.9435 +0.1471,-0.0000,0.2933,-0.9446 +0.1471,-0.0000,0.2933,-0.9446 +0.1471,-0.0000,0.2933,-0.9446 +0.1471,-0.0000,0.2933,-0.9446 +0.1312,-0.0000,0.2991,-0.9452 +0.1312,-0.0000,0.2991,-0.9452 +0.1312,-0.0000,0.2991,-0.9452 +0.1312,-0.0000,0.2991,-0.9452 +0.1152,-0.0000,0.3067,-0.9448 +0.1152,-0.0000,0.3067,-0.9448 +0.1152,-0.0000,0.3067,-0.9448 +0.1152,-0.0000,0.3067,-0.9448 +0.0991,-0.0000,0.3167,-0.9433 +0.0991,-0.0000,0.3167,-0.9433 +0.0991,-0.0000,0.3167,-0.9433 +0.0991,-0.0000,0.3167,-0.9433 +0.0831,-0.0000,0.3307,-0.9401 +0.0831,-0.0000,0.3307,-0.9401 +0.0831,-0.0000,0.3307,-0.9401 +0.0831,-0.0000,0.3307,-0.9401 +0.0670,-0.0000,0.3514,-0.9338 +0.0670,-0.0000,0.3514,-0.9338 +0.0670,-0.0000,0.3514,-0.9338 +0.0670,-0.0000,0.3514,-0.9338 +0.0510,-0.0000,0.3848,-0.9216 +0.0510,-0.0000,0.3848,-0.9216 +0.0510,-0.0000,0.3848,-0.9216 +0.0510,-0.0000,0.3848,-0.9216 +0.0351,-0.0000,0.4473,-0.8937 +0.0351,-0.0000,0.4473,-0.8937 +0.0351,-0.0000,0.4473,-0.8937 +0.0351,-0.0000,0.4473,-0.8937 +0.0196,-0.0000,0.6000,-0.7997 +0.0196,-0.0000,0.6000,-0.7997 +0.0196,-0.0000,0.6000,-0.7997 +0.0196,-0.0000,0.6000,-0.7997 +0.0079,0.0000,1.0000,0.0001 +0.0079,0.0000,1.0000,0.0001 +0.0079,0.0000,1.0000,0.0001 +0.0079,0.0000,1.0000,0.0001 +0.0162,0.0000,0.2425,0.9700 +0.0162,0.0000,0.2425,0.9700 +0.0162,0.0000,0.2425,0.9700 +0.0162,0.0000,0.2425,0.9700 +0.0314,-0.0000,-0.0000,0.9995 +0.0314,-0.0000,-0.0000,0.9995 +0.0314,-0.0000,-0.0000,0.9995 +0.0314,-0.0000,-0.0000,0.9995 +0.0473,-0.0000,-0.0831,0.9954 +0.0473,-0.0000,-0.0831,0.9954 +0.0473,-0.0000,-0.0831,0.9954 +0.0473,-0.0000,-0.0831,0.9954 +0.0633,-0.0000,-0.1241,0.9902 +0.0633,-0.0000,-0.1241,0.9902 +0.0633,-0.0000,-0.1241,0.9902 +0.0633,-0.0000,-0.1241,0.9902 +0.0793,-0.0000,-0.1485,0.9857 +0.0793,-0.0000,-0.1485,0.9857 +0.0793,-0.0000,-0.1485,0.9857 +0.0793,-0.0000,-0.1485,0.9857 +0.0954,-0.0000,-0.1646,0.9817 +0.0954,-0.0000,-0.1646,0.9817 +0.0954,-0.0000,-0.1646,0.9817 +0.0954,-0.0000,-0.1646,0.9817 +0.1114,-0.0000,-0.1762,0.9780 +0.1114,-0.0000,-0.1762,0.9780 +0.1114,-0.0000,-0.1762,0.9780 +0.1114,-0.0000,-0.1762,0.9780 +0.1275,-0.0000,-0.1848,0.9745 +0.1275,-0.0000,-0.1848,0.9745 +0.1275,-0.0000,-0.1848,0.9745 +0.1275,-0.0000,-0.1848,0.9745 +0.1435,-0.0000,-0.1915,0.9709 +0.1435,-0.0000,-0.1915,0.9709 +0.1435,-0.0000,-0.1915,0.9709 +0.1435,-0.0000,-0.1915,0.9709 +0.1594,-0.0000,-0.1970,0.9674 +0.1594,-0.0000,-0.1970,0.9674 +0.1594,-0.0000,-0.1970,0.9674 +0.1594,-0.0000,-0.1970,0.9674 +0.1753,-0.0000,-0.2014,0.9637 +0.1753,-0.0000,-0.2014,0.9637 +0.1753,-0.0000,-0.2014,0.9637 +0.1753,-0.0000,-0.2014,0.9637 +0.1912,-0.0000,-0.2052,0.9599 +0.1912,-0.0000,-0.2052,0.9599 +0.1912,-0.0000,-0.2052,0.9599 +0.1912,-0.0000,-0.2052,0.9599 +0.2070,-0.0000,-0.2085,0.9559 +0.2070,-0.0000,-0.2085,0.9559 +0.2070,-0.0000,-0.2085,0.9559 +0.2070,-0.0000,-0.2085,0.9559 +0.2227,-0.0000,-0.2113,0.9517 +0.2227,-0.0000,-0.2113,0.9517 +0.2227,-0.0000,-0.2113,0.9517 +0.2227,-0.0000,-0.2113,0.9517 +0.2384,-0.0000,-0.2138,0.9473 +0.2384,-0.0000,-0.2138,0.9473 +0.2384,-0.0000,-0.2138,0.9473 +0.2384,-0.0000,-0.2138,0.9473 +0.2540,-0.0000,-0.2161,0.9428 +0.2540,-0.0000,-0.2161,0.9428 +0.2540,-0.0000,-0.2161,0.9428 +0.2540,-0.0000,-0.2161,0.9428 +0.2695,-0.0000,-0.2181,0.9380 +0.2695,-0.0000,-0.2181,0.9380 +0.2695,-0.0000,-0.2181,0.9380 +0.2695,-0.0000,-0.2181,0.9380 +0.2849,-0.0000,-0.2200,0.9330 +0.2849,-0.0000,-0.2200,0.9330 +0.2849,-0.0000,-0.2200,0.9330 +0.2849,-0.0000,-0.2200,0.9330 +0.3002,-0.0000,-0.2217,0.9277 +0.3002,-0.0000,-0.2217,0.9277 +0.3002,-0.0000,-0.2217,0.9277 +0.3002,-0.0000,-0.2217,0.9277 +0.3155,-0.0000,-0.2233,0.9223 +0.3155,-0.0000,-0.2233,0.9223 +0.3155,-0.0000,-0.2233,0.9223 +0.3155,-0.0000,-0.2233,0.9223 +0.3306,-0.0000,-0.2248,0.9166 +0.3306,-0.0000,-0.2248,0.9166 +0.3306,-0.0000,-0.2248,0.9166 +0.3306,-0.0000,-0.2248,0.9166 +0.3457,-0.0000,-0.2263,0.9107 +0.3457,-0.0000,-0.2263,0.9107 +0.3457,-0.0000,-0.2263,0.9107 +0.3457,-0.0000,-0.2263,0.9107 +0.3606,-0.0000,-0.2277,0.9045 +0.3606,-0.0000,-0.2277,0.9045 +0.3606,-0.0000,-0.2277,0.9045 +0.3606,-0.0000,-0.2277,0.9045 +0.3754,-0.0000,-0.2290,0.8981 +0.3754,-0.0000,-0.2290,0.8981 +0.3754,-0.0000,-0.2290,0.8981 +0.3754,-0.0000,-0.2290,0.8981 +0.3901,-0.0000,-0.2303,0.8915 +0.3901,-0.0000,-0.2303,0.8915 +0.3901,-0.0000,-0.2303,0.8915 +0.3901,-0.0000,-0.2303,0.8915 +0.4047,-0.0000,-0.2315,0.8847 +0.4047,-0.0000,-0.2315,0.8847 +0.4047,-0.0000,-0.2315,0.8847 +0.4047,-0.0000,-0.2315,0.8847 +0.4192,-0.0000,-0.2327,0.8776 +0.4192,-0.0000,-0.2327,0.8776 +0.4192,-0.0000,-0.2327,0.8776 +0.4192,-0.0000,-0.2327,0.8776 +0.4335,-0.0000,-0.2339,0.8703 +0.4335,-0.0000,-0.2339,0.8703 +0.4335,-0.0000,-0.2339,0.8703 +0.4335,-0.0000,-0.2339,0.8703 +0.4477,-0.0000,-0.2351,0.8627 +0.4477,-0.0000,-0.2351,0.8627 +0.4477,-0.0000,-0.2351,0.8627 +0.4477,-0.0000,-0.2351,0.8627 +0.4617,-0.0000,-0.2362,0.8550 +0.4617,-0.0000,-0.2362,0.8550 +0.4617,-0.0000,-0.2362,0.8550 +0.4617,-0.0000,-0.2362,0.8550 +0.4756,-0.0000,-0.2374,0.8470 +0.4756,-0.0000,-0.2374,0.8470 +0.4756,-0.0000,-0.2374,0.8470 +0.4756,-0.0000,-0.2374,0.8470 +0.4894,-0.0000,-0.2385,0.8388 +0.4894,-0.0000,-0.2385,0.8388 +0.4894,-0.0000,-0.2385,0.8388 +0.4894,-0.0000,-0.2385,0.8388 +0.5030,-0.0000,-0.2396,0.8304 +0.5030,-0.0000,-0.2396,0.8304 +0.5030,-0.0000,-0.2396,0.8304 +0.5030,-0.0000,-0.2396,0.8304 +0.5164,-0.0000,-0.2408,0.8218 +0.5164,-0.0000,-0.2408,0.8218 +0.5164,-0.0000,-0.2408,0.8218 +0.5164,-0.0000,-0.2408,0.8218 +0.5297,-0.0000,-0.2419,0.8130 +0.5297,-0.0000,-0.2419,0.8130 +0.5297,-0.0000,-0.2419,0.8130 +0.5297,-0.0000,-0.2419,0.8130 +0.5428,-0.0000,-0.2431,0.8039 +0.5428,-0.0000,-0.2431,0.8039 +0.5428,-0.0000,-0.2431,0.8039 +0.5428,-0.0000,-0.2431,0.8039 +0.5558,-0.0000,-0.2442,0.7947 +0.5558,-0.0000,-0.2442,0.7947 +0.5558,-0.0000,-0.2442,0.7947 +0.5558,-0.0000,-0.2442,0.7947 +0.5685,-0.0000,-0.2454,0.7852 +0.5685,-0.0000,-0.2454,0.7852 +0.5685,-0.0000,-0.2454,0.7852 +0.5685,-0.0000,-0.2454,0.7852 +0.5811,-0.0000,-0.2465,0.7756 +0.5811,-0.0000,-0.2465,0.7756 +0.5811,-0.0000,-0.2465,0.7756 +0.5811,-0.0000,-0.2465,0.7756 +0.5936,-0.0000,-0.2477,0.7657 +0.5936,-0.0000,-0.2477,0.7657 +0.5936,-0.0000,-0.2477,0.7657 +0.5936,-0.0000,-0.2477,0.7657 +0.6058,-0.0000,-0.2489,0.7557 +0.6058,-0.0000,-0.2489,0.7557 +0.6058,-0.0000,-0.2489,0.7557 +0.6058,-0.0000,-0.2489,0.7557 +0.6179,-0.0000,-0.2501,0.7455 +0.6179,-0.0000,-0.2501,0.7455 +0.6179,-0.0000,-0.2501,0.7455 +0.6179,-0.0000,-0.2501,0.7455 +0.6297,-0.0000,-0.2513,0.7351 +0.6297,-0.0000,-0.2513,0.7351 +0.6297,-0.0000,-0.2513,0.7351 +0.6297,-0.0000,-0.2513,0.7351 +0.6414,-0.0000,-0.2525,0.7245 +0.6414,-0.0000,-0.2525,0.7245 +0.6414,-0.0000,-0.2525,0.7245 +0.6414,-0.0000,-0.2525,0.7245 +0.6528,-0.0000,-0.2538,0.7137 +0.6528,-0.0000,-0.2538,0.7137 +0.6528,-0.0000,-0.2538,0.7137 +0.6528,-0.0000,-0.2538,0.7137 +0.6641,-0.0000,-0.2550,0.7028 +0.6641,-0.0000,-0.2550,0.7028 +0.6641,-0.0000,-0.2550,0.7028 +0.6641,-0.0000,-0.2550,0.7028 +0.6752,-0.0000,-0.2563,0.6917 +0.6752,-0.0000,-0.2563,0.6917 +0.6752,-0.0000,-0.2563,0.6917 +0.6752,-0.0000,-0.2563,0.6917 +0.6860,-0.0000,-0.2576,0.6804 +0.6860,-0.0000,-0.2576,0.6804 +0.6860,-0.0000,-0.2576,0.6804 +0.6860,-0.0000,-0.2576,0.6804 +0.6967,-0.0000,-0.2590,0.6690 +0.6967,-0.0000,-0.2590,0.6690 +0.6967,-0.0000,-0.2590,0.6690 +0.6967,-0.0000,-0.2590,0.6690 +0.7071,-0.0000,-0.2603,0.6575 +0.7071,-0.0000,-0.2603,0.6575 +0.7071,-0.0000,-0.2603,0.6575 +0.7071,-0.0000,-0.2603,0.6575 +0.7173,-0.0000,-0.2617,0.6457 +0.7173,-0.0000,-0.2617,0.6457 +0.7173,-0.0000,-0.2617,0.6457 +0.7173,-0.0000,-0.2617,0.6457 +0.7273,-0.0000,-0.2631,0.6339 +0.7273,-0.0000,-0.2631,0.6339 +0.7273,-0.0000,-0.2631,0.6339 +0.7273,-0.0000,-0.2631,0.6339 +0.7371,-0.0000,-0.2645,0.6219 +0.7371,-0.0000,-0.2645,0.6219 +0.7371,-0.0000,-0.2645,0.6219 +0.7371,-0.0000,-0.2645,0.6219 +0.7467,-0.0000,-0.2659,0.6097 +0.7467,-0.0000,-0.2659,0.6097 +0.7467,-0.0000,-0.2659,0.6097 +0.7467,-0.0000,-0.2659,0.6097 +0.7560,-0.0000,-0.2674,0.5974 +0.7560,-0.0000,-0.2674,0.5974 +0.7560,-0.0000,-0.2674,0.5974 +0.7560,-0.0000,-0.2674,0.5974 +0.7651,-0.0000,-0.2689,0.5851 +0.7651,-0.0000,-0.2689,0.5851 +0.7651,-0.0000,-0.2689,0.5851 +0.7651,-0.0000,-0.2689,0.5851 +0.7740,-0.0000,-0.2705,0.5725 +0.7740,-0.0000,-0.2705,0.5725 +0.7740,-0.0000,-0.2705,0.5725 +0.7740,-0.0000,-0.2705,0.5725 +0.7826,-0.0000,-0.2720,0.5599 +0.7826,-0.0000,-0.2720,0.5599 +0.7826,-0.0000,-0.2720,0.5599 +0.7826,-0.0000,-0.2720,0.5599 +0.7910,-0.0000,-0.2736,0.5472 +0.7910,-0.0000,-0.2736,0.5472 +0.7910,-0.0000,-0.2736,0.5472 +0.7910,-0.0000,-0.2736,0.5472 +0.7992,-0.0000,-0.2752,0.5343 +0.7992,-0.0000,-0.2752,0.5343 +0.7992,-0.0000,-0.2752,0.5343 +0.7992,-0.0000,-0.2752,0.5343 +0.8072,-0.0000,-0.2769,0.5214 +0.8072,-0.0000,-0.2769,0.5214 +0.8072,-0.0000,-0.2769,0.5214 +0.8072,-0.0000,-0.2769,0.5214 +0.8149,-0.0000,-0.2786,0.5083 +0.8149,-0.0000,-0.2786,0.5083 +0.8149,-0.0000,-0.2786,0.5083 +0.8149,-0.0000,-0.2786,0.5083 +0.8223,-0.0000,-0.2803,0.4952 +0.8223,-0.0000,-0.2803,0.4952 +0.8223,-0.0000,-0.2803,0.4952 +0.8223,-0.0000,-0.2803,0.4952 +0.8295,-0.0000,-0.2820,0.4820 +0.8295,-0.0000,-0.2820,0.4820 +0.8295,-0.0000,-0.2820,0.4820 +0.8295,-0.0000,-0.2820,0.4820 +0.8365,-0.0000,-0.2838,0.4687 +0.8365,-0.0000,-0.2838,0.4687 +0.8365,-0.0000,-0.2838,0.4687 +0.8365,-0.0000,-0.2838,0.4687 +0.8433,-0.0000,-0.2857,0.4553 +0.8433,-0.0000,-0.2857,0.4553 +0.8433,-0.0000,-0.2857,0.4553 +0.8433,-0.0000,-0.2857,0.4553 +0.8497,-0.0000,-0.2875,0.4419 +0.8497,-0.0000,-0.2875,0.4419 +0.8497,-0.0000,-0.2875,0.4419 +0.8497,-0.0000,-0.2875,0.4419 +0.8560,-0.0000,-0.2894,0.4284 +0.8560,-0.0000,-0.2894,0.4284 +0.8560,-0.0000,-0.2894,0.4284 +0.8560,-0.0000,-0.2894,0.4284 +0.8620,-0.0000,-0.2913,0.4148 +0.8620,-0.0000,-0.2913,0.4148 +0.8620,-0.0000,-0.2913,0.4148 +0.8620,-0.0000,-0.2913,0.4148 +0.8677,-0.0000,-0.2933,0.4012 +0.8677,-0.0000,-0.2933,0.4012 +0.8677,-0.0000,-0.2933,0.4012 +0.8677,-0.0000,-0.2933,0.4012 +0.8732,-0.0000,-0.2953,0.3876 +0.8732,-0.0000,-0.2953,0.3876 +0.8732,-0.0000,-0.2953,0.3876 +0.8732,-0.0000,-0.2953,0.3876 +0.8785,-0.0000,-0.2974,0.3739 +0.8785,-0.0000,-0.2974,0.3739 +0.8785,-0.0000,-0.2974,0.3739 +0.8785,-0.0000,-0.2974,0.3739 +0.8835,-0.0000,-0.2995,0.3602 +0.8835,-0.0000,-0.2995,0.3602 +0.8835,-0.0000,-0.2995,0.3602 +0.8835,-0.0000,-0.2995,0.3602 +0.8883,-0.0000,-0.3016,0.3465 +0.8883,-0.0000,-0.3016,0.3465 +0.8883,-0.0000,-0.3016,0.3465 +0.8883,-0.0000,-0.3016,0.3465 +0.8928,-0.0000,-0.3038,0.3327 +0.8928,-0.0000,-0.3038,0.3327 +0.8928,-0.0000,-0.3038,0.3327 +0.8928,-0.0000,-0.3038,0.3327 +0.8970,-0.0000,-0.3060,0.3189 +0.8970,-0.0000,-0.3060,0.3189 +0.8970,-0.0000,-0.3060,0.3189 +0.8970,-0.0000,-0.3060,0.3189 +0.9010,-0.0000,-0.3083,0.3051 +0.9010,-0.0000,-0.3083,0.3051 +0.9010,-0.0000,-0.3083,0.3051 +0.9010,-0.0000,-0.3083,0.3051 +0.9048,-0.0000,-0.3106,0.2913 +0.9048,-0.0000,-0.3106,0.2913 +0.9048,-0.0000,-0.3106,0.2913 +0.9048,-0.0000,-0.3106,0.2913 +0.9083,-0.0000,-0.3130,0.2776 +0.9083,-0.0000,-0.3130,0.2776 +0.9083,-0.0000,-0.3130,0.2776 +0.9083,-0.0000,-0.3130,0.2776 +0.9116,-0.0000,-0.3154,0.2638 +0.9116,-0.0000,-0.3154,0.2638 +0.9116,-0.0000,-0.3154,0.2638 +0.9116,-0.0000,-0.3154,0.2638 +0.9146,-0.0000,-0.3179,0.2500 +0.9146,-0.0000,-0.3179,0.2500 +0.9146,-0.0000,-0.3179,0.2500 +0.9146,-0.0000,-0.3179,0.2500 +0.9174,-0.0000,-0.3204,0.2363 +0.9174,-0.0000,-0.3204,0.2363 +0.9174,-0.0000,-0.3204,0.2363 +0.9174,-0.0000,-0.3204,0.2363 +0.9199,-0.0000,-0.3229,0.2226 +0.9199,-0.0000,-0.3229,0.2226 +0.9199,-0.0000,-0.3229,0.2226 +0.9199,-0.0000,-0.3229,0.2226 +0.9222,-0.0000,-0.3256,0.2089 +0.9222,-0.0000,-0.3256,0.2089 +0.9222,-0.0000,-0.3256,0.2089 +0.9222,-0.0000,-0.3256,0.2089 +0.9242,-0.0000,-0.3282,0.1952 +0.9242,-0.0000,-0.3282,0.1952 +0.9242,-0.0000,-0.3282,0.1952 +0.9242,-0.0000,-0.3282,0.1952 +0.9260,-0.0000,-0.3309,0.1817 +0.9260,-0.0000,-0.3309,0.1817 +0.9260,-0.0000,-0.3309,0.1817 +0.9260,-0.0000,-0.3309,0.1817 +0.9276,-0.0000,-0.3337,0.1681 +0.9276,-0.0000,-0.3337,0.1681 +0.9276,-0.0000,-0.3337,0.1681 +0.9276,-0.0000,-0.3337,0.1681 +0.9289,-0.0000,-0.3366,0.1546 +0.9289,-0.0000,-0.3366,0.1546 +0.9289,-0.0000,-0.3366,0.1546 +0.9289,-0.0000,-0.3366,0.1546 +0.9300,-0.0000,-0.3395,0.1412 +0.9300,-0.0000,-0.3395,0.1412 +0.9300,-0.0000,-0.3395,0.1412 +0.9300,-0.0000,-0.3395,0.1412 +0.9308,-0.0000,-0.3424,0.1279 +0.9308,-0.0000,-0.3424,0.1279 +0.9308,-0.0000,-0.3424,0.1279 +0.9308,-0.0000,-0.3424,0.1279 +0.9314,-0.0000,-0.3454,0.1146 +0.9314,-0.0000,-0.3454,0.1146 +0.9314,-0.0000,-0.3454,0.1146 +0.9314,-0.0000,-0.3454,0.1146 +0.9318,-0.0000,-0.3485,0.1015 +0.9318,-0.0000,-0.3485,0.1015 +0.9318,-0.0000,-0.3485,0.1015 +0.9318,-0.0000,-0.3485,0.1015 +0.9320,-0.0000,-0.3516,0.0884 +0.9320,-0.0000,-0.3516,0.0884 +0.9320,-0.0000,-0.3516,0.0884 +0.9320,-0.0000,-0.3516,0.0884 +0.9319,-0.0000,-0.3548,0.0754 +0.9319,-0.0000,-0.3548,0.0754 +0.9319,-0.0000,-0.3548,0.0754 +0.9319,-0.0000,-0.3548,0.0754 +0.9316,-0.0000,-0.3581,0.0625 +0.9316,-0.0000,-0.3581,0.0625 +0.9316,-0.0000,-0.3581,0.0625 +0.9316,-0.0000,-0.3581,0.0625 +0.9311,-0.0000,-0.3614,0.0498 +0.9311,-0.0000,-0.3614,0.0498 +0.9311,-0.0000,-0.3614,0.0498 +0.9311,-0.0000,-0.3614,0.0498 +0.9303,-0.0000,-0.3648,0.0371 +0.9303,-0.0000,-0.3648,0.0371 +0.9303,-0.0000,-0.3648,0.0371 +0.9303,-0.0000,-0.3648,0.0371 +0.9294,-0.0000,-0.3683,0.0246 +0.9294,-0.0000,-0.3683,0.0246 +0.9294,-0.0000,-0.3683,0.0246 +0.9294,-0.0000,-0.3683,0.0246 +0.9282,-0.0000,-0.3718,0.0122 +0.9282,-0.0000,-0.3718,0.0122 +0.9282,-0.0000,-0.3718,0.0122 +0.9282,-0.0000,-0.3718,0.0122 +0.9269,-0.0000,-0.3754,-0.0000 +0.9269,-0.0000,-0.3754,-0.0000 +0.9269,-0.0000,-0.3754,-0.0000 +0.9269,-0.0000,-0.3754,-0.0000 diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index 866d2eee2c..690f495c7f 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -26,12 +26,10 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ - import pytest from .utils import * - """ Ambisonics """ @@ -58,6 +56,156 @@ def test_ambisonics_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file): ) +# Test compares rendering with just a trajectory file against rendering with a trajectory file + a zero ref rotation. +# These should be binary equivalent. +@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +def test_ambisonics_binaural_headrotation_refrotzero(test_info, in_fmt, out_fmt, trj_file): + compare_renderer_args( + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refrotzero", + "trj_file": HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv") + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + "refrot_file": HR_TRAJECTORY_DIR.joinpath("const000.csv") + } + ) + + +# Second test compares rendering with no head rotation against rendering with equal ref and head rotation. +# These should also be binary equivalent. +# Note that reference rotation is supplied per 4 subframes; head rotation per subframe. +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +def test_ambisonics_binaural_headrotation_refrotequal(test_info, in_fmt, out_fmt): + compare_renderer_args( + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refrotequal", + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath("azi_plus_2-ele_plus_2-every-100-frames.csv"), + "refrot_file": HR_TRAJECTORY_DIR.joinpath("azi_plus_2-ele_plus_2-every-25-rows.csv") + } + ) + +# This test compares rendering with: +# ref: head rotation trajectory file (OTR=NONE) +# cut: identical head rotation trajectory file as ref but in addition a constant +# reference vector in the looking direction of the coordinate system (OTR=REF_VEC) +@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +def test_ambisonics_binaural_headrotation_refveczero(test_info, in_fmt, out_fmt, trj_file): + compare_renderer_args( + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refveczero", + "trj_file": HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv") + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + "refvec_file": HR_TRAJECTORY_DIR.joinpath("const000-Vector3.csv") + } + ) + +# This test compares rendering with: +# ref: no head rotation (OTR=NONE) +# cut: rendering with head rotation and a ref vector which moves in the +# looking-direction of the head rotation and therefore compensates it (OTR=REF_VEC) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +def test_ambisonics_binaural_headrotation_refvecequal(test_info, in_fmt, out_fmt): + compare_renderer_args( + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refvecequal", + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s.csv"), + "refvec_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s-Vector3.csv") + } + ) + +# This test compares rendering with: +# ref: a head rotation trajectory with elevation (OTR=NONE) +# cut: a static head rotation and a reference position trajectory which moves +# in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +def test_ambisonics_binaural_headrotation_refvec_rotating(test_info, in_fmt, out_fmt): + compare_renderer_args( + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refvec_rotating", + "trj_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s.csv"), + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), + "refvec_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s-ccw-Vector3.csv") + } + ) + +# This test compares rendering with: +# ref: a head rotation trajectory with elevation (OTR=NONE) +# cut: a static head rotation and a reference position trajectory which moves +# in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) +# which also contains a fixed position offset between listener and reference position (which +# gets compensated in the REF_VEV OTR modes) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +def test_ambisonics_binaural_headrotation_refvec_rotating_fixed_pos_offset(test_info, in_fmt, out_fmt): + compare_renderer_args( + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refvec_rotating", + "trj_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s-ccw.csv"), + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), + "refvec_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s-fixed-pos-offset-Vector3.csv") + } + ) + +# This test compares rendering with: +# ref: a reference position trajectory with elevation and REF_VEC_LEV OTR mode (OTR=REF_VEC_LEV) +# cut: a reference position trajectory without the elevation and REF_VEC OTR mode (OTR=REF_VEC) +# Since the only difference between REF_VEC_LEV and REF_VEC is that *LEV ignores +# the height difference in positions, the output must be binary equivalent. +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +def test_ambisonics_binaural_headrotation_refveclev_vs_refvec(test_info, in_fmt, out_fmt): + compare_renderer_args( + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refveclevel", + "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), + "refveclev_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s-Vector3.csv"), + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), + "refvec_file": HR_TRAJECTORY_DIR.joinpath("full-circle-4s-Vector3.csv") + } + ) + + """ Multichannel """ @@ -96,6 +244,30 @@ def test_multichannel_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), ) +# This test compares rendering with: +# ref: a head rotation trajectory with elevation (OTR=NONE) +# cut: a static head rotation and a reference position trajectory which moves +# in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) +def test_multichannel_binaural_headrotation_refvec_rotating(test_info, in_fmt, out_fmt): + if in_fmt in ["MONO", "STEREO"]: + pytest.skip("MONO or STEREO to Binaural rendering unsupported") + + compare_renderer_args( + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refvec_rotating", + "trj_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s.csv"), + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), + "refvec_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s-ccw-Vector3.csv") + } + ) + """ ISM """ @@ -144,6 +316,33 @@ def test_ism_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file): in_meta_files=in_meta_files, ) +# This test compares rendering with: +# ref: a head rotation trajectory with elevation (OTR=NONE) +# cut: a static head rotation and a reference position trajectory which moves +# in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) +def test_ism_binaural_headrotation_refvec_rotating(test_info, in_fmt, out_fmt): + try: + in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt] + except: + in_meta_files = None + + compare_renderer_args( + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refvec_rotating", + "trj_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s.csv"), + "in_meta_files": in_meta_files + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), + "refvec_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s-ccw-Vector3.csv"), + "in_meta_files": in_meta_files + } + ) """ MASA """ diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index 143c33b066..7a98dff300 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -31,12 +31,11 @@ import subprocess as sp import sys from pathlib import Path from tempfile import TemporaryDirectory -from typing import Optional, Tuple +from typing import Optional, Tuple, Dict import numpy as np import pytest - from .compare_audio import compare_audio_arrays from .constants import * @@ -106,6 +105,10 @@ def run_renderer( metadata_input: Optional[str] = None, in_meta_files: Optional[list] = None, trj_file: Optional[str] = None, + name_extension: Optional[str] = None, + refrot_file: Optional[str] = None, + refvec_file: Optional[str] = None, + refveclev_file: Optional[str] = None, output_path_base: str = OUTPUT_PATH_CUT, binary_suffix: str = "", is_comparetest: Optional[bool] = False, @@ -116,6 +119,23 @@ def run_renderer( else: trj_name = "" + if refrot_file is not None: + refrot_name = f"_{refrot_file.stem}" + else: + refrot_name = "" + + if refvec_file is not None: + refvec_name = f"_{refvec_file.stem}" + else: + refvec_name = "" + + if refveclev_file is not None: + refveclev_name = f"_{refveclev_file.stem}" + else: + refveclev_name = "" + + + if not isinstance(out_fmt, str): out_name = f"{out_fmt.stem}" else: @@ -136,7 +156,7 @@ def run_renderer( in_file = FORMAT_TO_FILE[in_fmt] in_name = in_fmt - out_file = str(output_path_base.joinpath(f"{in_name}_to_{out_name}{trj_name}.wav")) + out_file = str(output_path_base.joinpath(f"{in_name}_to_{out_name}{trj_name}{refrot_name}{refvec_name}{refveclev_name}{name_extension}.wav")) cmd = RENDERER_CMD[:] cmd[2] = str(in_file) @@ -152,6 +172,18 @@ def run_renderer( if trj_file is not None: cmd.extend(["-tf", str(trj_file)]) + if refrot_file is not None: + cmd.extend(["-rf", str(refrot_file)]) + cmd.extend(["-otr", "ref"]) + + if refvec_file is not None: + cmd.extend(["-rvf", str(refvec_file)]) + cmd.extend(["-otr", "ref_vec"]) + + if refveclev_file is not None: + cmd.extend(["-rvf", str(refveclev_file)]) + cmd.extend(["-otr", "ref_vec_lev"]) + run_cmd(cmd) return pyaudio3dtools.audiofile.readfile(out_file) @@ -222,3 +254,8 @@ def compare_renderer_vs_pyscripts(test_info, in_fmt, out_fmt, **kwargs): ref, ref_fs = run_pyscripts(in_fmt, out_fmt, **kwargs) cut, cut_fs = run_renderer(in_fmt, out_fmt, **kwargs) check_BE(test_info, ref, ref_fs, cut, cut_fs) + +def compare_renderer_args(test_info, in_fmt, out_fmt, ref_kwargs: Dict, cut_kwargs: Dict): + ref, ref_fs = run_renderer(in_fmt, out_fmt, **ref_kwargs) + cut, cut_fs = run_renderer(in_fmt, out_fmt, **cut_kwargs) + check_BE(test_info, ref, ref_fs, cut, cut_fs) \ No newline at end of file -- GitLab From 3e78c239db89c956cf410b83e2daee374cd021ee Mon Sep 17 00:00:00 2001 From: malenov Date: Tue, 28 Mar 2023 18:59:52 +0200 Subject: [PATCH 23/43] re-integrate IND_LIST_DYN --- lib_com/bitstream.c | 552 +++++++++++++++++++++++++- lib_com/cnst.h | 2 + lib_com/ivas_cnst.h | 6 +- lib_com/ivas_prot.h | 13 +- lib_com/options.h | 2 +- lib_com/prot.h | 35 ++ lib_enc/acelp_core_switch_enc.c | 17 + lib_enc/cng_enc.c | 8 + lib_enc/dtx.c | 8 +- lib_enc/enc_ppp.c | 9 +- lib_enc/eval_pit_contr.c | 8 + lib_enc/fd_cng_enc.c | 17 +- lib_enc/igf_enc.c | 82 ++++ lib_enc/init_enc.c | 16 + lib_enc/ivas_core_enc.c | 25 +- lib_enc/ivas_corecoder_enc_reconfig.c | 225 ++++++++++- lib_enc/ivas_cpe_enc.c | 26 +- lib_enc/ivas_init_enc.c | 68 +++- lib_enc/ivas_ism_dtx_enc.c | 17 +- lib_enc/ivas_ism_metadata_enc.c | 4 + lib_enc/ivas_lfe_enc.c | 31 ++ lib_enc/ivas_masa_enc.c | 33 ++ lib_enc/ivas_qmetadata_enc.c | 91 ++++- lib_enc/ivas_sce_enc.c | 25 +- lib_enc/ivas_spar_encoder.c | 6 +- lib_enc/ivas_spar_md_enc.c | 39 +- lib_enc/ivas_stereo_mdct_core_enc.c | 19 + lib_enc/lib_enc.c | 35 +- lib_enc/stat_enc.h | 18 +- lib_enc/tcx_utils_enc.c | 16 + 30 files changed, 1375 insertions(+), 78 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index e5f72590a6..c28c04112b 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -62,6 +62,11 @@ FILE *FEC_pattern = NULL; /* FEC pattern file (for simulation of FEC) */ #endif +#ifdef IND_LIST_DYN +#define STEP_MAX_NUM_INDICES 20 /* increase the maximum number of allowed indices in the list by this amount */ +#endif + +#ifndef IND_LIST_DYN /*-------------------------------------------------------------------* * pack_bit() * @@ -115,6 +120,7 @@ static Word16 unpack_bit( return bit; } +#endif /*-------------------------------------------------------------------* * rate2AMRWB_IOmode() @@ -214,6 +220,238 @@ Word16 rate2EVSmode( return rate2AMRWB_IOmode( brate ); } +#ifdef IND_LIST_DYN +/*-------------------------------------------------------------------* + * ind_list_realloc() + * + * Re-allocate the list of indices as the maximum number of allowed indices has changed + *-------------------------------------------------------------------*/ + +ivas_error ind_list_realloc( + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + int16_t max_num_indices /* i : new maximum number of allowed indices in the list */ +) +{ + int16_t i; + INDICE_HANDLE new_ind_list; + + /* allocate new buffer of indices */ + if ( ( new_ind_list = (INDICE_HANDLE) malloc( max_num_indices * sizeof( Indice ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); + } + + /* move indices from the old list to the new list */ + i = 0; + while ( hBstr->ind_list[i].nb_bits > 0 ) + { + new_ind_list[i].id = hBstr->ind_list[i].id; + new_ind_list[i].value = hBstr->ind_list[i].value; + new_ind_list[i].nb_bits = hBstr->ind_list[i].nb_bits; + i++; + } + + /* reset nb_bits of all other indices to -1 */ + for ( ; i < max_num_indices; i++ ) + { + new_ind_list[i].nb_bits = -1; + } + + /* free the old list */ + free( hBstr->ind_list ); + + /* set pointer to the new list */ + hBstr->ind_list = new_ind_list; + + /* set the new maximum for the allowed number of indices */ + hBstr->max_num_indices = max_num_indices; + + return IVAS_ERR_OK; +} + + +/*-----------------------------------------------------------------------* + * get_max_num_indices() + * + * Set the maximum allowed number of indices in the list + *-----------------------------------------------------------------------*/ + +int16_t get_max_num_indices( /* o : maximum number of indices */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t total_brate /* i : total bitrate */ +) +{ + /* set the maximum required number of indices */ + if ( ivas_format == MONO_FORMAT ) + { + if ( total_brate < IVAS_24k4 ) + { + return 450; + } + else + { + return 450; + } + } + else if ( ivas_format == STEREO_FORMAT ) + { + if ( total_brate < IVAS_24k4 ) + { + return 250; + } + else if ( total_brate < IVAS_128k ) + { + return 450; + } + else + { + return 550; + } + } + else if ( ivas_format == ISM_FORMAT ) + { + if ( total_brate < IVAS_24k4 ) + { + return 250; + } + else if ( total_brate < IVAS_128k ) + { + return 450; + } + else + { + return 700; + } + } + else if ( ivas_format == SBA_FORMAT ) + { + if ( total_brate < IVAS_24k4 ) + { + return 250; + } + else if ( total_brate < IVAS_128k ) + { + return 450; + } + else + { + return 700; + } + } + else if ( ivas_format == MASA_FORMAT ) + { + if ( total_brate < IVAS_24k4 ) + { + return 250; + } + else if ( total_brate < IVAS_160k ) + { + return 450; + } + else + { + return 700; + } + } + else if ( ivas_format == MC_FORMAT ) + { + if ( total_brate < IVAS_24k4 ) + { + return 450; + } + else + { + return 1050; + } + } + + return 1050; +} + +#ifdef IND_LIST_DYN +/*-----------------------------------------------------------------------* + * set_max_set_max_num_indices_metadatanum_indices() + * + * Set the maximum allowed number of metadata indices in the list + *-----------------------------------------------------------------------*/ + +int16_t get_max_num_indices_metadata( /* o : maximum number of indices */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ +) +{ + /* set the maximum required number of metadata indices */ + if ( ivas_format == MONO_FORMAT ) + { + return 0; + } + else if ( ivas_format == STEREO_FORMAT ) + { + return 80; + } + else if ( ivas_format == ISM_FORMAT ) + { + return 60; + } + else if ( ivas_format == SBA_FORMAT ) + { + if ( ivas_total_brate < IVAS_24k4 ) + { + return 80; + } + else if ( ivas_total_brate < IVAS_48k ) + { + return 670; + } + else + { + return 1060; + } + } + else if ( ivas_format == MASA_FORMAT ) + { + if ( ivas_total_brate < IVAS_32k ) + { + return 90; + } + else if ( ivas_total_brate < IVAS_48k ) + { + return 130; + } + else if ( ivas_total_brate < IVAS_192k ) + { + return 330; + } + else if ( ivas_total_brate < IVAS_384k ) + { + return 1000; + } + else + { + return 1950; + } + } + else if ( ivas_format == MC_FORMAT ) + { + if ( ivas_total_brate == IVAS_32k || ivas_total_brate == IVAS_48k || ivas_total_brate == IVAS_64k ) + { + return 300; + } + if ( ivas_total_brate == IVAS_80k || ivas_total_brate == IVAS_96k ) + { + return 170; + } + else + { + return 90; + } + } + + return 1050; +} +#endif +#endif + /*-------------------------------------------------------------------* * push_indice() * @@ -237,6 +475,9 @@ ivas_error push_indice( ) { int16_t i; +#ifdef IND_LIST_DYN + int16_t j; +#endif ivas_error error; error = IVAS_ERR_OK; @@ -263,12 +504,48 @@ ivas_error push_indice( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice ID = %d with value %d is trying to allocate %d bits which exceeds 16 bits (frame %d) !\n", id, value, nb_bits, frame ); } +#ifndef IND_LIST_DYN if ( id >= MAX_NUM_INDICES ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice ID = %d exceeds the total number of indices: %d (frame %d) !\n", id, MAX_NUM_INDICES, frame ); } #endif +#endif +#ifdef IND_LIST_DYN + /* check, if the maximum number of indices has been reached and re-allocate the buffer */ + /* the re-allocation can be avoided by increasing the limits in get_max_num_indices() and get_max_num_indices_metadata() */ + if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) + { +#ifdef DEBUGGING + DEBUG_LINE( 1 ) + printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); +#endif + + /* reallocate the buffer of indices with increased limit */ + ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); + } +#endif + +#ifdef IND_LIST_DYN + /* find the location in the list of indices */ + i = hBstr->nb_ind_tot; + while ( i > 0 && id < hBstr->ind_list[i - 1].id ) + { + i--; + } + + /* shift indices, if the new id is to be written somewhere inside the list */ + if ( i < hBstr->nb_ind_tot ) + { + for ( j = hBstr->nb_ind_tot; j > i; j-- ) + { + hBstr->ind_list[j].id = hBstr->ind_list[j - 1].id; + hBstr->ind_list[j].nb_bits = hBstr->ind_list[j - 1].nb_bits; + hBstr->ind_list[j].value = hBstr->ind_list[j - 1].value; + } + } +#else if ( hBstr->last_ind == id ) { /* indice with the same name as the previous one */ @@ -283,21 +560,31 @@ ivas_error push_indice( i++; } } +#endif +#ifndef IND_LIST_DYN #ifdef DEBUGGING if ( hBstr->ind_list[i].nb_bits > 0 ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice ID = %d with value %d is trying to re-write an existing indice (frame %d) !\n", id, value, frame ); } +#endif #endif /* store the new indice in the list */ +#ifdef IND_LIST_DYN + hBstr->ind_list[i].id = id; +#endif hBstr->ind_list[i].value = value; hBstr->ind_list[i].nb_bits = nb_bits; /* updates */ +#ifdef IND_LIST_DYN + hBstr->nb_ind_tot++; +#else hBstr->next_ind = i + 1; hBstr->last_ind = id; +#endif hBstr->nb_bits_tot += nb_bits; return error; @@ -324,6 +611,9 @@ ivas_error push_next_indice( #endif ) { +#ifdef IND_LIST_DYN + int16_t prev_id; +#endif ivas_error error; error = IVAS_ERR_OK; @@ -342,6 +632,7 @@ ivas_error push_next_indice( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice with value %d is trying to allocate %d bits which exceeds 16 bits !\n", value, nb_bits ); } +#ifndef IND_LIST_DYN if ( hBstr->next_ind >= MAX_NUM_INDICES ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Total number of indices exceeded: %d !\n", MAX_NUM_INDICES ); @@ -352,16 +643,54 @@ ivas_error push_next_indice( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice with value %d is trying to re-write an existing indice (frame %d) !\n", value, frame ); } #endif +#endif + +#ifdef IND_LIST_DYN + /* check, if the maximum number of indices has been reached and re-allocate the buffer */ + /* the re-allocation can be avoided by increasing the limits in get_max_num_indices() and get_max_num_indices_metadata() */ + if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) + { +#ifdef DEBUGGING + DEBUG_LINE( 1 ) + printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); +#endif + + /* reallocate the buffer of indices with increased limit */ + ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); + } +#endif + + +#ifdef IND_LIST_DYN + /* get the id of the previous indice -> it will be re-used */ + if ( hBstr->nb_ind_tot > 0 ) + { + prev_id = hBstr->ind_list[hBstr->nb_ind_tot - 1].id; + } + else + { + prev_id = 0; + } +#endif /* store the values in the list */ +#ifdef IND_LIST_DYN + hBstr->ind_list[hBstr->nb_ind_tot].id = prev_id; + hBstr->ind_list[hBstr->nb_ind_tot].value = value; + hBstr->ind_list[hBstr->nb_ind_tot].nb_bits = nb_bits; +#else hBstr->ind_list[hBstr->next_ind].value = value; hBstr->ind_list[hBstr->next_ind].nb_bits = nb_bits; - hBstr->next_ind++; +#endif - /* update the total number of bits already written */ + /* updates */ +#ifdef IND_LIST_DYN + hBstr->nb_ind_tot++; +#else + hBstr->next_ind++; +#endif hBstr->nb_bits_tot += nb_bits; - return error; } @@ -389,10 +718,28 @@ void push_next_bits( uint16_t code; int16_t i, nb_bits_m15; Indice *ptr; +#ifdef IND_LIST_DYN + int16_t prev_id; +#endif #ifdef DEBUG_BS_READ_WRITE printf( "%s: %d: %d\n", func, line, nb_bits ); #endif + +#ifdef IND_LIST_DYN + ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; + + /* get the id of the previous indice -> will be re-used here as well */ + if ( hBstr->nb_ind_tot > 0 ) + { + prev_id = hBstr->ind_list[hBstr->nb_ind_tot - 1].id; + } + else + { + prev_id = 0; + } +#else ptr = &hBstr->ind_list[hBstr->next_ind]; +#endif nb_bits_m15 = nb_bits - 15; for ( i = 0; i < nb_bits_m15; i += 16 ) @@ -404,8 +751,29 @@ void push_next_bits( printf( "code: %d\n", code ); #endif ptr->nb_bits = 16; +#ifdef IND_LIST_DYN + ptr->id = prev_id; + hBstr->nb_ind_tot++; +#endif + +#ifdef IND_LIST_DYN + /* check, if the maximum number of indices has been reached and re-allocate the buffer */ + /* the re-allocation can be avoided by increasing the limits in get_max_num_indices() and get_max_num_indices_metadata() */ + if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) + { +#ifdef DEBUGGING + DEBUG_LINE( 1 ) + printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); +#endif + + /* reallocate the buffer of indices with increased limit */ + ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); + } +#endif + ++ptr; } + for ( ; i < nb_bits; ++i ) { ptr->value = bits[i]; @@ -413,15 +781,118 @@ void push_next_bits( printf( "value: %d\n", ptr->value ); #endif ptr->nb_bits = 1; +#ifdef IND_LIST_DYN + ptr->id = prev_id; + hBstr->nb_ind_tot++; +#endif + +#ifdef IND_LIST_DYN + /* check, if the maximum number of indices has been reached and re-allocate the buffer */ + /* the re-allocation can be avoided by increasing the limits in get_max_num_indices() and get_max_num_indices_metadata() */ + if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) + { +#ifdef DEBUGGING + DEBUG_LINE( 1 ) + printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); +#endif + + /* reallocate the buffer of indices with increased limit */ + ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); + } +#endif + ++ptr; } + +#ifndef IND_LIST_DYN hBstr->next_ind = (int16_t) ( ptr - hBstr->ind_list ); +#endif hBstr->nb_bits_tot = hBstr->nb_bits_tot + nb_bits; return; } +#ifdef IND_LIST_DYN +/*-------------------------------------------------------------------* + * find_indice() + * + * Find indice based on its id + *-------------------------------------------------------------------*/ + +/*! r: result: index of the indice in the list, -1 if not found */ +int16_t find_indice( + BSTR_ENC_HANDLE hBstr, /* i : encoder bitstream handle */ + int16_t id, /* i : ID of the indice */ + uint16_t *value, /* o : value of the quantized indice */ + int16_t *nb_bits /* o : number of bits used to quantize the indice */ +) +{ + int16_t i; + + for ( i = 0; i < hBstr->nb_ind_tot; i++ ) + { + if ( hBstr->ind_list[i].id == id && hBstr->ind_list[i].nb_bits > 0 ) + { + *value = hBstr->ind_list[i].value; + *nb_bits = hBstr->ind_list[i].nb_bits; + return i; + } + } + + return -1; +} + +/*-------------------------------------------------------------------* + * delete_indice() + * + * Delete indice based on its id (note, that nb_ind_tot and nb_bits_tot are updated) + *-------------------------------------------------------------------*/ + +/*! r: number of deleted indices */ +uint16_t delete_indice( + BSTR_ENC_HANDLE hBstr, /* i : encoder bitstream handle */ + int16_t id /* i : ID of the indice */ +) +{ + int16_t i, j; + + j = 0; + for ( i = 0; i < hBstr->nb_ind_tot; i++ ) + { + if ( hBstr->ind_list[i].id == id ) + { + hBstr->nb_bits_tot -= hBstr->ind_list[i].nb_bits; + continue; + } + + if ( j < i ) + { + /* shift the indice left */ + hBstr->ind_list[j].id = hBstr->ind_list[i].id; + hBstr->ind_list[j].value = hBstr->ind_list[i].value; + hBstr->ind_list[j].nb_bits = hBstr->ind_list[i].nb_bits; + } + + j++; + } + + hBstr->nb_ind_tot = j; +#ifndef IND_LIST_DYN + hBstr->next_ind = j; +#endif + + for ( ; j < i; j++ ) + { + /* reset the shifted indices at the end of the list */ + hBstr->ind_list[j].nb_bits = -1; + } + + return i - j; +} +#endif + + /*-------------------------------------------------------------------* * get_next_indice() * @@ -638,8 +1109,14 @@ void reset_indices_enc( int16_t i; hBstr->nb_bits_tot = 0; +#ifdef IND_LIST_DYN + hBstr->nb_ind_tot = 0; +#else hBstr->next_ind = 0; +#endif +#ifndef IND_LIST_DYN hBstr->last_ind = -1; +#endif for ( i = 0; i < max_num_indices; i++ ) { @@ -670,7 +1147,11 @@ void reset_indices_dec( *-------------------------------------------------------------------*/ static int16_t write_indices_to_stream( +#ifdef IND_LIST_DYN + Indice *ind_list, +#else Indice *ind_list_metadata, +#endif uint16_t **pt_stream, const int16_t inc, const int16_t num_indices ) @@ -684,8 +1165,13 @@ static int16_t write_indices_to_stream( for ( i = 0; i < num_indices; i++ ) { +#ifdef IND_LIST_DYN + value = ind_list[i].value; + nb_bits = ind_list[i].nb_bits; +#else value = ind_list_metadata[i].value; nb_bits = ind_list_metadata[i].nb_bits; +#endif if ( nb_bits > 0 ) { @@ -717,6 +1203,10 @@ static int16_t write_indices_to_stream( { /* fprintf( stderr, "Warning: %s: nb_bits == 0!\n", __func__ ); */ } + else + { + /* fprintf( stderr, "Warning: %s: nb_bits == %d!\n", __func__, nb_bits ); */ + } #endif } #ifdef ENABLE_BITRATE_VERIFICATION @@ -745,6 +1235,10 @@ static ivas_error write_indices_element( uint16_t *pt_stream_backup; uint16_t *pt_stream_end; int16_t nb_bits_tot_metadata; +#ifdef IND_LIST_DYN + int16_t nb_ind_tot_metadata; +#endif + Indice *ind_list_metadata; int16_t n, n_channels; #ifdef ENABLE_BITRATE_VERIFICATION @@ -755,6 +1249,9 @@ static ivas_error write_indices_element( error = IVAS_ERR_OK; ind_list_metadata = NULL; +#ifdef IND_LIST_DYN + nb_ind_tot_metadata = 0; +#endif if ( st_ivas->hEncoderConfig->ivas_format == MONO_FORMAT ) { @@ -772,6 +1269,9 @@ static ivas_error write_indices_element( { nb_bits_tot_metadata = st_ivas->hSCE[element_id]->hMetaData->nb_bits_tot; ind_list_metadata = st_ivas->hSCE[element_id]->hMetaData->ind_list; +#ifdef IND_LIST_DYN + nb_ind_tot_metadata = st_ivas->hSCE[element_id]->hMetaData->nb_ind_tot; +#endif } } else if ( !is_SCE && st_ivas->hCPE[element_id] != NULL ) @@ -782,6 +1282,9 @@ static ivas_error write_indices_element( { nb_bits_tot_metadata = st_ivas->hCPE[element_id]->hMetaData->nb_bits_tot; ind_list_metadata = st_ivas->hCPE[element_id]->hMetaData->ind_list; +#ifdef IND_LIST_DYN + nb_ind_tot_metadata = st_ivas->hCPE[element_id]->hMetaData->nb_ind_tot; +#endif } } #ifdef DEBUGGING @@ -822,7 +1325,13 @@ static ivas_error write_indices_element( #ifdef ENABLE_BITRATE_VERIFICATION total_nb_bits = #endif - write_indices_to_stream( ind_list_metadata, &pt_stream_loc, -1, MAX_BITS_METADATA ); + write_indices_to_stream( ind_list_metadata, &pt_stream_loc, -1, +#ifdef IND_LIST_DYN + nb_ind_tot_metadata +#else + MAX_BITS_METADATA +#endif + ); #ifdef ENABLE_BITRATE_VERIFICATION if ( total_nb_bits != nb_bits_tot_metadata ) @@ -842,7 +1351,13 @@ static ivas_error write_indices_element( #ifdef ENABLE_BITRATE_VERIFICATION total_nb_bits = #endif - write_indices_to_stream( sts[n]->hBstr->ind_list, &pt_stream_loc, 1, MAX_NUM_INDICES ); + write_indices_to_stream( sts[n]->hBstr->ind_list, &pt_stream_loc, 1, +#ifdef IND_LIST_DYN + sts[n]->hBstr->nb_ind_tot +#else + MAX_NUM_INDICES +#endif + ); #ifdef ENABLE_BITRATE_VERIFICATION if ( total_nb_bits != sts[n]->hBstr->nb_bits_tot ) @@ -865,21 +1380,41 @@ static ivas_error write_indices_element( { if ( st_ivas->hSCE[element_id]->hMetaData != NULL ) { +#ifdef IND_LIST_DYN + reset_indices_enc( st_ivas->hSCE[element_id]->hMetaData, st_ivas->hSCE[element_id]->hMetaData->max_num_indices ); +#else reset_indices_enc( st_ivas->hSCE[element_id]->hMetaData, MAX_BITS_METADATA ); +#endif } - reset_indices_enc( sts[0]->hBstr, MAX_NUM_INDICES ); + reset_indices_enc( sts[0]->hBstr, +#ifdef IND_LIST_DYN + sts[0]->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); } else { if ( st_ivas->hCPE[element_id]->hMetaData != NULL ) { +#ifdef IND_LIST_DYN + reset_indices_enc( st_ivas->hCPE[element_id]->hMetaData, st_ivas->hCPE[element_id]->hMetaData->max_num_indices ); +#else reset_indices_enc( st_ivas->hCPE[element_id]->hMetaData, MAX_BITS_METADATA ); +#endif } for ( n = 0; n < n_channels; n++ ) { - reset_indices_enc( sts[n]->hBstr, MAX_NUM_INDICES ); + reset_indices_enc( sts[n]->hBstr, +#ifdef IND_LIST_DYN + sts[n]->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); } } @@ -975,7 +1510,7 @@ ivas_error write_indices_ivas( return error; } - +#ifndef IND_LIST_DYN /*-------------------------------------------------------------------* * indices_to_serial_generic() * @@ -1025,6 +1560,7 @@ void indices_to_serial_generic( return; } +#endif /*---------------------------------------------------------------------* * convertSerialToBytestream( ) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index db1dc3d898..4f03276837 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -449,7 +449,9 @@ enum IND_STEREO_2ND_CODER_T, IND_UNUSED, +#ifndef IND_LIST_DYN MAX_NUM_INDICES = IND_UNUSED + 772 /* Total 2640 in line with MAX_BITS_METADATA */ +#endif }; /*----------------------------------------------------------------------------------* diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 3f48b0b43e..b3a022b8cd 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -176,8 +176,12 @@ typedef enum #define MAX_CPE ( MAX_TRANSPORT_CHANNELS / CPE_CHANNELS ) /* max. number of CPEs */ #define MAX_BITS_METADATA 2640 /* max. bit-budget of metadata, one channel */ /* IVAS_fmToDo: to be confirmed for final value once mature */ +#ifndef IND_LIST_DYN #define MAX_NUM_METADATA max( 2, MAX_NUM_OBJECTS ) /* number of max. metadata (now only 2 for DirAC) */ - +#endif +#ifdef IND_LIST_DYN +#define MAX_NUM_IND_TEMP_LIST 10 /* maximum number of indices in the temporary list */ +#endif #define IVAS_ENC_DELAY_NS ACELP_LOOK_NS #define IVAS_DEC_DELAY_NS 3250000L /* 3.25 ms: IVAS decoder delay (without renderer delay) */ diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index e8597bbf3c..9184997dea 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -262,9 +262,11 @@ void ivas_initialize_handles_enc( ); ivas_error ivas_init_encoder( - Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ - Indice ind_list[][MAX_NUM_INDICES], /* i : indices list */ - Indice ind_list_metadata[][MAX_BITS_METADATA] /* i : indices list metadata */ + Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ +#ifndef IND_LIST_DYN + ,Indice ind_list[][MAX_NUM_INDICES] /* i : indices list */ + ,Indice ind_list_metadata[][MAX_BITS_METADATA] /* i : indices list metadata */ +#endif ); void destroy_core_enc( @@ -2092,6 +2094,9 @@ void InternalTCXDecoder( void stereo_mdct_core_enc( CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ +#ifdef IND_LIST_DYN + const int16_t ivas_format, /* i : IVAS format */ +#endif float new_samples[CPE_CHANNELS][L_INP], /* i : new samples */ float old_wsp[CPE_CHANNELS][L_WSP], /* i : 12.8kHz weighted speech (for LTP */ float pitch_buf[CPE_CHANNELS][NB_SUBFR16k] /* o : floating pitch for each subframe */ @@ -3037,7 +3042,9 @@ void ivas_qmetadata_close( void restore_metadata_buffer( BSTR_ENC_HANDLE hMetaData, const int16_t next_ind_start, +#ifndef IND_LIST_DYN const int16_t last_ind_start, +#endif const int16_t bit_pos_start ); diff --git a/lib_com/options.h b/lib_com/options.h index c054a9b5a7..4d935aa8af 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -132,7 +132,7 @@ /* ################# Start DEVELOPMENT switches ######################## */ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ -#define BITSTREAM_INDICES_MEMORY /* Don't count memory for bitstream Indice at the encoder - it is a temporary solution for development only */ +#define IND_LIST_DYN /* VA: Issue 18: Dynamic allocation of ind_list[] and ind_list_metadata[] based on # of transport channels */ #define LSF_RE_USE_SECONDARY_CHANNEL /* TD stereo Secondary channel LSF Q improvement */ #ifdef LSF_RE_USE_SECONDARY_CHANNEL diff --git a/lib_com/prot.h b/lib_com/prot.h index c8f69fe832..72b29413c8 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -515,6 +515,35 @@ void push_next_bits( #endif ); +#ifdef IND_LIST_DYN +int16_t get_max_num_indices( /* o : maximum number of indices */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t total_brate /* i : total bitrate */ +); + +int16_t get_max_num_indices_metadata( /* o : maximum number of indices */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ +); + +ivas_error ind_list_realloc( + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + int16_t max_num_indices /* i : new maximum number of allowed indices in the list */ +); + +int16_t find_indice( /* o : index of the indice in the list, -1 if not found */ + BSTR_ENC_HANDLE hBstr, /* i : encoder bitstream handle */ + int16_t id, /* i : ID of the indice */ + uint16_t *value, /* o : value of the quantized indice */ + int16_t *nb_bits /* o : number of bits used to quantize the indice */ +); + +uint16_t delete_indice( /* o : number of deleted indices */ + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + int16_t id /* i : ID of the indice */ +); +#endif + /*! r: value of the indice */ #ifdef DEBUG_BS_READ_WRITE #define get_next_indice( ... ) get_next_indice_( __VA_ARGS__, __LINE__, __func__ ) @@ -613,12 +642,14 @@ Decoder_State **reset_elements( ); +#ifndef IND_LIST_DYN void indices_to_serial_generic( const Indice *ind_list, /* i : indices list */ const Word16 num_indices, /* i : number of indices to write */ UWord8 *pFrame, /* o : byte array with bit packet and byte aligned coded speech data */ Word16 *pFrame_size /* o : size of the binary encoded access unit [bits] */ ); +#endif void convertSerialToBytestream( const uint16_t *const serial, /* i : input serial bitstream with values 0 and 1 */ @@ -2223,8 +2254,12 @@ void read_next_force( int32_t *force_profile_cnt /* i/o: counter of frames for force switching profile file */ ); #endif + ivas_error init_encoder( Encoder_State *st, /* i/o: state structure */ +#ifdef IND_LIST_DYN + ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : encoder configuration handle */ +#endif const int16_t idchan, /* i : channel ID */ const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ const int16_t interval_SID, /* i : interval for SID update */ diff --git a/lib_enc/acelp_core_switch_enc.c b/lib_enc/acelp_core_switch_enc.c index 291c2128a1..1a3488d92d 100644 --- a/lib_enc/acelp_core_switch_enc.c +++ b/lib_enc/acelp_core_switch_enc.c @@ -73,6 +73,10 @@ void acelp_core_switch_enc( const float *inp; int32_t cbrate; float Aq[2 * ( M + 1 )]; +#ifdef IND_LIST_DYN + uint16_t value; + int16_t nb_bits; +#endif BSTR_ENC_HANDLE hBstr = st->hBstr; /* initializations */ @@ -159,12 +163,25 @@ void acelp_core_switch_enc( * Manipulate ACELP subframe indices (move them to their proper place) *----------------------------------------------------------------*/ +#ifdef IND_LIST_DYN + i = find_indice( hBstr, TAG_ACELP_SUBFR_LOOP_START, &value, &nb_bits ); +#ifdef DEBUGGING + assert( i >= 0 && "Internal error in ACELP core switching - unable to find ACELP subframe indices!" ); +#endif + while ( hBstr->ind_list[i].id == TAG_ACELP_SUBFR_LOOP_START ) + { + push_indice( hBstr, IND_CORE_SWITCHING_CELP_SUBFRAME, hBstr->ind_list[i].value, hBstr->ind_list[i].nb_bits ); + i++; + } + delete_indice( hBstr, TAG_ACELP_SUBFR_LOOP_START ); +#else for ( i = 0; i < 20; i++ ) { hBstr->ind_list[IND_CORE_SWITCHING_CELP_SUBFRAME + i].value = hBstr->ind_list[TAG_ACELP_SUBFR_LOOP_START + i].value; hBstr->ind_list[IND_CORE_SWITCHING_CELP_SUBFRAME + i].nb_bits = hBstr->ind_list[TAG_ACELP_SUBFR_LOOP_START + i].nb_bits; hBstr->ind_list[TAG_ACELP_SUBFR_LOOP_START + i].nb_bits = -1; } +#endif /*----------------------------------------------------------------* * BWE encoding diff --git a/lib_enc/cng_enc.c b/lib_enc/cng_enc.c index 04d9e41166..0f17b82923 100644 --- a/lib_enc/cng_enc.c +++ b/lib_enc/cng_enc.c @@ -885,8 +885,12 @@ void swb_CNG_enc( else if ( st->element_mode == IVAS_CPE_DFT && st->core_brate == SID_2k40 ) { /* LF-boost not used in DFT-stereo, instead the bandwidth is transmitted */ +#ifdef IND_LIST_DYN + delete_indice( st->hBstr, IND_CNG_ENV1 ); +#else st->hBstr->nb_bits_tot = st->hBstr->nb_bits_tot - st->hBstr->ind_list[IND_CNG_ENV1].nb_bits; st->hBstr->ind_list[IND_CNG_ENV1].nb_bits = -1; +#endif push_indice( st->hBstr, IND_BWIDTH, st->bwidth, 2 ); push_indice( st->hBstr, IND_UNUSED, 0, 4 ); push_indice( st->hBstr, IND_SID_BW, 1, 1 ); @@ -962,8 +966,12 @@ static void shb_CNG_encod( push_indice( hBstr, IND_SHB_CNG_GAIN, idx_ener, 4 ); push_indice( hBstr, IND_SID_BW, 1, 1 ); +#ifdef IND_LIST_DYN + delete_indice( hBstr, IND_CNG_ENV1 ); +#else hBstr->nb_bits_tot = hBstr->nb_bits_tot - hBstr->ind_list[IND_CNG_ENV1].nb_bits; hBstr->ind_list[IND_CNG_ENV1].nb_bits = -1; +#endif if ( st->element_mode == IVAS_CPE_DFT ) { push_indice( st->hBstr, IND_BWIDTH, st->bwidth, 2 ); diff --git a/lib_enc/dtx.c b/lib_enc/dtx.c index c99a8faf28..9656f96eb6 100644 --- a/lib_enc/dtx.c +++ b/lib_enc/dtx.c @@ -259,7 +259,13 @@ void dtx( /* reset the bitstream (IVAS format signaling was already written) */ if ( st->element_mode != IVAS_CPE_MDCT && st->hBstr != NULL ) { - reset_indices_enc( st->hBstr, MAX_NUM_INDICES ); + reset_indices_enc( st->hBstr, +#ifdef IND_LIST_DYN + st->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); } } diff --git a/lib_enc/enc_ppp.c b/lib_enc/enc_ppp.c index 823d6cf3cd..462557035f 100644 --- a/lib_enc/enc_ppp.c +++ b/lib_enc/enc_ppp.c @@ -169,7 +169,14 @@ ivas_error encod_ppp( } /* delete previous indices */ - reset_indices_enc( hBstr, MAX_NUM_INDICES ); + reset_indices_enc( hBstr, +#ifdef IND_LIST_DYN + hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); + /* signaling matrix (writing of signaling bits) */ signaling_enc( st ); diff --git a/lib_enc/eval_pit_contr.c b/lib_enc/eval_pit_contr.c index 5dd3101772..76bf54b025 100644 --- a/lib_enc/eval_pit_contr.c +++ b/lib_enc/eval_pit_contr.c @@ -326,18 +326,26 @@ int16_t Pit_exc_contribution_len( /* pitch contribution useless - delete all previously written indices belonging to pitch contribution */ for ( i = TAG_ACELP_SUBFR_LOOP_START; i < TAG_ACELP_SUBFR_LOOP_END; i++ ) { +#ifdef IND_LIST_DYN + delete_indice( hBstr, i ); +#else if ( hBstr->ind_list[i].nb_bits != -1 ) { hBstr->nb_bits_tot -= hBstr->ind_list[i].nb_bits; hBstr->ind_list[i].nb_bits = -1; } +#endif } +#ifdef IND_LIST_DYN + delete_indice( hBstr, IND_ES_PRED ); +#else if ( hBstr->ind_list[IND_ES_PRED].nb_bits != -1 ) { hBstr->nb_bits_tot -= hBstr->ind_list[IND_ES_PRED].nb_bits; hBstr->ind_list[IND_ES_PRED].nb_bits = -1; } +#endif } if ( st->core_brate < CFREQ_BITRATE ) diff --git a/lib_enc/fd_cng_enc.c b/lib_enc/fd_cng_enc.c index e43b65d56a..2f38de3955 100644 --- a/lib_enc/fd_cng_enc.c +++ b/lib_enc/fd_cng_enc.c @@ -895,8 +895,21 @@ void stereoFdCngCoherence( else if ( sts[0]->core_brate <= SID_2k40 && sts[1]->core_brate <= SID_2k40 ) { /* case: no VAD for both channels -> INACTIVE FRAME */ - reset_indices_enc( sts[0]->hBstr, MAX_NUM_INDICES ); - reset_indices_enc( sts[1]->hBstr, MAX_NUM_INDICES ); + reset_indices_enc( sts[0]->hBstr, +#ifdef IND_LIST_DYN + sts[0]->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); + + reset_indices_enc( sts[1]->hBstr, +#ifdef IND_LIST_DYN + sts[1]->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); /* synchronize SID sending for variable SID rate */ if ( sts[0]->core_brate != sts[1]->core_brate ) diff --git a/lib_enc/igf_enc.c b/lib_enc/igf_enc.c index 9c68e3fcc7..677bc1639e 100644 --- a/lib_enc/igf_enc.c +++ b/lib_enc/igf_enc.c @@ -1707,6 +1707,41 @@ void IGFEncSetMode( return; } +#ifdef IND_LIST_DYN + +/*-------------------------------------------------------------------* + * pack_bit() + * + * insert a bit into packed octet + *-------------------------------------------------------------------*/ + +static void pack_bit( + const int16_t bit, /* i : bit to be packed */ + uint8_t **pt, /* i/o: pointer to octet array into which bit will be placed */ + uint8_t *omask /* i/o: output mask to indicate where in the octet the bit is to be written */ +) +{ + if ( *omask == 0x80 ) + { + **pt = 0; + } + + if ( bit != 0 ) + { + **pt = **pt | *omask; + } + + *omask >>= 1; + if ( *omask == 0 ) + { + *omask = 0x80; + ( *pt )++; + } + + return; +} + +#endif /*-------------------------------------------------------------------* * IGFEncConcatenateBitstream() @@ -1722,10 +1757,56 @@ void IGFEncConcatenateBitstream( { int16_t i; IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; +#ifdef IND_LIST_DYN + Indice *ind_list; + uint8_t *pFrame; /* byte array with bit packet and byte aligned coded speech data */ + int16_t *pFrame_size; /* number of bits in the binary encoded access unit [bits] */ + int16_t k, nb_bits_written; + int32_t imask; + uint8_t omask; +#endif hPrivateData = &hIGFEnc->igfData; +#ifndef IND_LIST_DYN hBstr->next_ind -= bsBits; +#endif + +#ifdef IND_LIST_DYN + ind_list = &hBstr->ind_list[hBstr->nb_ind_tot - bsBits]; /* here, we assume that each bit has been written as a single indice */ + pFrame = hPrivateData->igfBitstream; + pFrame_size = &hPrivateData->igfBitstreamBits; + nb_bits_written = 0; + + omask = ( 0x80 >> ( *pFrame_size & 0x7 ) ); + pFrame += *pFrame_size >> 3; + + /* bitstream packing (conversion of individual indices into a serial stream) */ + for ( i = 0; i < bsBits; i++ ) + { + if ( ind_list[i].nb_bits > 0 ) + { + /* mask from MSB to LSB */ + imask = 1 << ( ind_list[i].nb_bits - 1 ); + /* write bit by bit */ + for ( k = 0; k < ind_list[i].nb_bits; k++ ) + { + pack_bit( ind_list[i].value & imask, &pFrame, &omask ); + imask >>= 1; + } + nb_bits_written += ind_list[i].nb_bits; + + /* delete the indice */ + ind_list[i].nb_bits = -1; + } + } + + *pFrame_size += nb_bits_written; + + /* update list of indices */ + hBstr->nb_ind_tot -= bsBits; + hBstr->nb_bits_tot -= nb_bits_written; +#else indices_to_serial_generic( &hBstr->ind_list[hBstr->next_ind], bsBits, hPrivateData->igfBitstream, &hPrivateData->igfBitstreamBits ); /* make sure there are no leftovers from the temporary bitstream writing */ @@ -1735,6 +1816,7 @@ void IGFEncConcatenateBitstream( } hBstr->nb_bits_tot -= hIGFEnc->infoTotalBitsPerFrameWritten; +#endif return; } diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index 16b1cf0c29..acf5298734 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -55,6 +55,9 @@ ivas_error init_encoder( Encoder_State *st, /* i/o: state structure */ +#ifdef IND_LIST_DYN + ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : encoder configuration handle */ +#endif const int16_t idchan, /* i : channel ID */ const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ const int16_t interval_SID, /* i : interval for SID update */ @@ -112,6 +115,19 @@ ivas_error init_encoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Bitstream structure\n" ) ); } + +#ifdef IND_LIST_DYN + /* set the maximum allowed number of indices in the list */ + st->hBstr->max_num_indices = get_max_num_indices( hEncoderConfig->ivas_format, st->total_brate ); + + /* allocate buffer of indices */ + if ( ( st->hBstr->ind_list = (INDICE_HANDLE) malloc( st->hBstr->max_num_indices * sizeof( Indice ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); + } + + reset_indices_enc( st->hBstr, st->hBstr->max_num_indices ); +#endif } else { diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 002e499f4b..9c29f60b71 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -103,6 +103,9 @@ ivas_error ivas_core_enc( int16_t last_element_mode, tdm_Pitch_reuse_flag; int32_t element_brate, last_element_brate, input_Fs; ivas_error error; +#ifdef IND_LIST_DYN + int16_t max_num_indices; +#endif push_wmops( "ivas_core_enc" ); @@ -195,6 +198,22 @@ ivas_error ivas_core_enc( { st = sts[n]; +#ifdef IND_LIST_DYN + /*---------------------------------------------------------------------* + * Re-allocate the list of indices, if needed + *---------------------------------------------------------------------*/ + + /* get the maximum allowed number of indices in the list */ + max_num_indices = get_max_num_indices( ivas_format, st->total_brate ); + + /* check, if the maximum number of allowed indices has changed */ + if ( max_num_indices != st->hBstr->max_num_indices ) + { + /* re-allocate the list of indices */ + ind_list_realloc( st->hBstr, max_num_indices ); + } +#endif + /*---------------------------------------------------------------------* * Write signaling info into the bitstream *---------------------------------------------------------------------*/ @@ -263,7 +282,11 @@ ivas_error ivas_core_enc( } else { - stereo_mdct_core_enc( hCPE, old_inp_16k, old_wsp, pitch_buf ); + stereo_mdct_core_enc( hCPE, +#ifdef IND_LIST_DYN + ivas_format, +#endif + old_inp_16k, old_wsp, pitch_buf ); } } else if ( sts[0]->core_brate == SID_2k40 && sts[1]->core_brate == SID_2k40 ) diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index e9d6968f1b..74c27f4bff 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -41,7 +41,6 @@ #endif #include "wmc_auto.h" - /*-------------------------------------------------------------------* * ivas_corecoder_enc_reconfig() * @@ -61,9 +60,23 @@ ivas_error ivas_corecoder_enc_reconfig( int16_t n, sce_id, cpe_id; int16_t len_inp_memory, n_CoreCoder_existing, nSCE_existing, nCPE_existing; float input_buff[MCT_MAX_BLOCKS][L_FRAME48k + NS2SA( 48000, IVAS_FB_ENC_DELAY_NS )]; - BSTR_ENC_HANDLE hBstr, hMetaData; - Indice *ind_list, *ind_list_metadata; - int16_t nb_bits_tot, next_ind, last_ind; + BSTR_ENC_HANDLE hBstr; +#ifndef IND_LIST_DYN + Indice *ind_list; +#endif +#ifndef IND_LIST_DYN + Indice *ind_list_metadata; + BSTR_ENC_HANDLE hMetaData; +#endif +#ifdef IND_LIST_DYN + int16_t i, nb_bits, max_num_indices_metadata; + Indice temp_ind_list[MAX_NUM_IND_TEMP_LIST]; +#endif + int16_t nb_bits_tot; +#ifndef IND_LIST_DYN + int16_t last_ind; + int16_t next_ind; +#endif ENCODER_CONFIG_HANDLE hEncoderConfig; ivas_error error; @@ -91,6 +104,20 @@ ivas_error ivas_corecoder_enc_reconfig( copy_encoder_config( st_ivas, st_ivas->hSCE[sce_id]->hCoreCoder[0], 0 ); st_ivas->hSCE[sce_id]->element_brate = brate_SCE; st_ivas->hSCE[sce_id]->hCoreCoder[0]->total_brate = st_ivas->hSCE[sce_id]->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ +#ifdef IND_LIST_DYN + if ( st_ivas->hSCE[sce_id]->hMetaData != NULL ) + { + /* get the maximum allowed number of indices in the list */ + max_num_indices_metadata = get_max_num_indices_metadata( hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); + + /* check, if the maximum number of allowed indices has changed */ + if ( max_num_indices_metadata != st_ivas->hSCE[sce_id]->hMetaData->max_num_indices ) + { + /* re-allocate the list of metadata indices */ + ind_list_realloc( st_ivas->hSCE[sce_id]->hMetaData, max_num_indices_metadata ); + } + } +#endif } for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) @@ -104,6 +131,20 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ } +#ifdef IND_LIST_DYN + if ( st_ivas->hCPE[cpe_id]->hMetaData != NULL ) + { + /* get the maximum allowed number of indices in the list */ + max_num_indices_metadata = get_max_num_indices_metadata( hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); + + /* check, if the maximum number of allowed indices has changed */ + if ( max_num_indices_metadata != st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices ) + { + /* re-allocate the list of metadata indices */ + ind_list_realloc( st_ivas->hCPE[cpe_id]->hMetaData, max_num_indices_metadata ); + } + } +#endif } if ( st_ivas->nCPE > 1 ) @@ -133,21 +174,29 @@ ivas_error ivas_corecoder_enc_reconfig( } /* something in transport changes */ +#ifndef IND_LIST_DYN ind_list = NULL; ind_list_metadata = NULL; +#endif hBstr = NULL; +#ifndef IND_LIST_DYN hMetaData = NULL; +#endif /* get the index list pointers */ if ( nSCE_old ) { hBstr = st_ivas->hSCE[0]->hCoreCoder[0]->hBstr; +#ifndef IND_LIST_DYN hMetaData = st_ivas->hSCE[0]->hMetaData; +#endif } else if ( nCPE_old ) { hBstr = st_ivas->hCPE[0]->hCoreCoder[0]->hBstr; +#ifndef IND_LIST_DYN hMetaData = st_ivas->hCPE[nCPE_old - 1]->hMetaData; +#endif } #ifdef DEBUGGING else @@ -157,11 +206,41 @@ ivas_error ivas_corecoder_enc_reconfig( #endif /* save bitstream information */ - ind_list = hBstr->ind_list; /* pointer to the beginning of the global list */ nb_bits_tot = hBstr->nb_bits_tot; +#ifndef IND_LIST_DYN + ind_list = hBstr->ind_list; /* pointer to the beginning of the global list */ next_ind = hBstr->next_ind; last_ind = hBstr->last_ind; +#endif +#ifdef IND_LIST_DYN + i = 0; + nb_bits = 0; + while ( nb_bits < nb_bits_tot && i < MAX_NUM_IND_TEMP_LIST ) + { + if ( hBstr->ind_list[i].nb_bits > 0 ) + { + temp_ind_list[i].id = hBstr->ind_list[i].id; + temp_ind_list[i].value = hBstr->ind_list[i].value; + temp_ind_list[i].nb_bits = hBstr->ind_list[i].nb_bits; + } + + nb_bits += temp_ind_list[i].nb_bits; + i++; + } + + for ( ; i < MAX_NUM_IND_TEMP_LIST; i++ ) + { + /* reset nb_bits of all other indices to -1 */ + temp_ind_list[i].nb_bits = -1; + } + +#ifdef DEBUGGING + assert( ( nb_bits == nb_bits_tot ) && "Error saving bitstream information during core-coder reconfiguration!\n" ); +#endif +#endif +#ifndef IND_LIST_DYN ind_list_metadata = hMetaData->ind_list; /* pointer to the beginning of the global list */ +#endif if ( hEncoderConfig->ivas_format == MC_FORMAT && last_mc_mode == MC_MODE_MCMASA && st_ivas->mc_mode == MC_MODE_MCMASA ) { @@ -256,23 +335,56 @@ ivas_error ivas_corecoder_enc_reconfig( mvr2r( input_buff[sce_id], st_ivas->hSCE[sce_id]->hCoreCoder[0]->input_buff, len_inp_memory ); } - /* prepare bitstream buffers */ +#ifndef IND_LIST_DYN + /* allocate buffer of indices */ st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list + sce_id * MAX_NUM_INDICES; +#endif /* only reset indices if it is not the first index list, this already contains the IVAS format bits */ if ( sce_id > 0 ) { - reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); + reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, +#ifdef IND_LIST_DYN + st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); } else { - st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->last_ind = last_ind; st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->nb_bits_tot = nb_bits_tot; +#ifndef IND_LIST_DYN + st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->last_ind = last_ind; st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->next_ind = next_ind; +#endif +#ifdef IND_LIST_DYN + /* re-fill the buffer of indices with already written indices */ + i = 0; + nb_bits = 0; + while ( nb_bits < nb_bits_tot && i < MAX_NUM_IND_TEMP_LIST ) + { + if ( temp_ind_list[i].nb_bits > 0 ) + { + st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].id = temp_ind_list[i].id; + st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].value = temp_ind_list[i].value; + st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; + } + + nb_bits += temp_ind_list[i].nb_bits; + i++; + } + st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->nb_ind_tot = i; +#ifdef DEBUGGING + assert( ( nb_bits == nb_bits_tot ) && "Error restoring bitstream information during core-coder reconfiguration!\n" ); +#endif +#endif } +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata + sce_id * MAX_BITS_METADATA; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); +#endif } } @@ -284,22 +396,52 @@ ivas_error ivas_corecoder_enc_reconfig( { st_ivas->hCPE[cpe_id]->element_brate = brate_CPE; - /* prepare bitstream buffers */ + /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { copy_encoder_config( st_ivas, st_ivas->hCPE[cpe_id]->hCoreCoder[n], 0 ); st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ +#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list + ( cpe_id * CPE_CHANNELS + n + st_ivas->nSCE ) * MAX_NUM_INDICES; +#endif if ( cpe_id * CPE_CHANNELS + n > 0 || ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->nSCE > 0 ) ) { - reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); + reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, +#ifdef IND_LIST_DYN + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); } else { - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->last_ind = last_ind; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_bits_tot = nb_bits_tot; +#ifndef IND_LIST_DYN + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->last_ind = last_ind; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->next_ind = next_ind; +#endif +#ifdef IND_LIST_DYN + i = 0; + nb_bits = 0; + while ( nb_bits < nb_bits_tot && i < MAX_NUM_IND_TEMP_LIST ) + { + if ( temp_ind_list[i].nb_bits > 0 ) + { + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].id = temp_ind_list[i].id; + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].value = temp_ind_list[i].value; + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; + } + + nb_bits += temp_ind_list[i].nb_bits; + i++; + } + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_ind_tot = i; +#ifdef DEBUGGING + assert( ( nb_bits == nb_bits_tot ) && "Error restoring bitstream information during core-coder reconfiguration!\n" ); +#endif +#endif } } } @@ -325,19 +467,49 @@ ivas_error ivas_corecoder_enc_reconfig( } } - /* prepare bitstream buffers */ for ( n = 0; n < CPE_CHANNELS; n++ ) { +#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list + ( cpe_id * CPE_CHANNELS + n + st_ivas->nSCE ) * MAX_NUM_INDICES; +#endif + /* only reset indices if it is not the first index list, this already contains the IVAS format bits */ if ( cpe_id * CPE_CHANNELS + n > 0 || ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->nSCE > 0 ) ) { - reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); + reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, +#ifdef IND_LIST_DYN + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); } else { - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->last_ind = last_ind; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_bits_tot = nb_bits_tot; +#ifndef IND_LIST_DYN + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->last_ind = last_ind; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->next_ind = next_ind; +#endif +#ifdef IND_LIST_DYN + i = 0; + nb_bits = 0; + while ( nb_bits < nb_bits_tot && i < MAX_NUM_IND_TEMP_LIST ) + { + if ( temp_ind_list[i].nb_bits > 0 ) + { + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].id = temp_ind_list[i].id; + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].value = temp_ind_list[i].value; + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; + } + + nb_bits += temp_ind_list[i].nb_bits; + i++; + } + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_ind_tot = i; +#ifdef DEBUGGING + assert( ( nb_bits == nb_bits_tot ) && "Error restoring bitstream information during core-coder reconfiguration!\n" ); +#endif +#endif } if ( hEncoderConfig->Opt_DTX_ON ) @@ -372,7 +544,6 @@ ivas_error ivas_corecoder_enc_reconfig( for ( n = 0; n < CPE_CHANNELS; n++ ) { st_ivas->hCPE[0]->hCoreCoder[n]->total_brate = st_ivas->hCPE[0]->element_brate; - st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal = (int16_t) ( st_ivas->hCPE[0]->element_brate / FRAMES_PER_SEC ); st_ivas->hCPE[0]->hCoreCoder[n]->igf = getIgfPresent( st_ivas->hCPE[0]->hCoreCoder[n]->element_mode, st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal * FRAMES_PER_SEC, @@ -404,7 +575,7 @@ ivas_error ivas_corecoder_enc_reconfig( } } - /* metadata handling for CPEs */ + /* alllocate buffer for metadata indices */ if ( st_ivas->nCPE > 0 ) { if ( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData == NULL ) @@ -413,15 +584,36 @@ ivas_error ivas_corecoder_enc_reconfig( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MetaData structure\n" ) ); } + +#ifdef IND_LIST_DYN + /* set the maximum allowed number of metadata indices in the list */ + st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->max_num_indices = get_max_num_indices_metadata( hEncoderConfig->ivas_total_brate, hEncoderConfig->ivas_format ); + + /* allocate buffer of metadata indices */ + if ( ( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ind_list = (INDICE_HANDLE) malloc( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->max_num_indices * sizeof( Indice ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); + } +#endif } +#ifdef IND_LIST_DYN + reset_indices_enc( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData, st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->max_num_indices ); +#else st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ind_list = ind_list_metadata + st_ivas->nSCE * MAX_NUM_INDICES; reset_indices_enc( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData, MAX_BITS_METADATA ); +#endif for ( cpe_id = 0; cpe_id < st_ivas->nCPE - 1; cpe_id++ ) { if ( st_ivas->hCPE[cpe_id]->hMetaData != NULL ) { +#ifdef IND_LIST_DYN + if ( st_ivas->hCPE[cpe_id]->hMetaData->ind_list != NULL ) + { + free( st_ivas->hCPE[cpe_id]->hMetaData->ind_list ); + } +#endif free( st_ivas->hCPE[cpe_id]->hMetaData ); st_ivas->hCPE[cpe_id]->hMetaData = NULL; } @@ -440,7 +632,6 @@ ivas_error ivas_corecoder_enc_reconfig( for ( n = 0; n < CPE_CHANNELS; n++ ) { st_ivas->hCPE[0]->hCoreCoder[n]->total_brate = st_ivas->hCPE[0]->element_brate; - st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal = (int16_t) ( st_ivas->hCPE[0]->element_brate / FRAMES_PER_SEC ); st_ivas->hCPE[0]->hCoreCoder[n]->igf = getIgfPresent( st_ivas->hCPE[0]->hCoreCoder[n]->element_mode, st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal * FRAMES_PER_SEC, diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index f9b787ac56..82cda2357a 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -811,6 +811,19 @@ ivas_error create_cpe_enc( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MetaData structure\n" ) ); } + +#ifdef IND_LIST_DYN + /* set the maximum allowed number of indices in the list */ + hCPE->hMetaData->max_num_indices = get_max_num_indices_metadata( hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); + + /* allocate buffer of metadata indices */ + if ( ( hCPE->hMetaData->ind_list = (INDICE_HANDLE) malloc( hCPE->hMetaData->max_num_indices * sizeof( Indice ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); + } + + reset_indices_enc( hCPE->hMetaData, hCPE->hMetaData->max_num_indices ); +#endif } /*-----------------------------------------------------------------* @@ -832,7 +845,12 @@ ivas_error create_cpe_enc( st->mct_chan_mode = MCT_CHAN_MODE_LFE; } - if ( ( error = init_encoder( st, n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) + if ( ( error = init_encoder( st, + +#ifdef IND_LIST_DYN + hEncoderConfig, +#endif + n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) { return error; } @@ -1004,6 +1022,12 @@ void destroy_cpe_enc( if ( hCPE->hMetaData != NULL ) { +#ifdef IND_LIST_DYN + if ( hCPE->hMetaData->ind_list != NULL ) + { + free( hCPE->hMetaData->ind_list ); + } +#endif free( hCPE->hMetaData ); hCPE->hMetaData = NULL; } diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index dfaa321605..e0713950ca 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -313,9 +313,15 @@ void ivas_initialize_handles_enc( *-------------------------------------------------------------------*/ ivas_error ivas_init_encoder( - Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ - Indice ind_list[][MAX_NUM_INDICES], /* o : bitstream indices */ + Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ +#ifndef IND_LIST_DYN + , + Indice ind_list[][MAX_NUM_INDICES] /* o : bitstream indices */ +#endif +#ifndef IND_LIST_DYN + , Indice ind_list_metadata[][MAX_BITS_METADATA] /* o : bitstream indices metadata */ +#endif ) { int16_t i, n; @@ -361,9 +367,10 @@ ivas_error ivas_init_encoder( return error; } - /* prepare bitstream buffers */ +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); +#endif /* prepare stereo downmix for EVS */ if ( hEncoderConfig->stereo_dmx_evs == 1 ) @@ -386,16 +393,20 @@ ivas_error ivas_init_encoder( return error; } - /* prepare bitstream buffers */ +#ifndef IND_LIST_DYN + /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); } +#endif +#ifndef IND_LIST_DYN /* MetaData for DFT stereo */ st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[0]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); +#endif } else if ( ivas_format == ISM_FORMAT ) { @@ -415,12 +426,16 @@ ivas_error ivas_init_encoder( return error; } - /* prepare bitstream buffers */ + /* MetaData for ISMs */ +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); +#endif +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); +#endif } if ( st_ivas->ism_mode == ISM_MODE_PARAM ) @@ -485,12 +500,16 @@ ivas_error ivas_init_encoder( return error; } - /* prepare bitstream buffers */ + /* MetaData for SBA */ +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); +#endif +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); +#endif if ( st_ivas->sba_mode == SBA_MODE_SPAR && st_ivas->hEncoderConfig->Opt_DTX_ON ) { @@ -505,11 +524,12 @@ ivas_error ivas_init_encoder( return error; } - /* prepare bitstream buffers */ for ( n = 0; n < CPE_CHANNELS; n++ ) { +#ifndef IND_LIST_DYN st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); +#endif if ( hEncoderConfig->Opt_DTX_ON ) { @@ -517,12 +537,14 @@ ivas_error ivas_init_encoder( } } +#ifndef IND_LIST_DYN /* Metadata only initialized for the last CPE index */ if ( cpe_id == st_ivas->nCPE - 1 ) { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); } +#endif } if ( st_ivas->nCPE > 1 ) @@ -551,6 +573,8 @@ ivas_error ivas_init_encoder( return error; } +#ifndef IND_LIST_DYN + /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { /* we need the correct bitstream also for the LFE channel since it might become a proper coded channel when @@ -558,13 +582,16 @@ ivas_error ivas_init_encoder( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); } +#endif +#ifndef IND_LIST_DYN /* Metadata only initialized for the last CPE index*/ if ( cpe_id == st_ivas->nCPE - 1 ) { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); } +#endif } if ( ( error = create_mct_enc( st_ivas ) ) != IVAS_ERR_OK ) @@ -593,19 +620,23 @@ ivas_error ivas_init_encoder( return error; } - /* prepare bitstream buffers */ +#ifndef IND_LIST_DYN + /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); } +#endif +#ifndef IND_LIST_DYN /* Metadata only initialized for the last CPE index*/ if ( cpe_id == st_ivas->nCPE - 1 ) { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); } +#endif } if ( st_ivas->nCPE > 1 ) @@ -646,12 +677,15 @@ ivas_error ivas_init_encoder( return error; } - /* prepare bitstream buffers */ +#ifndef IND_LIST_DYN + /* allocate buffer of indices */ st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); - +#endif +#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); +#endif } for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) @@ -663,19 +697,23 @@ ivas_error ivas_init_encoder( return error; } - /* prepare bitstream buffers */ +#ifndef IND_LIST_DYN + /* allocate buffer of indices */ for ( n = 0; n < CPE_CHANNELS; n++ ) { st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n + st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); } +#endif +#ifndef IND_LIST_DYN /* Metadata only initialized for the last CPE index*/ if ( cpe_id == st_ivas->nCPE - 1 ) { st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); } +#endif } } } @@ -739,6 +777,14 @@ void destroy_core_enc( if ( hCoreCoder->hBstr != NULL ) { +#ifdef IND_LIST_DYN + /* deallocate buffer of indices */ + if ( hCoreCoder->hBstr->ind_list != NULL ) + { + free( hCoreCoder->hBstr->ind_list ); + } +#endif + free( hCoreCoder->hBstr ); hCoreCoder->hBstr = NULL; } diff --git a/lib_enc/ivas_ism_dtx_enc.c b/lib_enc/ivas_ism_dtx_enc.c index 3839a42a9d..9f3ae679c6 100644 --- a/lib_enc/ivas_ism_dtx_enc.c +++ b/lib_enc/ivas_ism_dtx_enc.c @@ -174,7 +174,14 @@ int16_t ivas_ism_dtx_enc( if ( dtx_flag ) { /* reset the bitstream (IVAS format signaling was already written) */ - reset_indices_enc( hSCE[0]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); + reset_indices_enc( hSCE[0]->hCoreCoder[0]->hBstr, + +#ifdef IND_LIST_DYN + hSCE[0]->hCoreCoder[0]->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); } /*------------------------------------------------------------------* @@ -385,7 +392,13 @@ int16_t ivas_ism_dtx_enc( if ( ( st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == -1 ) && ( st_ivas->hSCE[0]->hCoreCoder[0]->last_core_brate == SID_2k40 || st_ivas->hSCE[0]->hCoreCoder[0]->last_core_brate == FRAME_NO_DATA ) ) { st_ivas->hSCE[0]->hCoreCoder[0]->core_brate = st_ivas->hSCE[0]->hCoreCoder[0]->last_core_brate; - reset_indices_enc( st_ivas->hSCE[0]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); + reset_indices_enc( st_ivas->hSCE[0]->hCoreCoder[0]->hBstr, +#ifdef IND_LIST_DYN + st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->max_num_indices +#else + MAX_NUM_INDICES +#endif + ); } st_ivas->hSCE[1]->hCoreCoder[0]->core_brate = st_ivas->hSCE[0]->hCoreCoder[0]->core_brate; diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 1540e35ce4..ddac05ff00 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -877,7 +877,11 @@ ivas_error ivas_ism_metadata_enc( /* write metadata only in active frames */ if ( hSCE[0]->hCoreCoder[0]->core_brate > SID_2k40 ) { +#ifdef IND_LIST_DYN + reset_indices_enc( hSCE[ch]->hMetaData, hSCE[ch]->hMetaData->max_num_indices ); +#else reset_indices_enc( hSCE[ch]->hMetaData, MAX_BITS_METADATA ); +#endif } } diff --git a/lib_enc/ivas_lfe_enc.c b/lib_enc/ivas_lfe_enc.c index a14424774f..9a5b754942 100644 --- a/lib_enc/ivas_lfe_enc.c +++ b/lib_enc/ivas_lfe_enc.c @@ -98,7 +98,11 @@ static void ivas_lfe_enc_quant( BSTR_ENC_HANDLE hBstr ) { int16_t bits_written; +#ifdef IND_LIST_DYN + int16_t nb_ind_tot; +#else int16_t next_ind_pos; +#endif uint16_t quant_strategy, write_bit; int16_t num_quant_strategies; int16_t shift_bits; @@ -117,7 +121,11 @@ static void ivas_lfe_enc_quant( num_quant_strategies = IVAS_MAX_NUM_QUANT_STRATS; shift_bits = IVAS_LFE_SHIFT_BITS; bits_written = hBstr->nb_bits_tot; +#ifdef IND_LIST_DYN + nb_ind_tot = hBstr->nb_ind_tot; +#else next_ind_pos = hBstr->next_ind; +#endif for ( quant_strategy = 0; quant_strategy < num_quant_strategies; quant_strategy++ ) @@ -243,7 +251,11 @@ static void ivas_lfe_enc_quant( } bits_written_arith_enc = hBstr->nb_bits_tot; +#ifdef IND_LIST_DYN + next_ind_pos_arith_enc = hBstr->nb_ind_tot; +#else next_ind_pos_arith_enc = hBstr->next_ind; +#endif push_next_indice( hBstr, coding_strategy, 1 ); base2_num_bits_tot = hBstr->nb_bits_tot - bits_written; @@ -259,13 +271,24 @@ static void ivas_lfe_enc_quant( { if ( quant_strategy == ( num_quant_strategies - 1 ) || ( ( target_bits + IVAS_LFE_ID_BITS ) >= base2_num_bits_tot ) ) { +#ifdef IND_LIST_DYN + /* reset bits buffer and code the indices with base 2 coding */ + for ( j = hBstr->nb_ind_tot - 1; j >= next_ind_pos_arith_enc; j-- ) + { + hBstr->ind_list[j].nb_bits = -1; + } + hBstr->nb_ind_tot = next_ind_pos_arith_enc; +#else /* reset bits buffer and code the indices with base 2 coding */ for ( j = hBstr->next_ind - 1; j >= next_ind_pos_arith_enc; j-- ) { hBstr->ind_list[j].nb_bits = -1; } +#endif hBstr->nb_bits_tot = bits_written_arith_enc; +#ifndef IND_LIST_DYN hBstr->next_ind = next_ind_pos_arith_enc; +#endif coding_strategy = 1; push_next_indice( hBstr, coding_strategy, 1 ); @@ -298,13 +321,21 @@ static void ivas_lfe_enc_quant( if ( quant_strategy < ( num_quant_strategies - 1 ) ) { /* reset all indices that were already written - TODO: maybe better store them temporarily first and write at the very end? */ +#ifdef IND_LIST_DYN + for ( j = hBstr->nb_ind_tot - 1; j >= nb_ind_tot; j-- ) +#else for ( j = hBstr->next_ind - 1; j >= next_ind_pos; j-- ) +#endif { hBstr->ind_list[j].nb_bits = -1; } hBstr->nb_bits_tot = bits_written; +#ifdef IND_LIST_DYN + hBstr->nb_ind_tot = nb_ind_tot; +#else hBstr->next_ind = next_ind_pos; +#endif } } } diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 337753925c..b5e100145d 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -1708,6 +1708,9 @@ void ivas_masa_enc_reconfigure( int16_t n, tmp; int16_t sce_id, cpe_id; int32_t ivas_total_brate; +#ifdef IND_LIST_DYN + int16_t max_num_indices_metadata; +#endif ivas_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; @@ -1718,6 +1721,21 @@ void ivas_masa_enc_reconfigure( copy_encoder_config( st_ivas, st_ivas->hSCE[sce_id]->hCoreCoder[0], 0 ); st_ivas->hSCE[sce_id]->element_brate = ivas_total_brate / st_ivas->nchan_transport; st_ivas->hSCE[sce_id]->hCoreCoder[0]->total_brate = st_ivas->hSCE[sce_id]->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ + +#ifdef IND_LIST_DYN + if ( st_ivas->hSCE[sce_id]->hMetaData != NULL ) + { + /* get the maximum allowed number of indices in the list */ + max_num_indices_metadata = get_max_num_indices_metadata( st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); + + /* check, if the maximum number of allowed indices has changed */ + if ( max_num_indices_metadata != st_ivas->hSCE[sce_id]->hMetaData->max_num_indices ) + { + /* re-allocate the list of metadata indices */ + ind_list_realloc( st_ivas->hSCE[sce_id]->hMetaData, max_num_indices_metadata ); + } + } +#endif } for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) @@ -1729,6 +1747,21 @@ void ivas_masa_enc_reconfigure( { copy_encoder_config( st_ivas, st_ivas->hCPE[cpe_id]->hCoreCoder[n], 0 ); st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ + +#ifdef IND_LIST_DYN + if ( st_ivas->hCPE[cpe_id]->hMetaData != NULL ) + { + /* get the maximum allowed number of indices in the list */ + max_num_indices_metadata = get_max_num_indices_metadata( st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); + + /* check, if the maximum number of allowed indices has changed */ + if ( max_num_indices_metadata != st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices ) + { + /* re-allocate the list of metadata indices */ + ind_list_realloc( st_ivas->hCPE[cpe_id]->hMetaData, max_num_indices_metadata ); + } + } +#endif } if ( ivas_total_brate < MASA_STEREO_MIN_BITRATE ) diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index ac4f83a657..97bc34a9cb 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -130,7 +130,10 @@ ivas_error ivas_qmetadata_enc_encode( ) { int16_t i, bit_pos_start, bit_pos_start_coh; - int16_t next_ind_start, last_ind_start; + int16_t next_ind_start; +#ifndef IND_LIST_DYN + int16_t last_ind_start; +#endif uint16_t diffuseness_index_max_ec_frame; uint16_t diffuseness_index_max_ec_frame_pre[QMETADATA_MAX_NO_DIRECTIONS]; int16_t bits_dir_raw_pre[QMETADATA_MAX_NO_DIRECTIONS]; @@ -403,8 +406,12 @@ ivas_error ivas_qmetadata_enc_encode( /* Save state of metadata bitstream buffer after writing energy ratios, number of dirs and save space for coherence*/ bit_pos_start = hMetaData->nb_bits_tot; +#ifdef IND_LIST_DYN + next_ind_start = hMetaData->nb_ind_tot; +#else next_ind_start = hMetaData->next_ind; last_ind_start = hMetaData->last_ind; +#endif /* Encode quantized directions with EC frame-wise*/ if ( total_bits_1dir + bits_surround_coh <= hQMetaData->qmetadata_max_bit_req ) @@ -413,7 +420,11 @@ ivas_error ivas_qmetadata_enc_encode( bits_signaling[d]++; } +#ifdef IND_LIST_DYN + next_ind_raw_flag = hMetaData->nb_ind_tot; +#else next_ind_raw_flag = hMetaData->next_ind; +#endif push_next_indice( hMetaData, 0, 1 ); /* Raw coding flag*/ bits_dir_bands[0] = ivas_qmetadata_raw_encode_dir( NULL, q_direction, q_direction->cfg.nbands, q_direction->cfg.start_band ); @@ -445,7 +456,11 @@ ivas_error ivas_qmetadata_enc_encode( /* Encode quantized directions with EC band-wise */ if ( ( total_bits_1dir + bits_surround_coh <= hQMetaData->qmetadata_max_bit_req ) && ( bits_dir[d] + bits_diff[d] + bits_coherence[d] + bits_signaling[d] > total_bits_1dir ) && q_direction->cfg.nblocks > 1 ) { - restore_metadata_buffer( hMetaData, next_ind_start, last_ind_start, bit_pos_start ); + restore_metadata_buffer( hMetaData, next_ind_start, +#ifndef IND_LIST_DYN + last_ind_start, +#endif + bit_pos_start ); /* Write signaling */ push_next_indice( hMetaData, 1, 1 ); /*Write 1 bit to signal no EC frame-wise (EC1)*/ @@ -453,7 +468,11 @@ ivas_error ivas_qmetadata_enc_encode( bits_signaling[d] = 3; /* Write raw flags */ +#ifdef IND_LIST_DYN + next_ind_raw_flag = hMetaData->nb_ind_tot; +#else next_ind_raw_flag = hMetaData->next_ind; +#endif for ( i = start_band; i < nbands; i++ ) { push_next_indice( hMetaData, 0, 1 ); /* Raw coding flag*/ @@ -522,7 +541,11 @@ ivas_error ivas_qmetadata_enc_encode( /*Bit budget exceeded, bit reduction strategy?*/ extra_bits = 0; - restore_metadata_buffer( hMetaData, next_ind_start, last_ind_start, bit_pos_start ); + restore_metadata_buffer( hMetaData, next_ind_start, +#ifndef IND_LIST_DYN + last_ind_start, +#endif + bit_pos_start ); push_next_indice( hMetaData, 1, 1 ); /*Write 1 bit to signal no EC frame-wise (EC1)*/ if ( nblocks > 1 ) @@ -908,15 +931,19 @@ void ivas_qmetadata_enc_sid_encode( void reset_metadata_spatial( const IVAS_FORMAT ivas_format, /* i : IVAS format */ - BSTR_ENC_HANDLE hMetaData, /* i/o: Metadata bitstream handle */ + BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ const int32_t element_brate, /* i : element bitrate */ int32_t *total_brate, /* o : total bitrate */ const int32_t core_brate, /* i : core bitrate */ - const int16_t nb_bits_metadata, /* i : number of meatdata bits */ + const int16_t nb_bits_metadata, /* i : number of metadata bits */ const SBA_MODE sba_mode /* i : SBA mode */ ) { int16_t i, next_ind_sid, last_ind_sid; +#ifdef IND_LIST_DYN + int16_t j; +#endif + int16_t metadata_sid_bits; if ( core_brate == SID_2k40 || core_brate == FRAME_NO_DATA ) @@ -925,7 +952,9 @@ void reset_metadata_spatial( { if ( sba_mode == SBA_MODE_SPAR ) { +#ifdef DEBUGGING assert( hMetaData->ind_list[0].nb_bits == 1 ); +#endif hMetaData->ind_list[0].value = 1; metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS; while ( hMetaData->nb_bits_tot < metadata_sid_bits ) @@ -936,15 +965,22 @@ void reset_metadata_spatial( else { /* Reset metadata and keep only SID metadata*/ +#ifdef IND_LIST_DYN + last_ind_sid = hMetaData->nb_ind_tot; + next_ind_sid = hMetaData->nb_ind_tot; +#else last_ind_sid = hMetaData->next_ind; next_ind_sid = hMetaData->next_ind; +#endif while ( hMetaData->nb_bits_tot > nb_bits_metadata ) { next_ind_sid--; hMetaData->nb_bits_tot -= hMetaData->ind_list[next_ind_sid].nb_bits; } +#ifndef IND_LIST_DYN hMetaData->next_ind = 0; +#endif hMetaData->nb_bits_tot = 0; for ( i = 0; i < next_ind_sid; i++ ) @@ -952,6 +988,17 @@ void reset_metadata_spatial( hMetaData->ind_list[i].nb_bits = -1; } +#ifdef IND_LIST_DYN + for ( j = 0, i = next_ind_sid; i < last_ind_sid; i++, j++ ) + { + hMetaData->ind_list[j].value = hMetaData->ind_list[i].value; + hMetaData->ind_list[j].nb_bits = hMetaData->ind_list[i].nb_bits; + hMetaData->nb_bits_tot += hMetaData->ind_list[j].nb_bits; + hMetaData->ind_list[i].nb_bits = -1; + } + + hMetaData->nb_ind_tot = j; +#else for ( i = next_ind_sid; i < last_ind_sid; i++ ) { hMetaData->ind_list[hMetaData->next_ind].value = hMetaData->ind_list[i].value; @@ -960,13 +1007,20 @@ void reset_metadata_spatial( hMetaData->next_ind++; hMetaData->ind_list[i].nb_bits = -1; } + hMetaData->last_ind = hMetaData->next_ind; +#endif +#ifdef DEBUGGING assert( ( hMetaData->nb_bits_tot == ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS ) && "Problem of SID metadata in SCE" ); +#endif } } else { /*Reset metadata*/ +#ifdef IND_LIST_DYN + reset_indices_enc( hMetaData, hMetaData->max_num_indices ); +#else for ( i = 0; i < hMetaData->next_ind; i++ ) { hMetaData->ind_list[i].nb_bits = -1; @@ -974,6 +1028,7 @@ void reset_metadata_spatial( hMetaData->nb_bits_tot = 0; hMetaData->next_ind = 0; hMetaData->last_ind = 0; +#endif } *total_brate = element_brate; @@ -983,12 +1038,22 @@ void reset_metadata_spatial( /* Reset SID metadata bits*/ while ( hMetaData->nb_bits_tot > nb_bits_metadata ) { +#ifdef IND_LIST_DYN + hMetaData->nb_ind_tot--; + hMetaData->nb_bits_tot -= hMetaData->ind_list[hMetaData->nb_ind_tot].nb_bits; + hMetaData->ind_list[hMetaData->nb_ind_tot].nb_bits = -1; +#else hMetaData->next_ind--; hMetaData->nb_bits_tot -= hMetaData->ind_list[hMetaData->next_ind].nb_bits; hMetaData->ind_list[hMetaData->next_ind].nb_bits = -1; +#endif } +#ifdef DEBUGGING assert( hMetaData->nb_bits_tot == nb_bits_metadata && "Problem in metadata for SCE" ); +#endif +#ifndef IND_LIST_DYN hMetaData->last_ind = hMetaData->next_ind; +#endif } return; @@ -1494,24 +1559,34 @@ static int16_t ivas_qmetadata_entropy_encode_df_ratio( /*------------------------------------------------------------------------- * restore_metadata_buffer() * - * Reset metadata buffer + * Restore metadata buffer *------------------------------------------------------------------------*/ void restore_metadata_buffer( BSTR_ENC_HANDLE hMetaData, const int16_t next_ind_start, +#ifndef IND_LIST_DYN const int16_t last_ind_start, +#endif const int16_t bit_pos_start ) { int16_t i; +#ifdef IND_LIST_DYN + for ( i = next_ind_start; i <= hMetaData->nb_ind_tot; i++ ) +#else for ( i = next_ind_start; i <= hMetaData->next_ind; i++ ) +#endif { hMetaData->ind_list[i].nb_bits = -1; } hMetaData->nb_bits_tot = bit_pos_start; +#ifdef IND_LIST_DYN + hMetaData->nb_ind_tot = next_ind_start; +#else hMetaData->next_ind = next_ind_start; hMetaData->last_ind = last_ind_start; +#endif return; } @@ -4701,7 +4776,11 @@ static int16_t ivas_qmetadata_quantize_coherence( else { /* write dummy data now and save the position */ +#ifdef IND_LIST_DYN + *indice_coherence = hMetaData->nb_ind_tot; +#else *indice_coherence = hMetaData->next_ind; +#endif k = nbits; while ( k > 0 ) { diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index c8577a85ba..e54fee386b 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -312,6 +312,19 @@ ivas_error create_sce_enc( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MetaData structure\n" ) ); } + +#ifdef IND_LIST_DYN + /* set the maximum allowed number of indices in the list */ + hSCE->hMetaData->max_num_indices = get_max_num_indices_metadata( st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); + + /* allocate buffer of metadata indices */ + if ( ( hSCE->hMetaData->ind_list = (INDICE_HANDLE) malloc( hSCE->hMetaData->max_num_indices * sizeof( Indice ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); + } + + reset_indices_enc( hSCE->hMetaData, hSCE->hMetaData->max_num_indices ); +#endif } else { @@ -332,7 +345,11 @@ ivas_error create_sce_enc( st->total_brate = hSCE->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; - if ( ( error = init_encoder( st, 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) + if ( ( error = init_encoder( st, +#ifdef IND_LIST_DYN + st_ivas->hEncoderConfig, +#endif + 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) { return error; } @@ -367,6 +384,12 @@ void destroy_sce_enc( if ( hSCE->hMetaData != NULL ) { +#ifdef IND_LIST_DYN + if ( hSCE->hMetaData->ind_list != NULL ) + { + free( hSCE->hMetaData->ind_list ); + } +#endif free( hSCE->hMetaData ); hSCE->hMetaData = NULL; } diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index c659979d2b..05329491a1 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -202,7 +202,11 @@ ivas_error ivas_spar_enc_open( hSpar->hCoreCoderVAD->total_brate = hEncoderConfig->ivas_total_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ hSpar->hCoreCoderVAD->mct_chan_mode = MCT_CHAN_MODE_IGNORE; - if ( ( error = init_encoder( hSpar->hCoreCoderVAD, 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) + if ( ( error = init_encoder( hSpar->hCoreCoderVAD, +#ifdef IND_LIST_DYN + hEncoderConfig, +#endif + 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 645f690ac0..44fb18dbc2 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -510,17 +510,29 @@ static void write_metadata_buffer( BSTR_ENC_HANDLE hMetaData_tmp, BSTR_ENC_HANDLE hMetaData, const int16_t bit_pos_start, - const int16_t next_ind_start, - const int16_t last_ind_start ) + const int16_t next_ind_start +#ifndef IND_LIST_DYN + , + const int16_t last_ind_start +#endif +) { int16_t i; if ( hMetaData->nb_bits_tot > 0 ) { - restore_metadata_buffer( hMetaData, next_ind_start, last_ind_start, bit_pos_start ); + restore_metadata_buffer( hMetaData, next_ind_start, +#ifndef IND_LIST_DYN + last_ind_start, +#endif + bit_pos_start ); } +#ifdef IND_LIST_DYN + for ( i = 0; i < hMetaData_tmp->nb_ind_tot; i++ ) +#else for ( i = 0; i < hMetaData_tmp->next_ind; i++ ) +#endif { push_next_indice( hMetaData, hMetaData_tmp->ind_list[i].value, hMetaData_tmp->ind_list[i].nb_bits ); } @@ -556,7 +568,10 @@ ivas_error ivas_spar_md_enc_process( int16_t nB, bands_bw, packed_ok = 0; ivas_strats_t cs[MAX_CODING_STRATS]; int16_t code_strat; - int16_t bit_pos_start, next_ind_start, last_ind_start; + int16_t bit_pos_start, next_ind_start; +#ifndef IND_LIST_DYN + int16_t last_ind_start; +#endif BSTR_ENC_DATA hMetaData_tmp; Indice ind_list_tmp[MAX_BITS_METADATA]; // IVAS_fmToDo: size to be optimized float Wscale[IVAS_MAX_NUM_BANDS]; @@ -609,8 +624,12 @@ ivas_error ivas_spar_md_enc_process( /* Save state of metadata bitstream buffer */ bit_pos_start = hMetaData->nb_bits_tot; +#ifdef IND_LIST_DYN + next_ind_start = hMetaData->nb_ind_tot; +#else next_ind_start = hMetaData->next_ind; last_ind_start = hMetaData->last_ind; +#endif dmx_switch = 0; @@ -871,13 +890,23 @@ ivas_error ivas_spar_md_enc_process( strat = cs[i]; if ( strat != NO_STRAT ) { +#ifdef IND_LIST_DYN + hMetaData_tmp.max_num_indices = MAX_BITS_METADATA; + reset_indices_enc( &hMetaData_tmp, hMetaData_tmp.max_num_indices ); +#else reset_indices_enc( &hMetaData_tmp, MAX_BITS_METADATA ); +#endif ivas_write_spar_md_bitstream( hMdEnc, num_bands, bands_bw, &hMetaData_tmp, hEncoderConfig->ivas_total_brate, strat, qsi, planarCP ); if ( hMetaData->nb_bits_tot == bit_pos_start || hMetaData_tmp.nb_bits_tot < ( hMetaData->nb_bits_tot - bit_pos_start ) ) { - write_metadata_buffer( &hMetaData_tmp, hMetaData, bit_pos_start, next_ind_start, last_ind_start ); + write_metadata_buffer( &hMetaData_tmp, hMetaData, bit_pos_start, next_ind_start +#ifndef IND_LIST_DYN + , + last_ind_start +#endif + ); code_strat = strat; } if ( hMetaData->nb_bits_tot - bit_pos_start + ( ( ( hEncoderConfig->ivas_total_brate == IVAS_256k ) && ( sba_order == SBA_FOA_ORDER ) ) ? 1 : 0 ) <= hMdEnc->spar_md_cfg.tgt_bits_per_blk ) diff --git a/lib_enc/ivas_stereo_mdct_core_enc.c b/lib_enc/ivas_stereo_mdct_core_enc.c index 9500da4fb9..7cf4a930b5 100644 --- a/lib_enc/ivas_stereo_mdct_core_enc.c +++ b/lib_enc/ivas_stereo_mdct_core_enc.c @@ -117,6 +117,9 @@ static void sync_tcx_mode( void stereo_mdct_core_enc( CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ +#ifdef IND_LIST_DYN + const int16_t ivas_format, /* i : IVAS format */ +#endif float new_samples[CPE_CHANNELS][L_INP], /* i : new samples */ float old_wsp[CPE_CHANNELS][L_WSP], /* i : 12.8kHz weighted speech (for LTP */ float pitch_buf[CPE_CHANNELS][NB_SUBFR16k] /* o : floating pitch for each subframe */ @@ -145,6 +148,9 @@ void stereo_mdct_core_enc( int16_t p_param[CPE_CHANNELS][2]; int16_t stereo_bits; int16_t meta_bits, signal_bits; +#ifdef IND_LIST_DYN + int16_t max_num_indices; +#endif push_wmops( "stereo_mdct_core_enc" ); @@ -179,6 +185,19 @@ void stereo_mdct_core_enc( { st = sts[ch]; SetTCXModeInfo( st, st->hTranDet, &st->hTcxCfg->tcx_curr_overlap_mode ); + +#ifdef IND_LIST_DYN + /* re-allocate list of indices, if needed (note that st->total_brate is modified later in this function) */ + /* get the maximum allowed number of indices in the list */ + max_num_indices = get_max_num_indices( ivas_format, st->total_brate ); + + /* check, if the maximum number of allowed indices has changed */ + if ( max_num_indices != st->hBstr->max_num_indices ) + { + /* re-allocate the list of indices */ + ind_list_realloc( st->hBstr, max_num_indices ); + } +#endif } /* adaptively sync tcx modes*/ diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 50052cda3c..f3db751e0a 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -48,8 +48,12 @@ struct IVAS_ENC { Encoder_Struct *st_ivas; - Indice ind_list[MAX_NUM_DATA][MAX_NUM_INDICES]; /* list of indices */ +#ifndef IND_LIST_DYN + Indice ind_list[MAX_NUM_DATA][MAX_NUM_INDICES]; /* list of indices */ +#endif +#ifndef IND_LIST_DYN Indice ind_list_metadata[MAX_NUM_METADATA][MAX_BITS_METADATA]; /* list of indices for metadata */ +#endif ENC_CORE_HANDLE hCoreCoder; bool isConfigured; #ifdef DEBUGGING @@ -99,7 +103,9 @@ ivas_error IVAS_ENC_Open( ) { Encoder_Struct *st_ivas; +#ifndef IND_LIST_DYN int16_t i, j; +#endif if ( phIvasEnc == NULL ) { @@ -110,13 +116,7 @@ ivas_error IVAS_ENC_Open( * Allocate and initialize IVAS application encoder handle *-----------------------------------------------------------------*/ -#ifdef BITSTREAM_INDICES_MEMORY -#define WMC_TOOL_SKIP if ( ( *phIvasEnc = (IVAS_ENC_HANDLE) malloc( sizeof( struct IVAS_ENC ) ) ) == NULL ) -#undef WMC_TOOL_SKIP -#else - if ( ( *phIvasEnc = (IVAS_ENC_HANDLE) malloc( sizeof( struct IVAS_ENC ) ) ) == NULL ) -#endif { return IVAS_ERR_FAILED_ALLOC; } @@ -134,6 +134,7 @@ ivas_error IVAS_ENC_Open( * Initialize indices *-----------------------------------------------------------------*/ +#ifndef IND_LIST_DYN for ( i = 0; i < MAX_NUM_DATA; ++i ) { for ( j = 0; j < MAX_NUM_INDICES; ++j ) @@ -142,7 +143,9 @@ ivas_error IVAS_ENC_Open( ( *phIvasEnc )->ind_list[i][j].value = 0; } } +#endif +#ifndef IND_LIST_DYN for ( i = 0; i < MAX_NUM_METADATA; ++i ) { for ( j = 0; j < MAX_BITS_METADATA; ++j ) @@ -151,6 +154,7 @@ ivas_error IVAS_ENC_Open( ( *phIvasEnc )->ind_list_metadata[i][j].value = 0; } } +#endif /*-----------------------------------------------------------------* * Allocate IVAS-codec encoder state @@ -220,13 +224,7 @@ void IVAS_ENC_Close( ( *phIvasEnc )->st_ivas = NULL; -#ifdef BITSTREAM_INDICES_MEMORY -#define WMC_TOOL_SKIP - free( *phIvasEnc ); -#undef WMC_TOOL_SKIP -#else free( *phIvasEnc ); -#endif *phIvasEnc = NULL; phIvasEnc = NULL; @@ -923,7 +921,16 @@ static ivas_error configureEncoder( * Finalize initialization *-----------------------------------------------------------------*/ - if ( ( error = ivas_init_encoder( st_ivas, hIvasEnc->ind_list, hIvasEnc->ind_list_metadata ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_init_encoder( st_ivas +#ifndef IND_LIST_DYN + , + hIvasEnc->ind_list +#endif +#ifndef IND_LIST_DYN + , + hIvasEnc->ind_list_metadata +#endif + ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index ec7fb594d1..b0e01d16f7 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -51,11 +51,20 @@ * Indice *------------------------------------------------------------------------------------------*/ +#ifdef IND_LIST_DYN +typedef struct +{ + int16_t id; /* id of the indice */ + uint16_t value; /* value of the quantized indice */ + int16_t nb_bits; /* number of bits used for the quantization of the indice */ +} Indice, *INDICE_HANDLE; +#else typedef struct { uint16_t value; /* value of the quantized indice */ int16_t nb_bits; /* number of bits used for the quantization of the indice */ } Indice; +#endif /*----------------------------------------------------------------------------------* * Bitstream structure @@ -63,11 +72,16 @@ typedef struct typedef struct bitstream_enc_data_structure { +#ifdef IND_LIST_DYN + int16_t nb_ind_tot; /* total number of indices already written */ +#endif int16_t nb_bits_tot; /* total number of bits already written */ Indice *ind_list; /* list of indices */ - int16_t next_ind; /* pointer to the next empty slot in the list of indices */ +#ifndef IND_LIST_DYN + int16_t next_ind; /* pointer to the next empty slot in the list of indices */ int16_t last_ind; /* last written indice */ - +#endif + int16_t max_num_indices; /* maximum number of indices in the list */ } BSTR_ENC_DATA, *BSTR_ENC_HANDLE; /*----------------------------------------------------------------------------------* diff --git a/lib_enc/tcx_utils_enc.c b/lib_enc/tcx_utils_enc.c index ba709f0158..2dd5340992 100644 --- a/lib_enc/tcx_utils_enc.c +++ b/lib_enc/tcx_utils_enc.c @@ -1486,11 +1486,19 @@ void ProcessIGF( } else { +#ifdef IND_LIST_DYN + pBsStart = hBstr->nb_ind_tot; +#else pBsStart = hBstr->next_ind; +#endif IGFEncWriteBitstream( hIGFEnc, hBstr, &hIGFEnc->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag ); +#ifdef IND_LIST_DYN + bsBits = hBstr->nb_ind_tot - pBsStart; +#else bsBits = hBstr->next_ind - pBsStart; +#endif IGFEncConcatenateBitstream( hIGFEnc, bsBits, hBstr ); } @@ -1570,11 +1578,19 @@ void ProcessStereoIGF( else { hBstr = sts[ch]->hBstr; +#ifdef IND_LIST_DYN + pBsStart = hBstr->nb_ind_tot; +#else pBsStart = hBstr->next_ind; +#endif IGFEncWriteBitstream( hIGFEnc[ch], hBstr, &hIGFEnc[ch]->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag ); +#ifdef IND_LIST_DYN + bsBits = hBstr->nb_ind_tot - pBsStart; +#else bsBits = hBstr->next_ind - pBsStart; +#endif IGFEncConcatenateBitstream( hIGFEnc[ch], bsBits, hBstr ); } } -- GitLab From 6124eb866602ce4b7cbc8c2bfeaf58a87a56a4a6 Mon Sep 17 00:00:00 2001 From: malenov Date: Tue, 28 Mar 2023 20:11:35 +0200 Subject: [PATCH 24/43] adjust the max number of indices for ISM3 at 384 kbps --- lib_com/bitstream.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index c28c04112b..9406031323 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -320,7 +320,7 @@ int16_t get_max_num_indices( /* o : maximum numb } else { - return 700; + return 760; } } else if ( ivas_format == SBA_FORMAT ) @@ -518,7 +518,7 @@ ivas_error push_indice( if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) { #ifdef DEBUGGING - DEBUG_LINE( 1 ) + DEBUG_LINE( 0 ) printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); #endif @@ -651,7 +651,7 @@ ivas_error push_next_indice( if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) { #ifdef DEBUGGING - DEBUG_LINE( 1 ) + DEBUG_LINE( 0 ) printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); #endif @@ -728,7 +728,7 @@ void push_next_bits( #ifdef IND_LIST_DYN ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; - /* get the id of the previous indice -> will be re-used here as well */ + /* get the id of the previous indice -> will be re-used */ if ( hBstr->nb_ind_tot > 0 ) { prev_id = hBstr->ind_list[hBstr->nb_ind_tot - 1].id; @@ -762,16 +762,21 @@ void push_next_bits( if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) { #ifdef DEBUGGING - DEBUG_LINE( 1 ) + DEBUG_LINE( 0 ) printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); #endif /* reallocate the buffer of indices with increased limit */ ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); + ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; } -#endif - + else + { + ++ptr; + } +#else ++ptr; +#endif } for ( ; i < nb_bits; ++i ) @@ -792,16 +797,21 @@ void push_next_bits( if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) { #ifdef DEBUGGING - DEBUG_LINE( 1 ) + DEBUG_LINE( 0 ) printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); #endif /* reallocate the buffer of indices with increased limit */ ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); + ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; } -#endif - + else + { + ++ptr; + } +#else ++ptr; +#endif } #ifndef IND_LIST_DYN -- GitLab From 58afcaf4bb10fb333db82da8f3fbbd74e016cbb9 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Tue, 28 Mar 2023 20:21:58 +0200 Subject: [PATCH 25/43] clang format --- lib_com/prot.h | 2 +- lib_enc/dtx.c | 2 +- lib_enc/enc_ppp.c | 4 ++-- lib_enc/init_enc.c | 2 +- lib_enc/ivas_core_enc.c | 4 ++-- lib_enc/ivas_cpe_enc.c | 2 +- lib_enc/ivas_sce_enc.c | 6 +++--- lib_enc/ivas_spar_encoder.c | 4 ++-- lib_enc/ivas_stereo_mdct_core_enc.c | 2 +- lib_enc/stat_enc.h | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib_com/prot.h b/lib_com/prot.h index 72b29413c8..8430df6a7c 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -2256,7 +2256,7 @@ void read_next_force( #endif ivas_error init_encoder( - Encoder_State *st, /* i/o: state structure */ + Encoder_State *st, /* i/o: state structure */ #ifdef IND_LIST_DYN ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : encoder configuration handle */ #endif diff --git a/lib_enc/dtx.c b/lib_enc/dtx.c index 9656f96eb6..652c28f139 100644 --- a/lib_enc/dtx.c +++ b/lib_enc/dtx.c @@ -259,7 +259,7 @@ void dtx( /* reset the bitstream (IVAS format signaling was already written) */ if ( st->element_mode != IVAS_CPE_MDCT && st->hBstr != NULL ) { - reset_indices_enc( st->hBstr, + reset_indices_enc( st->hBstr, #ifdef IND_LIST_DYN st->hBstr->max_num_indices #else diff --git a/lib_enc/enc_ppp.c b/lib_enc/enc_ppp.c index 462557035f..1bfed647dc 100644 --- a/lib_enc/enc_ppp.c +++ b/lib_enc/enc_ppp.c @@ -171,9 +171,9 @@ ivas_error encod_ppp( /* delete previous indices */ reset_indices_enc( hBstr, #ifdef IND_LIST_DYN - hBstr->max_num_indices + hBstr->max_num_indices #else - MAX_NUM_INDICES + MAX_NUM_INDICES #endif ); diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index acf5298734..9c11420560 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -54,7 +54,7 @@ *-----------------------------------------------------------------------*/ ivas_error init_encoder( - Encoder_State *st, /* i/o: state structure */ + Encoder_State *st, /* i/o: state structure */ #ifdef IND_LIST_DYN ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : encoder configuration handle */ #endif diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 9c29f60b71..040a8469c5 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -282,11 +282,11 @@ ivas_error ivas_core_enc( } else { - stereo_mdct_core_enc( hCPE, + stereo_mdct_core_enc( hCPE, #ifdef IND_LIST_DYN ivas_format, #endif - old_inp_16k, old_wsp, pitch_buf ); + old_inp_16k, old_wsp, pitch_buf ); } } else if ( sts[0]->core_brate == SID_2k40 && sts[1]->core_brate == SID_2k40 ) diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 82cda2357a..5a39b1935e 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -846,7 +846,7 @@ ivas_error create_cpe_enc( } if ( ( error = init_encoder( st, - + #ifdef IND_LIST_DYN hEncoderConfig, #endif diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index e54fee386b..6c75de4113 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -345,11 +345,11 @@ ivas_error create_sce_enc( st->total_brate = hSCE->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; - if ( ( error = init_encoder( st, + if ( ( error = init_encoder( st, #ifdef IND_LIST_DYN st_ivas->hEncoderConfig, -#endif - 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) +#endif + 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 05329491a1..b6b79e3fa6 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -205,8 +205,8 @@ ivas_error ivas_spar_enc_open( if ( ( error = init_encoder( hSpar->hCoreCoderVAD, #ifdef IND_LIST_DYN hEncoderConfig, -#endif - 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) +#endif + 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_stereo_mdct_core_enc.c b/lib_enc/ivas_stereo_mdct_core_enc.c index 7cf4a930b5..047db979e2 100644 --- a/lib_enc/ivas_stereo_mdct_core_enc.c +++ b/lib_enc/ivas_stereo_mdct_core_enc.c @@ -116,7 +116,7 @@ static void sync_tcx_mode( *-------------------------------------------------------------------*/ void stereo_mdct_core_enc( - CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ + CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ #ifdef IND_LIST_DYN const int16_t ivas_format, /* i : IVAS format */ #endif diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index b0e01d16f7..c37ed76dc7 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -79,7 +79,7 @@ typedef struct bitstream_enc_data_structure Indice *ind_list; /* list of indices */ #ifndef IND_LIST_DYN int16_t next_ind; /* pointer to the next empty slot in the list of indices */ - int16_t last_ind; /* last written indice */ + int16_t last_ind; /* last written indice */ #endif int16_t max_num_indices; /* maximum number of indices in the list */ } BSTR_ENC_DATA, *BSTR_ENC_HANDLE; -- GitLab From d9c1c08f48c32239a95695bc09ccccdb2c39d8e8 Mon Sep 17 00:00:00 2001 From: malenov Date: Wed, 29 Mar 2023 13:12:37 +0200 Subject: [PATCH 26/43] Fix re-allocation to avoid out-of-mem access (limit loop to max_num_indices) --- lib_com/bitstream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 9406031323..5feaf34186 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -243,7 +243,7 @@ ivas_error ind_list_realloc( /* move indices from the old list to the new list */ i = 0; - while ( hBstr->ind_list[i].nb_bits > 0 ) + while ( hBstr->ind_list[i].nb_bits > 0 && i < hBstr->max_num_indices ) { new_ind_list[i].id = hBstr->ind_list[i].id; new_ind_list[i].value = hBstr->ind_list[i].value; -- GitLab From 3e3a924dc21b8990db6fae1051c0cb7e5a0f3130 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Thu, 13 Apr 2023 12:02:11 +0200 Subject: [PATCH 27/43] refactoring of ind_list allocation mechanism based on long buffer --- apps/encoder.c | 2 + lib_com/bitstream.c | 749 +++++++++++++++++++++----- lib_com/ivas_cnst.h | 3 + lib_com/ivas_prot.h | 3 - lib_com/options.h | 1 + lib_com/options.h.unchanged | 170 ++++++ lib_com/prot.h | 31 +- lib_enc/dtx.c | 2 +- lib_enc/enc_ppp.c | 2 +- lib_enc/evs_enc.c | 15 +- lib_enc/fd_cng_enc.c | 19 +- lib_enc/init_enc.c | 20 +- lib_enc/ivas_core_enc.c | 55 +- lib_enc/ivas_corecoder_enc_reconfig.c | 179 +++--- lib_enc/ivas_cpe_enc.c | 23 +- lib_enc/ivas_enc.c | 5 + lib_enc/ivas_init_enc.c | 81 ++- lib_enc/ivas_ism_dtx_enc.c | 4 +- lib_enc/ivas_ism_enc.c | 15 + lib_enc/ivas_ism_metadata_enc.c | 2 +- lib_enc/ivas_masa_enc.c | 33 -- lib_enc/ivas_mct_core_enc.c | 7 + lib_enc/ivas_mct_enc.c | 7 + lib_enc/ivas_mct_enc_mct.c | 19 + lib_enc/ivas_mdct_core_enc.c | 8 + lib_enc/ivas_qmetadata_enc.c | 2 +- lib_enc/ivas_sce_enc.c | 26 +- lib_enc/ivas_spar_encoder.c | 2 +- lib_enc/ivas_spar_md_enc.c | 13 +- lib_enc/ivas_stat_enc.h | 13 + lib_enc/ivas_stereo_mdct_core_enc.c | 34 +- lib_enc/ivas_stereo_td_enc.c | 54 ++ lib_enc/lib_enc.c | 102 ++++ lib_enc/stat_enc.h | 5 +- lib_enc/tcx_utils_enc.c | 7 +- 35 files changed, 1293 insertions(+), 420 deletions(-) create mode 100644 lib_com/options.h.unchanged diff --git a/apps/encoder.c b/apps/encoder.c index ff6f461838..5e5150d24c 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -760,10 +760,12 @@ int main( } frame++; +#ifndef DEBUG_IND_LIST if ( !arg.quietModeEnabled ) { fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame ); } +#endif #ifdef WMOPS update_mem(); diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 5feaf34186..4d74baf88e 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -224,7 +224,7 @@ Word16 rate2EVSmode( /*-------------------------------------------------------------------* * ind_list_realloc() * - * Re-allocate the list of indices as the maximum number of allowed indices has changed + * Re-allocate the list of indices *-------------------------------------------------------------------*/ ivas_error ind_list_realloc( @@ -232,7 +232,7 @@ ivas_error ind_list_realloc( int16_t max_num_indices /* i : new maximum number of allowed indices in the list */ ) { - int16_t i; + int16_t i, ind_list_pos; INDICE_HANDLE new_ind_list; /* allocate new buffer of indices */ @@ -242,13 +242,14 @@ ivas_error ind_list_realloc( } /* move indices from the old list to the new list */ - i = 0; - while ( hBstr->ind_list[i].nb_bits > 0 && i < hBstr->max_num_indices ) + for ( i = 0; i < min(max_num_indices, *( hBstr->ivas_max_num_indices )); i++ ) { - new_ind_list[i].id = hBstr->ind_list[i].id; - new_ind_list[i].value = hBstr->ind_list[i].value; - new_ind_list[i].nb_bits = hBstr->ind_list[i].nb_bits; - i++; + if ( hBstr->ivas_ind_list_zero[i].nb_bits > -1 ) + { + new_ind_list[i].id = hBstr->ivas_ind_list_zero[i].id; + new_ind_list[i].value = hBstr->ivas_ind_list_zero[i].value; + } + new_ind_list[i].nb_bits = hBstr->ivas_ind_list_zero[i].nb_bits; } /* reset nb_bits of all other indices to -1 */ @@ -257,125 +258,465 @@ ivas_error ind_list_realloc( new_ind_list[i].nb_bits = -1; } + /* get the current position inside the old list */ + ind_list_pos = (int16_t)(hBstr->ind_list - hBstr->ivas_ind_list_zero); + /* free the old list */ - free( hBstr->ind_list ); + free( hBstr->ivas_ind_list_zero ); - /* set pointer to the new list */ - hBstr->ind_list = new_ind_list; + /* set pointers in the new list */ + hBstr->ind_list = &new_ind_list[ind_list_pos]; + hBstr->ivas_ind_list_zero = new_ind_list; - /* set the new maximum for the allowed number of indices */ - hBstr->max_num_indices = max_num_indices; + /* set the new maximum number of indices */ + *(hBstr->ivas_max_num_indices) = max_num_indices; return IVAS_ERR_OK; } /*-----------------------------------------------------------------------* - * get_max_num_indices() + * get_ivas_max_num_indices() * - * Set the maximum allowed number of indices in the list + * Get the maximum allowed number of indices in the encoder *-----------------------------------------------------------------------*/ -int16_t get_max_num_indices( /* o : maximum number of indices */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t total_brate /* i : total bitrate */ +int16_t get_ivas_max_num_indices( /* o : maximum number of indices */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ ) { - /* set the maximum required number of indices */ - if ( ivas_format == MONO_FORMAT ) + if ( ivas_format == STEREO_FORMAT ) { - if ( total_brate < IVAS_24k4 ) + if ( ivas_total_brate <= IVAS_16k4 ) + { + return 300; + } + else if ( ivas_total_brate <= IVAS_24k4 ) + { + return 400; + } + else if ( ivas_total_brate <= IVAS_32k ) { return 450; } + else if ( ivas_total_brate <= IVAS_48k ) + { + return 650; + } + else if ( ivas_total_brate <= IVAS_80k ) + { + return 750; + } + else if ( ivas_total_brate <= IVAS_128k ) + { + return 850; + } + else if ( ivas_total_brate <= IVAS_192k ) + { + return 950; + } + else if ( ivas_total_brate <= IVAS_256k ) + { + return 1350; + } else { - return 450; + return 1650; } } - else if ( ivas_format == STEREO_FORMAT ) + else if ( ivas_format == ISM_FORMAT || ivas_format == MONO_FORMAT ) { - if ( total_brate < IVAS_24k4 ) + if ( ivas_total_brate <= IVAS_16k4 ) { return 250; } - else if ( total_brate < IVAS_128k ) + else if ( ivas_total_brate <= IVAS_24k4 ) + { + return 350; + } + else if ( ivas_total_brate <= IVAS_32k ) { return 450; } - else + else if ( ivas_total_brate <= IVAS_48k ) { return 550; } - } - else if ( ivas_format == ISM_FORMAT ) - { - if ( total_brate < IVAS_24k4 ) + else if ( ivas_total_brate <= IVAS_64k ) { - return 250; + return 620; } - else if ( total_brate < IVAS_128k ) + else if ( ivas_total_brate <= IVAS_80k ) { - return 450; + return 670; + } + else if ( ivas_total_brate <= IVAS_96k ) + { + return 780; + } + else if ( ivas_total_brate <= IVAS_128k ) + { + return 880; + } + else if ( ivas_total_brate <= IVAS_192k ) + { + return 950; + } + else if ( ivas_total_brate <= IVAS_256k ) + { + return 1100; + } + else if ( ivas_total_brate <= IVAS_384k ) + { + return 1300; } else { - return 760; + return 1650; } } else if ( ivas_format == SBA_FORMAT ) { - if ( total_brate < IVAS_24k4 ) + if ( ivas_total_brate <= IVAS_16k4 ) { return 250; } - else if ( total_brate < IVAS_128k ) + else if ( ivas_total_brate <= IVAS_24k4 ) { - return 450; + return 350; + } + else if ( ivas_total_brate <= IVAS_32k ) + { + return 400; + } + else if ( ivas_total_brate <= IVAS_48k ) + { + return 650; + } + else if ( ivas_total_brate <= IVAS_80k ) + { + return 750; + } + else if ( ivas_total_brate <= IVAS_128k ) + { + return 1020; + } + else if ( ivas_total_brate <= IVAS_160k ) + { + return 1160; + } + else if ( ivas_total_brate <= IVAS_192k ) + { + return 1220; + } + else if ( ivas_total_brate <= IVAS_256k ) + { + return 1300; + } + else if ( ivas_total_brate <= IVAS_384k ) + { + return 1720; } else { - return 700; + return 2000; } } else if ( ivas_format == MASA_FORMAT ) { - if ( total_brate < IVAS_24k4 ) + if ( ivas_total_brate <= IVAS_16k4 ) + { + return 300; + } + else if ( ivas_total_brate <= IVAS_32k ) + { + return 400; + } + else if ( ivas_total_brate <= IVAS_48k ) + { + return 650; + } + else if ( ivas_total_brate <= IVAS_80k ) + { + return 750; + } + else if ( ivas_total_brate <= IVAS_160k ) + { + return 850; + } + else if ( ivas_total_brate <= IVAS_192k ) + { + return 950; + } + else if ( ivas_total_brate <= IVAS_256k ) + { + return 1150; + } + else if ( ivas_total_brate <= IVAS_384k ) + { + return 1450; + } + else + { + return 1650; + } + } + else if ( ivas_format == MC_FORMAT ) + { + if ( ivas_total_brate <= IVAS_16k4 ) { return 250; } - else if ( total_brate < IVAS_160k ) + else if ( ivas_total_brate <= IVAS_24k4 ) { - return 450; + return 350; + } + else if ( ivas_total_brate <= IVAS_32k ) + { + return 400; + } + else if ( ivas_total_brate <= IVAS_48k ) + { + return 650; + } + else if ( ivas_total_brate <= IVAS_64k ) + { + return 750; + } + else if ( ivas_total_brate <= IVAS_80k ) + { + return 850; + } + else if ( ivas_total_brate <= IVAS_128k ) + { + return 1150; + } + else if ( ivas_total_brate <= IVAS_160k ) + { + return 1420; + } + else if ( ivas_total_brate <= IVAS_256k ) + { + return 2120; + } + else if ( ivas_total_brate <= IVAS_384k ) + { + return 2250; } else + { + return 2450; + } + } + + return 2450; +} + +/*-----------------------------------------------------------------------* + * get_core_max_num_indices() + * + * Get the maximum allowed number of indices in the core coder + *-----------------------------------------------------------------------*/ + +int16_t get_core_max_num_indices( /* o : maximum number of indices */ + const int16_t core, /* i : core */ + const int32_t total_brate /* i : total bitrate */ +) +{ + /* set the maximum number of indices in the core coder */ + if ( core == ACELP_CORE || core == AMR_WB_CORE ) + { + if ( total_brate <= 9600 ) + { + return 60; + } + else if ( total_brate <= IVAS_13k2 ) + { + return 70; + } + else if ( total_brate <= IVAS_16k4 ) + { + return 80; + } + else if ( total_brate <= IVAS_24k4 ) + { + return 100; + } + else if ( total_brate <= IVAS_32k ) + { + return 180; + } + else if ( total_brate <= IVAS_48k ) + { + return 340; + } + else if ( total_brate <= IVAS_80k ) + { + return 450; + } + else if ( total_brate <= IVAS_96k ) + { + return 500; + } + else if ( total_brate <= IVAS_128k ) + { + return 550; + } + else if ( total_brate <= IVAS_160k ) + { + return 600; + } + else if ( total_brate <= IVAS_192k ) + { + return 650; + } + else if ( total_brate <= IVAS_256k ) { return 700; } + else + { + return 800; + } } - else if ( ivas_format == MC_FORMAT ) + else if ( core == TCX_20_CORE || core == TCX_10_CORE ) + { + if ( total_brate <= 9600 ) + { + return 100; + } + else if ( total_brate <= IVAS_13k2 ) + { + return 150; + } + else if ( total_brate <= IVAS_16k4 ) + { + return 200; + } + else if ( total_brate <= IVAS_24k4 ) + { + return 310; + } + else if ( total_brate <= IVAS_32k ) + { + return 330; + } + else if ( total_brate <= IVAS_48k ) + { + return 340; + } + else if ( total_brate <= IVAS_80k ) + { + return 380; + } + else if ( total_brate <= IVAS_96k ) + { + return 400; + } + else if ( total_brate <= IVAS_128k ) + { + return 460; + } + else if ( total_brate <= IVAS_160k ) + { + return 470; + } + else if ( total_brate <= IVAS_192k ) + { + return 570; + } + else if ( total_brate <= IVAS_256k ) + { + return 680; + } + else + { + return 800; + } + } + else if ( core == HQ_CORE ) { - if ( total_brate < IVAS_24k4 ) + if ( total_brate <= 9600 ) + { + return 100; + } + else if ( total_brate <= IVAS_16k4 ) + { + return 200; + } + else if ( total_brate <= IVAS_24k4 ) + { + return 240; + } + else if ( total_brate <= IVAS_32k ) + { + return 300; + } + else if ( total_brate <= IVAS_48k ) + { + return 380; + } + else if ( total_brate <= IVAS_96k ) + { + return 400; + } + else if ( total_brate <= IVAS_128k ) { return 450; } + else if ( total_brate <= IVAS_160k ) + { + return 550; + } + else if ( total_brate <= IVAS_192k ) + { + return 600; + } + else if ( total_brate <= IVAS_256k ) + { + return 700; + } else { - return 1050; + return 800; } } + else + { + return 50; + } +} + +/*-----------------------------------------------------------------------* + * get_BWE_max_num_indices() + * + * Get the maximum number of indices in the BWE + *-----------------------------------------------------------------------*/ - return 1050; +int16_t get_BWE_max_num_indices( /* o : maximum number of indices */ + const int32_t extl_brate /* i : extensiona layer bitrate */ +) +{ + /* set the maximum number of indices in the BWE */ + if ( extl_brate < SWB_BWE_16k ) + { + return 30; + } + else + { + return 150; + } } + -#ifdef IND_LIST_DYN /*-----------------------------------------------------------------------* - * set_max_set_max_num_indices_metadatanum_indices() + * get_ivas_max_num_indices_metadata() * * Set the maximum allowed number of metadata indices in the list *-----------------------------------------------------------------------*/ -int16_t get_max_num_indices_metadata( /* o : maximum number of indices */ +int16_t get_ivas_max_num_indices_metadata( /* o : maximum number of indices */ const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int32_t ivas_total_brate /* i : IVAS total bitrate */ ) @@ -387,71 +728,235 @@ int16_t get_max_num_indices_metadata( /* o : max } else if ( ivas_format == STEREO_FORMAT ) { - return 80; + if ( ivas_total_brate <= IVAS_16k4 ) + { + return 40; + } + else + { + return 80; + } } else if ( ivas_format == ISM_FORMAT ) { - return 60; + if ( ivas_total_brate <= IVAS_16k4 ) + { + return 20; + } + else if ( ivas_total_brate <= IVAS_32k ) + { + return 65; + } + else + { + return 30; + } } else if ( ivas_format == SBA_FORMAT ) { - if ( ivas_total_brate < IVAS_24k4 ) + if ( ivas_total_brate <= IVAS_16k4 ) { - return 80; + return 100; } - else if ( ivas_total_brate < IVAS_48k ) + else if ( ivas_total_brate <= IVAS_24k4 ) { - return 670; + return 200; + } + else if ( ivas_total_brate <= IVAS_32k ) + { + return 250; + } + else if ( ivas_total_brate <= IVAS_192k ) + { + return 300; + } + else if ( ivas_total_brate <= IVAS_256k ) + { + return 1000; + } + else if ( ivas_total_brate <= IVAS_384k ) + { + return 1000; } else { - return 1060; + return 1000; } } else if ( ivas_format == MASA_FORMAT ) { - if ( ivas_total_brate < IVAS_32k ) + if ( ivas_total_brate <= IVAS_16k4 ) { - return 90; + return 80; } - else if ( ivas_total_brate < IVAS_48k ) + else if ( ivas_total_brate <= IVAS_32k ) { - return 130; + return 110; } - else if ( ivas_total_brate < IVAS_192k ) + else if ( ivas_total_brate <= IVAS_48k ) { - return 330; + return 180; } - else if ( ivas_total_brate < IVAS_384k ) + else if ( ivas_total_brate <= IVAS_96k ) { - return 1000; + return 200; + } + else if ( ivas_total_brate <= IVAS_128k ) + { + return 250; + } + else if ( ivas_total_brate <= IVAS_160k ) + { + return 320; + } + else if ( ivas_total_brate <= IVAS_192k ) + { + return 430; + } + else if ( ivas_total_brate <= IVAS_256k ) + { + return 600; + } + else if ( ivas_total_brate <= IVAS_384k ) + { + return 850; } else { - return 1950; + return 900; } } else if ( ivas_format == MC_FORMAT ) { - if ( ivas_total_brate == IVAS_32k || ivas_total_brate == IVAS_48k || ivas_total_brate == IVAS_64k ) + if ( ivas_total_brate <= IVAS_13k2 ) { - return 300; + return 80; + } + else if ( ivas_total_brate <= IVAS_24k4 ) + { + return 100; + } + else if ( ivas_total_brate <= IVAS_64k ) + { + return 200; } - if ( ivas_total_brate == IVAS_80k || ivas_total_brate == IVAS_96k ) + else if ( ivas_total_brate <= IVAS_96k ) { - return 170; + return 220; } else { - return 90; + return 60; + } + } + + return 50; +} + +/*-------------------------------------------------------------------* + * move_indices() + * + * Move indices inside the buffer or among two buffers + *-------------------------------------------------------------------*/ + +ivas_error move_indices( + INDICE_HANDLE old_ind_list, /* i/o: old location of indices */ + INDICE_HANDLE new_ind_list, /* i/o: new location of indices */ + const int16_t nb_indices /* i : number of moved indices */ +) +{ + int16_t i; + ivas_error error; + + error = IVAS_ERR_OK; + + if ( new_ind_list < old_ind_list ) + { + for ( i = 0; i < nb_indices; i++ ) + { + new_ind_list[i].id = old_ind_list[i].id; + new_ind_list[i].value = old_ind_list[i].value; + new_ind_list[i].nb_bits = old_ind_list[i].nb_bits; + + old_ind_list[i].nb_bits = -1; + } + } + else if ( new_ind_list > old_ind_list ) + { + for ( i = nb_indices - 1; i >= 0; i-- ) + { + new_ind_list[i].id = old_ind_list[i].id; + new_ind_list[i].value = old_ind_list[i].value; + new_ind_list[i].nb_bits = old_ind_list[i].nb_bits; + + old_ind_list[i].nb_bits = -1; } } - return 1050; + return error; } + #endif + +#ifdef IND_LIST_DYN +/*-------------------------------------------------------------------* + * check_ind_list_limits() + * + * Check, if if the maximum number of indices has been reached -> reallocate + * Check, if we will not overwrite an existing indice -> adjust the location + *-------------------------------------------------------------------*/ + +ivas_error check_ind_list_limits( + BSTR_ENC_HANDLE hBstr /* i/o: encoder bitstream handle */ +) +{ + ivas_error error; + + error = IVAS_ERR_OK; + + /* check, if the maximum number of indices has been reached and re-allocate the buffer */ + /* the re-allocation can be avoided by increasing the limits in get_ivas_max_num_indices() or get_ivas_max_num_indices_metadata() */ + if ( ( &hBstr->ind_list[hBstr->nb_ind_tot] - hBstr->ivas_ind_list_zero ) >= *( hBstr->ivas_max_num_indices ) ) + { +#ifdef DEBUGGING + fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame ); #endif + /* reallocate the buffer of indices with increased limit */ + ind_list_realloc( hBstr, *( hBstr->ivas_max_num_indices ) + STEP_MAX_NUM_INDICES ); + } + + /* check, if we will not overwrite an existing indice */ + if ( hBstr->ind_list[hBstr->nb_ind_tot].nb_bits > 0 ) + { + if ( hBstr->nb_ind_tot == 0 ) + { +#ifdef DEBUGGING + fprintf( stderr, "Warning: Trying to overwrite an existing indice ID = %d in frame %d!\n", hBstr->ind_list[hBstr->nb_ind_tot].id, frame ); +#endif + /* move the pointer to the next available empty slot */ + while ( hBstr->ind_list[0].nb_bits > 0 && hBstr->ind_list < &hBstr->ivas_ind_list_zero[*( hBstr->ivas_max_num_indices )] ) + { + hBstr->ind_list++; + } + + if ( hBstr->ind_list >= &hBstr->ivas_ind_list_zero[*( hBstr->ivas_max_num_indices )] ) + { + /* no available empty slot -> need to re-allocate the buffer */ + ind_list_realloc( hBstr, *( hBstr->ivas_max_num_indices ) + STEP_MAX_NUM_INDICES ); + } + } + else + { + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Buffer of indices corrupted in frame %d! Attempt to overwrite indice ID = %d (value: %d, bits: %d)!\n", frame, hBstr->ind_list[hBstr->nb_ind_tot].id, hBstr->ind_list[hBstr->nb_ind_tot].value, hBstr->ind_list[hBstr->nb_ind_tot].nb_bits ); + } + } + + return error; +} +#endif + + /*-------------------------------------------------------------------* * push_indice() * @@ -491,6 +996,7 @@ ivas_error push_indice( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Indice ID = %d with value %d exceeds the range of %d bits (frame %d) !\n", id, value, nb_bits, frame ); } +#ifndef IND_LIST_DYN #if 0 /* mul, 2020-11-19: to be de-activated until proper solution found */ if ( nb_bits < 1 ) @@ -498,6 +1004,7 @@ ivas_error push_indice( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, " Trying to push indice ID = %d with value %d that has %d bits (frame %d) !\n", id, value, nb_bits, frame ); } else +#endif #endif if ( nb_bits > 16 ) { @@ -513,29 +1020,19 @@ ivas_error push_indice( #endif #ifdef IND_LIST_DYN - /* check, if the maximum number of indices has been reached and re-allocate the buffer */ - /* the re-allocation can be avoided by increasing the limits in get_max_num_indices() and get_max_num_indices_metadata() */ - if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) - { -#ifdef DEBUGGING - DEBUG_LINE( 0 ) - printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); -#endif - - /* reallocate the buffer of indices with increased limit */ - ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); - } + /* check the limits in the list of indices */ + error = check_ind_list_limits( hBstr ); #endif #ifdef IND_LIST_DYN - /* find the location in the list of indices */ + /* find the location in the list of indices based on ID */ i = hBstr->nb_ind_tot; while ( i > 0 && id < hBstr->ind_list[i - 1].id ) { i--; } - /* shift indices, if the new id is to be written somewhere inside the list */ + /* shift indices, if the new ID is to be written somewhere inside the list */ if ( i < hBstr->nb_ind_tot ) { for ( j = hBstr->nb_ind_tot; j > i; j-- ) @@ -646,21 +1143,10 @@ ivas_error push_next_indice( #endif #ifdef IND_LIST_DYN - /* check, if the maximum number of indices has been reached and re-allocate the buffer */ - /* the re-allocation can be avoided by increasing the limits in get_max_num_indices() and get_max_num_indices_metadata() */ - if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) - { -#ifdef DEBUGGING - DEBUG_LINE( 0 ) - printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); + /* check the limits in the list of indices */ + error = check_ind_list_limits( hBstr ); #endif - /* reallocate the buffer of indices with increased limit */ - ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); - } -#endif - - #ifdef IND_LIST_DYN /* get the id of the previous indice -> it will be re-used */ if ( hBstr->nb_ind_tot > 0 ) @@ -746,6 +1232,12 @@ void push_next_bits( { code = (uint16_t) ( ( bits[i] << 15 ) | ( ( bits[i + 1] << 14 ) | ( ( bits[i + 2] << 13 ) | ( ( bits[i + 3] << 12 ) | ( ( bits[i + 4] << 11 ) | ( ( bits[i + 5] << 10 ) | ( ( bits[i + 6] << 9 ) | ( ( bits[i + 7] << 8 ) | ( ( bits[i + 8] << 7 ) | ( ( bits[i + 9] << 6 ) | ( ( bits[i + 10] << 5 ) | ( ( bits[i + 11] << 4 ) | ( ( bits[i + 12] << 3 ) | ( ( bits[i + 13] << 2 ) | ( ( bits[i + 14] << 1 ) | bits[i + 15] ) ) ) ) ) ) ) ) ) ) ) ) ) ) ); +#ifdef IND_LIST_DYN + /* check the limits in the list of indices */ + check_ind_list_limits( hBstr ); + ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; +#endif + ptr->value = code; #ifdef DEBUG_BS_READ_WRITE printf( "code: %d\n", code ); @@ -755,32 +1247,17 @@ void push_next_bits( ptr->id = prev_id; hBstr->nb_ind_tot++; #endif - -#ifdef IND_LIST_DYN - /* check, if the maximum number of indices has been reached and re-allocate the buffer */ - /* the re-allocation can be avoided by increasing the limits in get_max_num_indices() and get_max_num_indices_metadata() */ - if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) - { -#ifdef DEBUGGING - DEBUG_LINE( 0 ) - printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); -#endif - - /* reallocate the buffer of indices with increased limit */ - ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); - ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; - } - else - { - ++ptr; - } -#else ++ptr; -#endif } for ( ; i < nb_bits; ++i ) { +#ifdef IND_LIST_DYN + /* check the limits in the list of indices */ + check_ind_list_limits( hBstr ); + ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; +#endif + ptr->value = bits[i]; #ifdef DEBUG_BS_READ_WRITE printf( "value: %d\n", ptr->value ); @@ -790,28 +1267,7 @@ void push_next_bits( ptr->id = prev_id; hBstr->nb_ind_tot++; #endif - -#ifdef IND_LIST_DYN - /* check, if the maximum number of indices has been reached and re-allocate the buffer */ - /* the re-allocation can be avoided by increasing the limits in get_max_num_indices() and get_max_num_indices_metadata() */ - if ( hBstr->nb_ind_tot >= hBstr->max_num_indices ) - { -#ifdef DEBUGGING - DEBUG_LINE( 0 ) - printf( "Warning: Maximum number of indices %d has been exceeded (frame %d)! Increase the limits in get_max_num_indices() or get_max_num_indices_metadata().\n", hBstr->max_num_indices, frame ); -#endif - - /* reallocate the buffer of indices with increased limit */ - ind_list_realloc( hBstr, hBstr->nb_ind_tot + STEP_MAX_NUM_INDICES ); - ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; - } - else - { - ++ptr; - } -#else ++ptr; -#endif } #ifndef IND_LIST_DYN @@ -1123,8 +1579,6 @@ void reset_indices_enc( hBstr->nb_ind_tot = 0; #else hBstr->next_ind = 0; -#endif -#ifndef IND_LIST_DYN hBstr->last_ind = -1; #endif @@ -1391,7 +1845,7 @@ static ivas_error write_indices_element( if ( st_ivas->hSCE[element_id]->hMetaData != NULL ) { #ifdef IND_LIST_DYN - reset_indices_enc( st_ivas->hSCE[element_id]->hMetaData, st_ivas->hSCE[element_id]->hMetaData->max_num_indices ); + reset_indices_enc( st_ivas->hSCE[element_id]->hMetaData, st_ivas->hSCE[element_id]->hMetaData->nb_ind_tot ); #else reset_indices_enc( st_ivas->hSCE[element_id]->hMetaData, MAX_BITS_METADATA ); #endif @@ -1399,7 +1853,7 @@ static ivas_error write_indices_element( reset_indices_enc( sts[0]->hBstr, #ifdef IND_LIST_DYN - sts[0]->hBstr->max_num_indices + sts[0]->hBstr->nb_ind_tot #else MAX_NUM_INDICES #endif @@ -1410,7 +1864,7 @@ static ivas_error write_indices_element( if ( st_ivas->hCPE[element_id]->hMetaData != NULL ) { #ifdef IND_LIST_DYN - reset_indices_enc( st_ivas->hCPE[element_id]->hMetaData, st_ivas->hCPE[element_id]->hMetaData->max_num_indices ); + reset_indices_enc( st_ivas->hCPE[element_id]->hMetaData, st_ivas->hCPE[element_id]->hMetaData->nb_ind_tot ); #else reset_indices_enc( st_ivas->hCPE[element_id]->hMetaData, MAX_BITS_METADATA ); #endif @@ -1418,9 +1872,9 @@ static ivas_error write_indices_element( for ( n = 0; n < n_channels; n++ ) { - reset_indices_enc( sts[n]->hBstr, + reset_indices_enc( sts[n]->hBstr, #ifdef IND_LIST_DYN - sts[n]->hBstr->max_num_indices + sts[n]->hBstr->nb_ind_tot #else MAX_NUM_INDICES #endif @@ -1471,6 +1925,7 @@ ivas_error write_indices_ivas( { sts = st_ivas->hSCE[n]->hCoreCoder; i += sts[0]->hBstr->nb_bits_tot; + if ( st_ivas->hSCE[n]->hMetaData != NULL ) { i += st_ivas->hSCE[n]->hMetaData->nb_bits_tot; @@ -1484,6 +1939,7 @@ ivas_error write_indices_ivas( { i += sts[ch]->hBstr->nb_bits_tot; } + if ( st_ivas->hCPE[n]->hMetaData != NULL ) { i += st_ivas->hCPE[n]->hMetaData->nb_bits_tot; @@ -1501,6 +1957,7 @@ ivas_error write_indices_ivas( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Bitstream write size mismatch! Actual bitrate: %ld vs. Reference bitrate: %d\n", i * 50L, ivas_total_brate ); } #endif + /*-----------------------------------------------------------------* * Encode Payload *-----------------------------------------------------------------*/ diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index b3a022b8cd..63acf66ad8 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -180,7 +180,10 @@ typedef enum #define MAX_NUM_METADATA max( 2, MAX_NUM_OBJECTS ) /* number of max. metadata (now only 2 for DirAC) */ #endif #ifdef IND_LIST_DYN +#define MIN_NUM_IND 10 /* minimum number of indices in the core coder */ +#define MAX_NUM_IND_LFE 100 /* maximum number of indices in the LFE encoder */ #define MAX_NUM_IND_TEMP_LIST 10 /* maximum number of indices in the temporary list */ +#define MAX_IND_TDM_TMP 10 /* maximum number of indices in the temporary list of TD stereo spatial parameters */ #endif #define IVAS_ENC_DELAY_NS ACELP_LOOK_NS diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 9184997dea..2aecd25d7c 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -2094,9 +2094,6 @@ void InternalTCXDecoder( void stereo_mdct_core_enc( CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ -#ifdef IND_LIST_DYN - const int16_t ivas_format, /* i : IVAS format */ -#endif float new_samples[CPE_CHANNELS][L_INP], /* i : new samples */ float old_wsp[CPE_CHANNELS][L_WSP], /* i : 12.8kHz weighted speech (for LTP */ float pitch_buf[CPE_CHANNELS][NB_SUBFR16k] /* o : floating pitch for each subframe */ diff --git a/lib_com/options.h b/lib_com/options.h index 4d935aa8af..18e8b3a585 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -133,6 +133,7 @@ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ #define IND_LIST_DYN /* VA: Issue 18: Dynamic allocation of ind_list[] and ind_list_metadata[] based on # of transport channels */ +//#define DEBUG_IND_LIST #define LSF_RE_USE_SECONDARY_CHANNEL /* TD stereo Secondary channel LSF Q improvement */ #ifdef LSF_RE_USE_SECONDARY_CHANNEL diff --git a/lib_com/options.h.unchanged b/lib_com/options.h.unchanged new file mode 100644 index 0000000000..2e5949f967 --- /dev/null +++ b/lib_com/options.h.unchanged @@ -0,0 +1,170 @@ +/****************************************************************************************************** + + (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ + +/*==================================================================================== + EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 + ====================================================================================*/ + +#ifndef OPTIONS_H +#define OPTIONS_H + +/* clang-format off */ +/* ################### Start compiler switches ######################## */ + +#define SUPPORT_JBM_TRACEFILE /* support for JBM tracefile, which is needed for 3GPP objective/subjective testing, but not relevant for real-world implementations */ + +/* #################### End compiler switches ######################### */ + + +/* ################### Start DEBUGGING switches ########################### */ + +#ifndef RELEASE +#define DEBUGGING /* Activate debugging part of the code */ +#endif +/*#define WMOPS*/ /* Activate complexity and memory counters */ +/*#define WMOPS_PER_FRAME*/ /* Output per-frame complexity (writes one float value per frame to the file "wmops_analysis") */ +/*#define WMOPS_DETAIL*/ /* Output detailed complexity printout for every function. Increases runtime overhead */ +/*#define WMOPS_WC_FRAME_ANALYSIS*/ /* Output detailed complexity analysis for the worst-case frame */ +/*#define MEM_COUNT_DETAILS*/ /* Output detailed memory analysis for the worst-case frame (writes to the file "mem_analysis.csv") */ + +#ifdef DEBUGGING + +/*#define DEBUG_MODE_INFO*/ /* output most important parameters to the subdirectory "res/" */ +#ifdef DEBUG_MODE_INFO +/*#define DEBUG_MODE_ACELP*/ /* output most important ACELP core parameters to the subdirectory "res/" */ +/*#define DEBUG_MODE_TCX*/ /* output most important TCX core parameters to the subdirectory "res/" */ +/*#define DEBUG_MODE_DFT*/ /* output most important DFT stereo parameters to the subdirectory "res/" */ +/*#define DEBUG_MODE_TD*/ /* output most important TD stereo parameters to the subdirectory "res/ */ +/*#define DEBUG_MODE_DIRAC*/ /* output most important DIRAC parameters to the subdirectory "res/" */ +/*#define DEBUG_MODE_MDCT*/ /* output most important MDCT parameters to the subdirectory "res/" */ +/*#define DEBUG_MODE_PARAM_MC */ /* output Parametric MC paramters to the subdirectory "res/" */ +/*#define DEBUG_MODE_PARAM_ISM*/ /* output Parametric ISM paramters to the subdirectory "res/" */ +/*#define DEBUG_MODE_INFO_TWEAK*/ /* enable command line switch to specify subdirectory for debug info output inside "./res/" */ +/*#define DEBUG_MODE_INFO_PLC */ /* define to output PLC related parameters */ +/*#define DEBUG_MODE_INFO_ALLRAD*/ /* define to output generated HOA decoding mtx */ +/*#define DEBUG_MODE_LFE */ /* define to output LFE relevant parameters */ +#endif + +#ifdef DEBUG_MODE_MDCT +#define DEBUG_PLOT_BITS +#endif + +#define ENABLE_BITRATE_VERIFICATION /* Enable bitrate verification - use when playing with bit budget */ +/*#define DEBUG_PLOT*/ +/*#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: -stere 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*/ +/*#define DEBUG_STEREO_DFT_OUTRESPRED*/ /* output residual prediction signal instead of L/R*/ +/*#define DBG_STEREO_ICBWE2_TBE2K8*/ /* Enables TBE_2K8 for higher bitrates with ICBWE in operation for TD/DFT Stereo. Needs quality eval and currently only used for debugging purposes */ + +/*DirAC Debug switches*/ +/*#define DEBUG_DISABLE_DIRAC_DELAY_COMP */ /* temporarily disable delay compensation on DirAC encoder */ +/*#define DEBUG_BS_READ_WRITE*/ +/*#define DEBUG_MODE_DIRAC_NOCORE*/ +/*#define DEBUG_MODE_QMETADATA*/ /* output q_metadata parameters */ + +/*MCT Debug switches*/ +/*#define DEBUG_FORCE_MCT_CP*/ /* force MCT Stereo pairs for verification with SPAR */ +#ifdef DEBUG_FORCE_MCT_CP +/*#define DEBUG_SINGLE_CODE_OMNI*/ /* force 3 TC SBA always code W channel seperately */ +#endif + +/*PLC Debug switches*/ +/*#define DEBUG_NO_TONAL_PLC*/ +/*#define DEBUG_NO_TD_TCX_PLC */ +/*#define DEBUG_FORCE_TD_TCX_CONCEALMENT*/ +/*#define DEBUG_PLC_INFO*/ + +/*#define DEBUG_EFAP_POLY_TOFILE*/ /* Write poly_select values to file in EFAP, used for generating ROM LUTs */ +/*#define TDREND_HRTF_TABLE_METHODS*/ /* Enable HRTF lookup from tables, for testing & evaluation. Supply file in table format to use. Note that a suitable HR filter lookup method should be written if the filters sample point grids are not in the formats. */ +/*#define TDREND_STANDALONE*/ /* Used when renderer is built in standalone form, without IVAS encoding/decoding (see scripts/object_renderer_standalone). This is just here to ensure this is cleaned out by prepare_instrumentation.sh */ + +/*#define DEBUG_SBA*/ /* debug DIRAC/SPAR in-out */ +#ifdef DEBUG_SBA +/*#define DEBUG_SBA_AUDIO_DUMP*/ /* SBA intermediate audio wav file dumping */ +/*#define DEBUG_SBA_MD_DUMP*/ /* SBA metadata and variable file dumping */ +/*#define DEBUG_SPAR_MD_TARGET_TUNING*/ /* SPAR MD target bitrate tuning debug code */ +/*#define DEBUG_SPAR_BYPASS_EVS_CODEC*/ /* bypass EVS coding in float precision, emulating EVS encoder/decoder delay */ +/*#define DEBUG_SPAR_WRITE_OUT_COV*/ /* write covariance per frame into a text file for verification */ +/*#define DEBUG_SPAR_DIRAC_WRITE_OUT_PRED_PARS*/ +/*#define DEBUG_AGC*/ /* debug SPAR AGC in-out */ +#endif +/*#define SPAR_HOA_DBG*/ /* SPAR HOA debug statements */ +/*#define DEBUG_BINAURAL_FILTER_DESIGN*/ /* debugging of Crend binaural filter design */ +#define DEBUG_AGC_ENCODER_CMD_OPTION /* Ability to force enable or disable AGC behaviour in DIRAC/SPAR via command line option */ + +#endif +/* #################### End DEBUGGING switches ############################ */ + +/* ################# Start DEVELOPMENT switches ######################## */ + +#define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ +//#define IND_LIST_DYN /* VA: Issue 18: Dynamic allocation of ind_list[] and ind_list_metadata[] based on # of transport channels */ +//#define DEBUG_VLAD + +#define LSF_RE_USE_SECONDARY_CHANNEL /* TD stereo Secondary channel LSF Q improvement */ +#ifdef LSF_RE_USE_SECONDARY_CHANNEL +/*#define LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE */ /* switch to isolate the reuse mode case */ +#endif +#define DISABLE_ADAP_RES_COD_TMP /* temporary fix for IVAS-403, disables adaptive residual coding */ +/*#define ITD_WINNER_GAIN_MODIFY */ /* ITD optimization - WORK IN PROGRESS */ +/*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ +#define FIX_I109_ORIENTATION_TRACKING /* Issue 109: Harmonize head and orientation tracking */ +/*#define SBA_HPF_TUNING_DEC*/ + +#define BINAURALIZATION_DELAY_REPORT /* VA: Issue 255 - Changes the way the decoder delay is reported */ +#define TUNE_360_OBJECT_WITH_NOISE /* VA: issue 360: consider objects being speech+noise for active speech coding */ +#define FIX_350_MASA_DELAY_COMP /* Nokia: Issue 350: MASA audio/meta delay compensation */ +#define FIX_372_LIB_REND_VALIDATE_IO /* FhG: Issue 372: IVAS_rend segfaults with unsupported I/O configs - add validation checks of I/O config */ +#define FIX_376_SBA_ROTATE /*DLB: Fix for issue 376*/ +#define TD5 /* Eri: Contribution 17: Extended metadata for 6 DoF rendering in TD renderer */ +#define TD5_FIX_INVALID_MEMORY_ACCESS /* FhG: Resolves segfault in case IVAS_REND_InitConfig gets initialized with rendererConfigEnabled:=false && ISM are being rendered */ +#define FIX_371_DELAY_REPORT /* Issue 371: div. by zero with -no_delay_cmp */ +#define FIX_373_MASA_DELAY_COMP_MSAN /* Nokia: Issue 373: MASA audio/meta delay compensation. MSAN bugfix */ + +#ifdef FIX_I109_ORIENTATION_TRACKING +#define OTR_REFERENCE_VECTOR_TRACKING /* FhG: enables the reference position orientation tracking mode */ +#endif + +#define FIX_380_BFI_PARAMISM /* VA: issue 380 - fix metadata recovery in ParamISM BFI */ +#define FIX_MDCT_BASED_BWD /* FhG: fixes for BWD for issues with reaction to transients for MDCT-stereo and MCT */ +#define DISCRETE_ISM_DTX_CNG /* FhG/VA: contribution 15 - DTX/CNG for (discrete) ISM */ +#define NCHAN_ISM_PARAMETER /* VA: make 'nchan_ism' parameter part of st_ivas/hEncoderConfig */ + + +/* ################## End DEVELOPMENT switches ######################### */ +/* clang-format on */ +#endif diff --git a/lib_com/prot.h b/lib_com/prot.h index 8430df6a7c..8ad9378e4c 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -516,14 +516,23 @@ void push_next_bits( ); #ifdef IND_LIST_DYN -int16_t get_max_num_indices( /* o : maximum number of indices */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ +int16_t get_ivas_max_num_indices( /* o : maximum number of indices */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ +); + +int16_t get_core_max_num_indices( /* o : maximum number of indices */ + const int16_t core, /* i : core */ const int32_t total_brate /* i : total bitrate */ ); -int16_t get_max_num_indices_metadata( /* o : maximum number of indices */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t ivas_total_brate /* i : IVAS total bitrate */ +int16_t get_BWE_max_num_indices( /* o : maximum number of indices */ + const int32_t extl_brate /* i : extensiona layer bitrate */ +); + +int16_t get_ivas_max_num_indices_metadata( /* o : maximum number of indices for metadata */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ ); ivas_error ind_list_realloc( @@ -531,6 +540,16 @@ ivas_error ind_list_realloc( int16_t max_num_indices /* i : new maximum number of allowed indices in the list */ ); +ivas_error check_ind_list_limits( + BSTR_ENC_HANDLE hBstr /* i/o: encoder bitstream handle */ +); + +ivas_error move_indices( + INDICE_HANDLE old_ind_list, /* i/o: old location of indices */ + INDICE_HANDLE new_ind_list, /* i/o: new location of indices */ + const int16_t nb_indices /* i : number of moved indices */ +); + int16_t find_indice( /* o : index of the indice in the list, -1 if not found */ BSTR_ENC_HANDLE hBstr, /* i : encoder bitstream handle */ int16_t id, /* i : ID of the indice */ @@ -2258,7 +2277,7 @@ void read_next_force( ivas_error init_encoder( Encoder_State *st, /* i/o: state structure */ #ifdef IND_LIST_DYN - ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : encoder configuration handle */ + Encoder_Struct *st_ivas, /* i/o: encoder state structure */ #endif const int16_t idchan, /* i : channel ID */ const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ diff --git a/lib_enc/dtx.c b/lib_enc/dtx.c index 652c28f139..5afa2a4251 100644 --- a/lib_enc/dtx.c +++ b/lib_enc/dtx.c @@ -261,7 +261,7 @@ void dtx( { reset_indices_enc( st->hBstr, #ifdef IND_LIST_DYN - st->hBstr->max_num_indices + st->hBstr->nb_ind_tot #else MAX_NUM_INDICES #endif diff --git a/lib_enc/enc_ppp.c b/lib_enc/enc_ppp.c index 1bfed647dc..328c1d5b52 100644 --- a/lib_enc/enc_ppp.c +++ b/lib_enc/enc_ppp.c @@ -171,7 +171,7 @@ ivas_error encod_ppp( /* delete previous indices */ reset_indices_enc( hBstr, #ifdef IND_LIST_DYN - hBstr->max_num_indices + hBstr->nb_ind_tot #else MAX_NUM_INDICES #endif diff --git a/lib_enc/evs_enc.c b/lib_enc/evs_enc.c index b90f10359b..048986b9f9 100644 --- a/lib_enc/evs_enc.c +++ b/lib_enc/evs_enc.c @@ -99,7 +99,9 @@ ivas_error evs_enc( int16_t pitch_orig[3]; /* original open-loop pitch values that might be altered in core_acelp_tcx20_switching() within MODE2 */ #endif ivas_error error; - +#ifdef DEBUG_IND_LIST + int16_t old_nb_ind; +#endif error = IVAS_ERR_OK; push_wmops( "evs_enc" ); @@ -381,6 +383,10 @@ ivas_error evs_enc( *---------------------------------------------------------------------*/ push_wmops( "BWE_encoding" ); +#ifdef DEBUG_IND_LIST + old_nb_ind = st->hBstr->nb_ind_tot; +#endif + if ( st->input_Fs >= 16000 && st->bwidth < SWB ) { /* Common pre-processing for WB TBE and WB BWE */ @@ -502,6 +508,13 @@ ivas_error evs_enc( st->codec_mode = MODE2; } +#ifdef DEBUG_IND_LIST + if ( st->hBstr->nb_ind_tot - old_nb_ind > 0 ) + { + fprintf( stdout, "Total number of allocated indices (BWE): %d, bitrate: %d, #indices: %d\n", st->extl, st->extl_brate, st->hBstr->nb_ind_tot - old_nb_ind ); + } +#endif + #ifdef DEBUG_MODE_INFO dbgwrite( &st->codec_mode, sizeof( int16_t ), 1, input_frame, "res/codec" ); dbgwrite( &st->core, sizeof( int16_t ), 1, input_frame, "res/core" ); diff --git a/lib_enc/fd_cng_enc.c b/lib_enc/fd_cng_enc.c index 2f38de3955..29f4c900bc 100644 --- a/lib_enc/fd_cng_enc.c +++ b/lib_enc/fd_cng_enc.c @@ -897,7 +897,7 @@ void stereoFdCngCoherence( /* case: no VAD for both channels -> INACTIVE FRAME */ reset_indices_enc( sts[0]->hBstr, #ifdef IND_LIST_DYN - sts[0]->hBstr->max_num_indices + sts[0]->hBstr->nb_ind_tot #else MAX_NUM_INDICES #endif @@ -905,7 +905,7 @@ void stereoFdCngCoherence( reset_indices_enc( sts[1]->hBstr, #ifdef IND_LIST_DYN - sts[1]->hBstr->max_num_indices + sts[1]->hBstr->nb_ind_tot #else MAX_NUM_INDICES #endif @@ -1117,12 +1117,14 @@ void FdCngEncodeMDCTStereoSID( /* ---- Write SID bitstream ---- */ +#ifndef IND_LIST_DYN /* side info */ push_indice( sts[0]->hBstr, IND_SID_TYPE, 1, 1 ); push_indice( sts[0]->hBstr, IND_BWIDTH, sts[0]->bwidth, 2 ); push_indice( sts[0]->hBstr, IND_ACELP_16KHZ, sts[0]->L_frame == L_FRAME16k ? 1 : 0, 1 ); push_indice( sts[1]->hBstr, IND_SID_TYPE, coh_idx, 4 ); push_indice( sts[1]->hBstr, IND_SID_TYPE, no_side_flag, 1 ); +#endif /* noise shapes and channel gains */ for ( ch = 0; ch < CPE_CHANNELS; ch++ ) @@ -1130,10 +1132,23 @@ void FdCngEncodeMDCTStereoSID( if ( ch ) { stages = FD_CNG_JOINT_stages_25bits; +#ifdef IND_LIST_DYN + sts[ch]->hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot; + + /* side info */ + push_indice( sts[ch]->hBstr, IND_SID_TYPE, coh_idx, 4 ); + push_indice( sts[ch]->hBstr, IND_SID_TYPE, no_side_flag, 1 ); +#endif } else { stages = FD_CNG_stages_37bits; +#ifdef IND_LIST_DYN + /* side info */ + push_indice( sts[ch]->hBstr, IND_SID_TYPE, 1, 1 ); + push_indice( sts[ch]->hBstr, IND_BWIDTH, sts[0]->bwidth, 2 ); + push_indice( sts[ch]->hBstr, IND_ACELP_16KHZ, sts[0]->L_frame == L_FRAME16k ? 1 : 0, 1 ); +#endif } for ( int16_t i = 0; i < stages; i++ ) diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index 9c11420560..fcb605fc10 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -54,9 +54,9 @@ *-----------------------------------------------------------------------*/ ivas_error init_encoder( - Encoder_State *st, /* i/o: state structure */ + Encoder_State *st, /* i/o: state structure */ #ifdef IND_LIST_DYN - ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : encoder configuration handle */ + Encoder_Struct *st_ivas, /* i/o: encoder state structure */ #endif const int16_t idchan, /* i : channel ID */ const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ @@ -117,16 +117,12 @@ ivas_error init_encoder( } #ifdef IND_LIST_DYN - /* set the maximum allowed number of indices in the list */ - st->hBstr->max_num_indices = get_max_num_indices( hEncoderConfig->ivas_format, st->total_brate ); - - /* allocate buffer of indices */ - if ( ( st->hBstr->ind_list = (INDICE_HANDLE) malloc( st->hBstr->max_num_indices * sizeof( Indice ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); - } - - reset_indices_enc( st->hBstr, st->hBstr->max_num_indices ); + /* set pointer to the buffer of indices */ + st->hBstr->ind_list = st_ivas->ind_list; + st->hBstr->ivas_ind_list_zero = st_ivas->ind_list; + st->hBstr->ivas_max_num_indices = &st_ivas->ivas_max_num_indices; + st->hBstr->nb_ind_tot = 0; + st->hBstr->nb_bits_tot = 0; #endif } else diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 040a8469c5..435fc0fa6c 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -104,7 +104,10 @@ ivas_error ivas_core_enc( int32_t element_brate, last_element_brate, input_Fs; ivas_error error; #ifdef IND_LIST_DYN - int16_t max_num_indices; + int16_t max_num_indices_BWE; +#ifdef DEBUG_IND_LIST + int16_t old_nb_ind; +#endif #endif push_wmops( "ivas_core_enc" ); @@ -199,18 +202,19 @@ ivas_error ivas_core_enc( st = sts[n]; #ifdef IND_LIST_DYN - /*---------------------------------------------------------------------* - * Re-allocate the list of indices, if needed - *---------------------------------------------------------------------*/ + /* update pointer to the buffer of indices of the second channel */ + if ( n == 1 && st->element_mode == IVAS_CPE_TD ) + { + /* adjust the pointer to the buffer of indices of the secondary channel (make space for BWE indices) */ + max_num_indices_BWE = get_BWE_max_num_indices( sts[0]->extl_brate ); + st->hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot + max_num_indices_BWE; - /* get the maximum allowed number of indices in the list */ - max_num_indices = get_max_num_indices( ivas_format, st->total_brate ); + /* write TD stereo spatial parameters */ + move_indices( hStereoTD->tdm_hBstr_tmp.ind_list, st->hBstr->ind_list, hStereoTD->tdm_hBstr_tmp.nb_ind_tot ); + st->hBstr->nb_ind_tot += hStereoTD->tdm_hBstr_tmp.nb_ind_tot; + st->hBstr->nb_bits_tot += hStereoTD->tdm_hBstr_tmp.nb_bits_tot; - /* check, if the maximum number of allowed indices has changed */ - if ( max_num_indices != st->hBstr->max_num_indices ) - { - /* re-allocate the list of indices */ - ind_list_realloc( st->hBstr, max_num_indices ); + reset_indices_enc( &hStereoTD->tdm_hBstr_tmp, MAX_IND_TDM_TMP ); } #endif @@ -282,11 +286,7 @@ ivas_error ivas_core_enc( } else { - stereo_mdct_core_enc( hCPE, -#ifdef IND_LIST_DYN - ivas_format, -#endif - old_inp_16k, old_wsp, pitch_buf ); + stereo_mdct_core_enc( hCPE, old_inp_16k, old_wsp, pitch_buf ); } } else if ( sts[0]->core_brate == SID_2k40 && sts[1]->core_brate == SID_2k40 ) @@ -321,6 +321,10 @@ ivas_error ivas_core_enc( { st = sts[n]; +#ifdef DEBUG_IND_LIST + old_nb_ind = st->hBstr->nb_ind_tot; +#endif + /*---------------------------------------------------------------------* * Postprocessing for ACELP/HQ core switching *---------------------------------------------------------------------*/ @@ -426,8 +430,27 @@ ivas_error ivas_core_enc( { updt_enc_common( st ); } + +#ifdef DEBUG_IND_LIST + if ( sts[n]->hBstr->nb_ind_tot - old_nb_ind > 0 ) + { + fprintf( stdout, "Total number of allocated indices (BWE): %d, bitrate: %d, #indices: %d\n", sts[n]->extl, sts[n]->extl_brate, sts[n]->hBstr->nb_ind_tot - old_nb_ind ); + } +#endif } +#ifdef IND_LIST_DYN +#ifdef DEBUG_IND_LIST + for ( n = 0; n < n_CoreChannels; n++ ) + { + if ( sts[n]->hBstr->nb_ind_tot > 0 ) + { + fprintf( stdout, "Total number of allocated indices (core): %d, bitrate: %d, #indices: %d\n", sts[n]->core, sts[n]->total_brate, sts[n]->hBstr->nb_ind_tot ); + } + } +#endif +#endif + #ifdef DEBUG_MODE_INFO for ( n = 0; n < n_CoreChannels; n++ ) diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index 74c27f4bff..b639df1547 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -69,7 +69,7 @@ ivas_error ivas_corecoder_enc_reconfig( BSTR_ENC_HANDLE hMetaData; #endif #ifdef IND_LIST_DYN - int16_t i, nb_bits, max_num_indices_metadata; + int16_t i, nb_bits; Indice temp_ind_list[MAX_NUM_IND_TEMP_LIST]; #endif int16_t nb_bits_tot; @@ -77,6 +77,7 @@ ivas_error ivas_corecoder_enc_reconfig( int16_t last_ind; int16_t next_ind; #endif + ENCODER_CONFIG_HANDLE hEncoderConfig; ivas_error error; @@ -104,20 +105,6 @@ ivas_error ivas_corecoder_enc_reconfig( copy_encoder_config( st_ivas, st_ivas->hSCE[sce_id]->hCoreCoder[0], 0 ); st_ivas->hSCE[sce_id]->element_brate = brate_SCE; st_ivas->hSCE[sce_id]->hCoreCoder[0]->total_brate = st_ivas->hSCE[sce_id]->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ -#ifdef IND_LIST_DYN - if ( st_ivas->hSCE[sce_id]->hMetaData != NULL ) - { - /* get the maximum allowed number of indices in the list */ - max_num_indices_metadata = get_max_num_indices_metadata( hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); - - /* check, if the maximum number of allowed indices has changed */ - if ( max_num_indices_metadata != st_ivas->hSCE[sce_id]->hMetaData->max_num_indices ) - { - /* re-allocate the list of metadata indices */ - ind_list_realloc( st_ivas->hSCE[sce_id]->hMetaData, max_num_indices_metadata ); - } - } -#endif } for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) @@ -131,20 +118,6 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ } -#ifdef IND_LIST_DYN - if ( st_ivas->hCPE[cpe_id]->hMetaData != NULL ) - { - /* get the maximum allowed number of indices in the list */ - max_num_indices_metadata = get_max_num_indices_metadata( hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); - - /* check, if the maximum number of allowed indices has changed */ - if ( max_num_indices_metadata != st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices ) - { - /* re-allocate the list of metadata indices */ - ind_list_realloc( st_ivas->hCPE[cpe_id]->hMetaData, max_num_indices_metadata ); - } - } -#endif } if ( st_ivas->nCPE > 1 ) @@ -222,8 +195,12 @@ ivas_error ivas_corecoder_enc_reconfig( temp_ind_list[i].id = hBstr->ind_list[i].id; temp_ind_list[i].value = hBstr->ind_list[i].value; temp_ind_list[i].nb_bits = hBstr->ind_list[i].nb_bits; + hBstr->ind_list[i].nb_bits = -1; } + hBstr->nb_bits_tot = 0; + hBstr->nb_ind_tot = 0; + nb_bits += temp_ind_list[i].nb_bits; i++; } @@ -345,7 +322,7 @@ ivas_error ivas_corecoder_enc_reconfig( { reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, #ifdef IND_LIST_DYN - st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->max_num_indices + st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->nb_ind_tot #else MAX_NUM_INDICES #endif @@ -353,31 +330,10 @@ ivas_error ivas_corecoder_enc_reconfig( } else { - st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->nb_bits_tot = nb_bits_tot; #ifndef IND_LIST_DYN + st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->nb_bits_tot = nb_bits_tot; st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->last_ind = last_ind; st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->next_ind = next_ind; -#endif -#ifdef IND_LIST_DYN - /* re-fill the buffer of indices with already written indices */ - i = 0; - nb_bits = 0; - while ( nb_bits < nb_bits_tot && i < MAX_NUM_IND_TEMP_LIST ) - { - if ( temp_ind_list[i].nb_bits > 0 ) - { - st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].id = temp_ind_list[i].id; - st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].value = temp_ind_list[i].value; - st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; - } - - nb_bits += temp_ind_list[i].nb_bits; - i++; - } - st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->nb_ind_tot = i; -#ifdef DEBUGGING - assert( ( nb_bits == nb_bits_tot ) && "Error restoring bitstream information during core-coder reconfiguration!\n" ); -#endif #endif } @@ -409,7 +365,7 @@ ivas_error ivas_corecoder_enc_reconfig( { reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, #ifdef IND_LIST_DYN - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->max_num_indices + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_ind_tot #else MAX_NUM_INDICES #endif @@ -417,30 +373,10 @@ ivas_error ivas_corecoder_enc_reconfig( } else { - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_bits_tot = nb_bits_tot; #ifndef IND_LIST_DYN + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_bits_tot = nb_bits_tot; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->last_ind = last_ind; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->next_ind = next_ind; -#endif -#ifdef IND_LIST_DYN - i = 0; - nb_bits = 0; - while ( nb_bits < nb_bits_tot && i < MAX_NUM_IND_TEMP_LIST ) - { - if ( temp_ind_list[i].nb_bits > 0 ) - { - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].id = temp_ind_list[i].id; - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].value = temp_ind_list[i].value; - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; - } - - nb_bits += temp_ind_list[i].nb_bits; - i++; - } - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_ind_tot = i; -#ifdef DEBUGGING - assert( ( nb_bits == nb_bits_tot ) && "Error restoring bitstream information during core-coder reconfiguration!\n" ); -#endif #endif } } @@ -477,7 +413,7 @@ ivas_error ivas_corecoder_enc_reconfig( { reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, #ifdef IND_LIST_DYN - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->max_num_indices + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_ind_tot #else MAX_NUM_INDICES #endif @@ -485,30 +421,10 @@ ivas_error ivas_corecoder_enc_reconfig( } else { - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_bits_tot = nb_bits_tot; #ifndef IND_LIST_DYN + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_bits_tot = nb_bits_tot; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->last_ind = last_ind; st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->next_ind = next_ind; -#endif -#ifdef IND_LIST_DYN - i = 0; - nb_bits = 0; - while ( nb_bits < nb_bits_tot && i < MAX_NUM_IND_TEMP_LIST ) - { - if ( temp_ind_list[i].nb_bits > 0 ) - { - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].id = temp_ind_list[i].id; - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].value = temp_ind_list[i].value; - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; - } - - nb_bits += temp_ind_list[i].nb_bits; - i++; - } - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_ind_tot = i; -#ifdef DEBUGGING - assert( ( nb_bits == nb_bits_tot ) && "Error restoring bitstream information during core-coder reconfiguration!\n" ); -#endif #endif } @@ -520,6 +436,51 @@ ivas_error ivas_corecoder_enc_reconfig( } } +#ifdef IND_LIST_DYN + /* restore bitstream - IVAS format bits should be written in the first core channel of the first SCE/CPE */ + i = 0; + nb_bits = 0; + if ( st_ivas->nSCE > 0 ) + { + while ( nb_bits < nb_bits_tot && i < MAX_NUM_IND_TEMP_LIST ) + { + if ( temp_ind_list[i].nb_bits > 0 ) + { + st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->ind_list[i].id = temp_ind_list[i].id; + st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->ind_list[i].value = temp_ind_list[i].value; + st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; + } + + nb_bits += temp_ind_list[i].nb_bits; + i++; + } + st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->nb_ind_tot = i; + st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->nb_bits_tot = nb_bits_tot; + } + else if ( st_ivas->nCPE > 0 ) + { + while ( nb_bits < nb_bits_tot && i < MAX_NUM_IND_TEMP_LIST ) + { + if ( temp_ind_list[i].nb_bits > 0 ) + { + st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->ind_list[i].id = temp_ind_list[i].id; + st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->ind_list[i].value = temp_ind_list[i].value; + st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; + } + + nb_bits += temp_ind_list[i].nb_bits; + i++; + } + st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->nb_ind_tot = i; + st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->nb_bits_tot = nb_bits_tot; + } + +#ifdef DEBUGGING + assert( ( nb_bits == nb_bits_tot ) && "Error restoring bitstream information during core-coder reconfiguration!\n" ); +#endif +#endif + + if ( last_mc_mode == MC_MODE_MCMASA && st_ivas->mc_mode == MC_MODE_MCMASA ) { /* restore modified transport signal */ @@ -544,7 +505,7 @@ ivas_error ivas_corecoder_enc_reconfig( for ( n = 0; n < CPE_CHANNELS; n++ ) { st_ivas->hCPE[0]->hCoreCoder[n]->total_brate = st_ivas->hCPE[0]->element_brate; - st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal = (int16_t) ( st_ivas->hCPE[0]->element_brate / FRAMES_PER_SEC ); + st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal = ( int16_t )( st_ivas->hCPE[0]->element_brate / FRAMES_PER_SEC ); st_ivas->hCPE[0]->hCoreCoder[n]->igf = getIgfPresent( st_ivas->hCPE[0]->hCoreCoder[n]->element_mode, st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal * FRAMES_PER_SEC, st_ivas->hCPE[0]->hCoreCoder[n]->bwidth, @@ -586,19 +547,17 @@ ivas_error ivas_corecoder_enc_reconfig( } #ifdef IND_LIST_DYN - /* set the maximum allowed number of metadata indices in the list */ - st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->max_num_indices = get_max_num_indices_metadata( hEncoderConfig->ivas_total_brate, hEncoderConfig->ivas_format ); - - /* allocate buffer of metadata indices */ - if ( ( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ind_list = (INDICE_HANDLE) malloc( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->max_num_indices * sizeof( Indice ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); - } + /* set pointer to the buffer of metadata indices */ + st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ind_list = st_ivas->ind_list_metadata; + st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ivas_ind_list_zero = st_ivas->ind_list_metadata; + st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ivas_max_num_indices = &st_ivas->ivas_max_num_indices_metadata; + st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->nb_ind_tot = 0; + st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->nb_bits_tot = 0; #endif } #ifdef IND_LIST_DYN - reset_indices_enc( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData, st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->max_num_indices ); + reset_indices_enc( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData, st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->nb_ind_tot ); #else st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ind_list = ind_list_metadata + st_ivas->nSCE * MAX_NUM_INDICES; reset_indices_enc( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData, MAX_BITS_METADATA ); @@ -608,12 +567,6 @@ ivas_error ivas_corecoder_enc_reconfig( { if ( st_ivas->hCPE[cpe_id]->hMetaData != NULL ) { -#ifdef IND_LIST_DYN - if ( st_ivas->hCPE[cpe_id]->hMetaData->ind_list != NULL ) - { - free( st_ivas->hCPE[cpe_id]->hMetaData->ind_list ); - } -#endif free( st_ivas->hCPE[cpe_id]->hMetaData ); st_ivas->hCPE[cpe_id]->hMetaData = NULL; } @@ -632,7 +585,7 @@ ivas_error ivas_corecoder_enc_reconfig( for ( n = 0; n < CPE_CHANNELS; n++ ) { st_ivas->hCPE[0]->hCoreCoder[n]->total_brate = st_ivas->hCPE[0]->element_brate; - st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal = (int16_t) ( st_ivas->hCPE[0]->element_brate / FRAMES_PER_SEC ); + st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal = ( int16_t )( st_ivas->hCPE[0]->element_brate / FRAMES_PER_SEC ); st_ivas->hCPE[0]->hCoreCoder[n]->igf = getIgfPresent( st_ivas->hCPE[0]->hCoreCoder[n]->element_mode, st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal * FRAMES_PER_SEC, st_ivas->hCPE[0]->hCoreCoder[n]->bwidth, diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 5a39b1935e..35bbd62cca 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -813,16 +813,11 @@ ivas_error create_cpe_enc( } #ifdef IND_LIST_DYN - /* set the maximum allowed number of indices in the list */ - hCPE->hMetaData->max_num_indices = get_max_num_indices_metadata( hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); - - /* allocate buffer of metadata indices */ - if ( ( hCPE->hMetaData->ind_list = (INDICE_HANDLE) malloc( hCPE->hMetaData->max_num_indices * sizeof( Indice ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); - } - - reset_indices_enc( hCPE->hMetaData, hCPE->hMetaData->max_num_indices ); + /* set pointer to the buffer of metadata indices */ + hCPE->hMetaData->ind_list = st_ivas->ind_list_metadata; + hCPE->hMetaData->ivas_ind_list_zero = st_ivas->ind_list_metadata; + hCPE->hMetaData->ivas_max_num_indices = &st_ivas->ivas_max_num_indices_metadata; + reset_indices_enc( hCPE->hMetaData, st_ivas->ivas_max_num_indices_metadata ); #endif } @@ -848,7 +843,7 @@ ivas_error create_cpe_enc( if ( ( error = init_encoder( st, #ifdef IND_LIST_DYN - hEncoderConfig, + st_ivas, #endif n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) { @@ -1022,12 +1017,6 @@ void destroy_cpe_enc( if ( hCPE->hMetaData != NULL ) { -#ifdef IND_LIST_DYN - if ( hCPE->hMetaData->ind_list != NULL ) - { - free( hCPE->hMetaData->ind_list ); - } -#endif free( hCPE->hMetaData ); hCPE->hMetaData = NULL; } diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 1e4ba82207..7edf1e0b14 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -291,6 +291,7 @@ ivas_error ivas_enc( if ( st_ivas->mc_mode == MC_MODE_MCT ) { st_ivas->hLFE->hBstr = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0]->hBstr : st_ivas->hCPE[0]->hCoreCoder[0]->hBstr; + ivas_lfe_enc( st_ivas->hLFE, data_f[LFE_CHANNEL], input_frame, st_ivas->hLFE->hBstr ); } @@ -342,6 +343,10 @@ ivas_error ivas_enc( return error; } +#ifdef IND_LIST_DYN + st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->ind_list = st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->ind_list + st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->nb_ind_tot; +#endif + if ( ( error = ivas_cpe_enc( st_ivas, 0, data_f[0], data_f[1], input_frame, hMetaData->nb_bits_tot ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index e0713950ca..f370665381 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -351,6 +351,43 @@ ivas_error ivas_init_encoder( st_ivas->sba_mode = SBA_MODE_NONE; st_ivas->nchan_transport = -1; + +#ifdef IND_LIST_DYN + /*-----------------------------------------------------------------* + * Allocate and initialize buffer of indices + *-----------------------------------------------------------------*/ + + /* set the maximum allowed number of indices in the list */ + st_ivas->ivas_max_num_indices = get_ivas_max_num_indices( ivas_format, ivas_total_brate ); + + /* allocate buffer of indices */ + if ( ( st_ivas->ind_list = (INDICE_HANDLE) malloc( st_ivas->ivas_max_num_indices * sizeof( Indice ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); + } + + /* reset the list of indices */ + for ( i = 0; i < st_ivas->ivas_max_num_indices; i++ ) + { + st_ivas->ind_list[i].nb_bits = -1; + } + + /* set the maximum allowed number of metadata indices in the list */ + st_ivas->ivas_max_num_indices_metadata = get_ivas_max_num_indices_metadata( st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); + + /* allocate buffer of indices */ + if ( ( st_ivas->ind_list_metadata = (INDICE_HANDLE) malloc( st_ivas->ivas_max_num_indices_metadata * sizeof( Indice ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of metadata indices!\n" ) ); + } + + /* reset the list of metadata indices */ + for ( i = 0; i < st_ivas->ivas_max_num_indices_metadata; i++ ) + { + st_ivas->ind_list[i].nb_bits = -1; + } +#endif + /*-----------------------------------------------------------------* * Allocate and initialize SCE/CPE and other handles *-----------------------------------------------------------------*/ @@ -400,9 +437,7 @@ ivas_error ivas_init_encoder( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); } -#endif -#ifndef IND_LIST_DYN /* MetaData for DFT stereo */ st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[0]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); @@ -426,13 +461,11 @@ ivas_error ivas_init_encoder( return error; } - /* MetaData for ISMs */ #ifndef IND_LIST_DYN + /* MetaData for ISMs */ st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); -#endif -#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); #endif @@ -500,13 +533,11 @@ ivas_error ivas_init_encoder( return error; } - /* MetaData for SBA */ #ifndef IND_LIST_DYN + /* MetaData for SBA */ st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); -#endif -#ifndef IND_LIST_DYN st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); #endif @@ -582,9 +613,7 @@ ivas_error ivas_init_encoder( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); } -#endif -#ifndef IND_LIST_DYN /* Metadata only initialized for the last CPE index*/ if ( cpe_id == st_ivas->nCPE - 1 ) { @@ -627,9 +656,7 @@ ivas_error ivas_init_encoder( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); } -#endif -#ifndef IND_LIST_DYN /* Metadata only initialized for the last CPE index*/ if ( cpe_id == st_ivas->nCPE - 1 ) { @@ -681,8 +708,7 @@ ivas_error ivas_init_encoder( /* allocate buffer of indices */ st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); -#endif -#ifndef IND_LIST_DYN + st_ivas->hSCE[sce_id]->hMetaData->ind_list = ind_list_metadata[sce_id]; reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); #endif @@ -704,9 +730,7 @@ ivas_error ivas_init_encoder( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n + st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); } -#endif -#ifndef IND_LIST_DYN /* Metadata only initialized for the last CPE index*/ if ( cpe_id == st_ivas->nCPE - 1 ) { @@ -715,6 +739,7 @@ ivas_error ivas_init_encoder( } #endif } + } } #ifdef DEBUGGING @@ -767,6 +792,10 @@ void destroy_core_enc( ENC_CORE_HANDLE hCoreCoder /* i/o: core encoder structure */ ) { +#ifdef IND_LIST_DYN + int16_t i; +#endif + destroy_cldfb_encoder( hCoreCoder ); if ( hCoreCoder->hSignalBuf != NULL ) @@ -778,13 +807,12 @@ void destroy_core_enc( if ( hCoreCoder->hBstr != NULL ) { #ifdef IND_LIST_DYN - /* deallocate buffer of indices */ - if ( hCoreCoder->hBstr->ind_list != NULL ) + /* reset buffer of indices */ + for ( i = 0; i < hCoreCoder->hBstr->nb_ind_tot; i++) { - free( hCoreCoder->hBstr->ind_list ); + hCoreCoder->hBstr->ind_list[i].nb_bits = -1; } #endif - free( hCoreCoder->hBstr ); hCoreCoder->hBstr = NULL; } @@ -1020,6 +1048,19 @@ void ivas_destroy_enc( st_ivas->hEncoderConfig = NULL; } +#ifdef IND_LIST_DYN + /* Buffer of indices */ + if ( st_ivas->ind_list != NULL ) + { + free( st_ivas->ind_list ); + } + + if ( st_ivas->ind_list_metadata != NULL ) + { + free( st_ivas->ind_list_metadata ); + } +#endif + /* main IVAS handle */ free( st_ivas ); diff --git a/lib_enc/ivas_ism_dtx_enc.c b/lib_enc/ivas_ism_dtx_enc.c index 9f3ae679c6..cae975b9e8 100644 --- a/lib_enc/ivas_ism_dtx_enc.c +++ b/lib_enc/ivas_ism_dtx_enc.c @@ -177,7 +177,7 @@ int16_t ivas_ism_dtx_enc( reset_indices_enc( hSCE[0]->hCoreCoder[0]->hBstr, #ifdef IND_LIST_DYN - hSCE[0]->hCoreCoder[0]->hBstr->max_num_indices + hSCE[0]->hCoreCoder[0]->hBstr->nb_ind_tot #else MAX_NUM_INDICES #endif @@ -394,7 +394,7 @@ int16_t ivas_ism_dtx_enc( st_ivas->hSCE[0]->hCoreCoder[0]->core_brate = st_ivas->hSCE[0]->hCoreCoder[0]->last_core_brate; reset_indices_enc( st_ivas->hSCE[0]->hCoreCoder[0]->hBstr, #ifdef IND_LIST_DYN - st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->max_num_indices + st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->nb_ind_tot #else MAX_NUM_INDICES #endif diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 25ce78ff2e..919f5285df 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -95,6 +95,9 @@ ivas_error ivas_ism_enc( int16_t dtx_flag, sid_flag, flag_noisy_speech; #endif int16_t i, nBits; +#endif +#ifdef IND_LIST_DYN + Encoder_State *prev_st = NULL; #endif ivas_error error; @@ -343,6 +346,14 @@ ivas_error ivas_ism_enc( hSCE = st_ivas->hSCE[sce_id]; st = hSCE->hCoreCoder[0]; +#ifdef IND_LIST_DYN + /* update pointer to the buffer of indices of the next channel */ + if ( sce_id > 0 ) + { + st->hBstr->ind_list = prev_st->hBstr->ind_list + prev_st->hBstr->nb_ind_tot; + } +#endif + if ( st->low_rate_mode ) { st->bwidth = WB; @@ -390,6 +401,10 @@ ivas_error ivas_ism_enc( /* Store previous attack detection flag */ st->hTranDet->transientDetector.prev_bIsAttackPresent = st->hTranDet->transientDetector.bIsAttackPresent; + +#ifdef IND_LIST_DYN + prev_st = st; +#endif } if ( dtx_flag ) diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index ddac05ff00..893cf25ba3 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -878,7 +878,7 @@ ivas_error ivas_ism_metadata_enc( if ( hSCE[0]->hCoreCoder[0]->core_brate > SID_2k40 ) { #ifdef IND_LIST_DYN - reset_indices_enc( hSCE[ch]->hMetaData, hSCE[ch]->hMetaData->max_num_indices ); + reset_indices_enc( hSCE[ch]->hMetaData, hSCE[ch]->hMetaData->nb_ind_tot ); #else reset_indices_enc( hSCE[ch]->hMetaData, MAX_BITS_METADATA ); #endif diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index b5e100145d..337753925c 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -1708,9 +1708,6 @@ void ivas_masa_enc_reconfigure( int16_t n, tmp; int16_t sce_id, cpe_id; int32_t ivas_total_brate; -#ifdef IND_LIST_DYN - int16_t max_num_indices_metadata; -#endif ivas_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; @@ -1721,21 +1718,6 @@ void ivas_masa_enc_reconfigure( copy_encoder_config( st_ivas, st_ivas->hSCE[sce_id]->hCoreCoder[0], 0 ); st_ivas->hSCE[sce_id]->element_brate = ivas_total_brate / st_ivas->nchan_transport; st_ivas->hSCE[sce_id]->hCoreCoder[0]->total_brate = st_ivas->hSCE[sce_id]->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ - -#ifdef IND_LIST_DYN - if ( st_ivas->hSCE[sce_id]->hMetaData != NULL ) - { - /* get the maximum allowed number of indices in the list */ - max_num_indices_metadata = get_max_num_indices_metadata( st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); - - /* check, if the maximum number of allowed indices has changed */ - if ( max_num_indices_metadata != st_ivas->hSCE[sce_id]->hMetaData->max_num_indices ) - { - /* re-allocate the list of metadata indices */ - ind_list_realloc( st_ivas->hSCE[sce_id]->hMetaData, max_num_indices_metadata ); - } - } -#endif } for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) @@ -1747,21 +1729,6 @@ void ivas_masa_enc_reconfigure( { copy_encoder_config( st_ivas, st_ivas->hCPE[cpe_id]->hCoreCoder[n], 0 ); st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ - -#ifdef IND_LIST_DYN - if ( st_ivas->hCPE[cpe_id]->hMetaData != NULL ) - { - /* get the maximum allowed number of indices in the list */ - max_num_indices_metadata = get_max_num_indices_metadata( st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); - - /* check, if the maximum number of allowed indices has changed */ - if ( max_num_indices_metadata != st_ivas->hCPE[cpe_id]->hMetaData->max_num_indices ) - { - /* re-allocate the list of metadata indices */ - ind_list_realloc( st_ivas->hCPE[cpe_id]->hMetaData, max_num_indices_metadata ); - } - } -#endif } if ( ivas_total_brate < MASA_STEREO_MIN_BITRATE ) diff --git a/lib_enc/ivas_mct_core_enc.c b/lib_enc/ivas_mct_core_enc.c index 5cbcb57daf..38f193550b 100644 --- a/lib_enc/ivas_mct_core_enc.c +++ b/lib_enc/ivas_mct_core_enc.c @@ -411,6 +411,13 @@ void ivas_mct_core_enc( for ( ch = 0; ch < nChannels; ch++ ) { st = sts[ch]; +#ifdef IND_LIST_DYN + /* update the pointer to the buffer of indices of the second channel */ + if ( ch > 0 ) + { + st->hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot; + } +#endif if ( sts[ch]->mct_chan_mode == MCT_CHAN_MODE_LFE || sts[ch]->mct_chan_mode == MCT_CHAN_MODE_IGNORE ) { continue; diff --git a/lib_enc/ivas_mct_enc.c b/lib_enc/ivas_mct_enc.c index b66a2c5733..947be5225f 100644 --- a/lib_enc/ivas_mct_enc.c +++ b/lib_enc/ivas_mct_enc.c @@ -180,6 +180,13 @@ ivas_error ivas_mct_enc( { hCPE = st_ivas->hCPE[cpe_id]; +#ifdef IND_LIST_DYN + if ( cpe_id > 0 ) + { + hCPE->hCoreCoder[0]->hBstr->ind_list = st_ivas->hCPE[cpe_id - 1]->hCoreCoder[1]->hBstr->ind_list + st_ivas->hCPE[cpe_id - 1]->hCoreCoder[1]->hBstr->nb_ind_tot; + } +#endif + ivas_mdct_quant_coder( hCPE, hMCT->LFE_off, hMCT->tnsBits[cpe_id], hMCT->tnsSize[cpe_id], hMCT->p_param[cpe_id], 1 ); /* update input samples buffer (as done in ivas_cpe_enc() for other than MCT coding) */ diff --git a/lib_enc/ivas_mct_enc_mct.c b/lib_enc/ivas_mct_enc_mct.c index ee0c529b8b..de0e081240 100644 --- a/lib_enc/ivas_mct_enc_mct.c +++ b/lib_enc/ivas_mct_enc_mct.c @@ -855,6 +855,18 @@ void mctStereoIGF_enc( p_st[0] = sts[ch1]; p_st[1] = sts[ch2]; +#ifdef IND_LIST_DYN + if (ch1 > 0) + { + sts[ch1]->hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot; + } + + if ( ch2 > 0 ) + { + sts[ch2]->hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot; + } +#endif + p_powerSpec[0] = powerSpec[ch1]; p_powerSpec[1] = powerSpec[ch2]; @@ -902,6 +914,13 @@ void mctStereoIGF_enc( continue; } +#ifdef IND_LIST_DYN + if ( ch > 0 ) + { + st->hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot; + } +#endif + nSubframes = st->hTcxEnc->tcxMode == TCX_20 ? 1 : NB_DIV; for ( n = 0; n < nSubframes; n++ ) { diff --git a/lib_enc/ivas_mdct_core_enc.c b/lib_enc/ivas_mdct_core_enc.c index ef9264d5df..32bb41a62c 100644 --- a/lib_enc/ivas_mdct_core_enc.c +++ b/lib_enc/ivas_mdct_core_enc.c @@ -1275,6 +1275,14 @@ void ivas_mdct_quant_coder( { st = sts[ch]; +#ifdef IND_LIST_DYN + /* update the pointer to the buffer of indices of the second channel */ + if ( ch > 0 ) + { + st->hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot; + } +#endif + if ( ( st->mct_chan_mode == MCT_CHAN_MODE_LFE && LFE_off ) || ( st->mct_chan_mode == MCT_CHAN_MODE_IGNORE ) ) { /*Enable appropriate upadte of tcx_curr_overlap_mode even for uncoded channel index 1*/ diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 97bc34a9cb..2c812850af 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -1019,7 +1019,7 @@ void reset_metadata_spatial( { /*Reset metadata*/ #ifdef IND_LIST_DYN - reset_indices_enc( hMetaData, hMetaData->max_num_indices ); + reset_indices_enc( hMetaData, hMetaData->nb_ind_tot ); #else for ( i = 0; i < hMetaData->next_ind; i++ ) { diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 6c75de4113..7fc461193b 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -282,6 +282,9 @@ ivas_error create_sce_enc( SCE_ENC_HANDLE hSCE; Encoder_State *st; ivas_error error; +#ifdef IND_LIST_DYN + //int16_t i; +#endif error = IVAS_ERR_OK; @@ -314,16 +317,11 @@ ivas_error create_sce_enc( } #ifdef IND_LIST_DYN - /* set the maximum allowed number of indices in the list */ - hSCE->hMetaData->max_num_indices = get_max_num_indices_metadata( st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); - - /* allocate buffer of metadata indices */ - if ( ( hSCE->hMetaData->ind_list = (INDICE_HANDLE) malloc( hSCE->hMetaData->max_num_indices * sizeof( Indice ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); - } - - reset_indices_enc( hSCE->hMetaData, hSCE->hMetaData->max_num_indices ); + /* set pointer to the buffer of metadata indices */ + hSCE->hMetaData->ind_list = st_ivas->ind_list_metadata; + hSCE->hMetaData->ivas_ind_list_zero = st_ivas->ind_list_metadata; + hSCE->hMetaData->ivas_max_num_indices = &st_ivas->ivas_max_num_indices_metadata; + reset_indices_enc( hSCE->hMetaData, st_ivas->ivas_max_num_indices_metadata ); #endif } else @@ -347,7 +345,7 @@ ivas_error create_sce_enc( if ( ( error = init_encoder( st, #ifdef IND_LIST_DYN - st_ivas->hEncoderConfig, + st_ivas, #endif 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) { @@ -384,12 +382,6 @@ void destroy_sce_enc( if ( hSCE->hMetaData != NULL ) { -#ifdef IND_LIST_DYN - if ( hSCE->hMetaData->ind_list != NULL ) - { - free( hSCE->hMetaData->ind_list ); - } -#endif free( hSCE->hMetaData ); hSCE->hMetaData = NULL; } diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index b6b79e3fa6..b52690979d 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -204,7 +204,7 @@ ivas_error ivas_spar_enc_open( if ( ( error = init_encoder( hSpar->hCoreCoderVAD, #ifdef IND_LIST_DYN - hEncoderConfig, + st_ivas, #endif 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) { diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 44fb18dbc2..b3e73871e3 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -574,6 +574,9 @@ ivas_error ivas_spar_md_enc_process( #endif BSTR_ENC_DATA hMetaData_tmp; Indice ind_list_tmp[MAX_BITS_METADATA]; // IVAS_fmToDo: size to be optimized +#ifdef IND_LIST_DYN + int16_t max_num_indices_tmp; +#endif float Wscale[IVAS_MAX_NUM_BANDS]; num_quant_strats = hMdEnc->spar_md_cfg.num_quant_strats; @@ -621,6 +624,11 @@ ivas_error ivas_spar_md_enc_process( } hMetaData_tmp.ind_list = ind_list_tmp; +#ifdef IND_LIST_DYN + max_num_indices_tmp = MAX_BITS_METADATA; + hMetaData_tmp.ivas_max_num_indices = &max_num_indices_tmp; + hMetaData_tmp.ivas_ind_list_zero = ind_list_tmp; +#endif /* Save state of metadata bitstream buffer */ bit_pos_start = hMetaData->nb_bits_tot; @@ -890,12 +898,7 @@ ivas_error ivas_spar_md_enc_process( strat = cs[i]; if ( strat != NO_STRAT ) { -#ifdef IND_LIST_DYN - hMetaData_tmp.max_num_indices = MAX_BITS_METADATA; - reset_indices_enc( &hMetaData_tmp, hMetaData_tmp.max_num_indices ); -#else reset_indices_enc( &hMetaData_tmp, MAX_BITS_METADATA ); -#endif ivas_write_spar_md_bitstream( hMdEnc, num_bands, bands_bw, &hMetaData_tmp, hEncoderConfig->ivas_total_brate, strat, qsi, planarCP ); diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index a56f6423d3..a48e4b72e8 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -331,6 +331,12 @@ typedef struct stereo_mdct_enc_data_structure typedef struct stereo_td_enc_data_structure { +#ifdef IND_LIST_DYN + BSTR_ENC_DATA tdm_hBstr_tmp; /* temporary bitstream structure holding TD stereo spatial parameters */ + Indice tdm_ind_list_tmp[MAX_IND_TDM_TMP]; /* temporary list of indices holding TD stereo spatial parameters */ + int16_t max_ind_tdm_tmp; /* maximum number of indices in the temporary list of indices holding TD stereo spatial parameters */ +#endif + int16_t tdm_lp_reuse_flag; /* Flag that indicate if it is possible to reuse the LP coefficient from the primary channel or not */ int16_t tdm_low_rate_mode; /* secondary channel low rate mode flag */ float tdm_Pri_pitch_buf[NB_SUBFR]; @@ -1064,6 +1070,13 @@ typedef struct { ENCODER_CONFIG_HANDLE hEncoderConfig; /* Encoder configuration structure */ +#ifdef IND_LIST_DYN + Indice *ind_list; /* List of indices */ + int16_t ivas_max_num_indices; /* Maximum allowed number of indices in the list */ + Indice *ind_list_metadata; /* List of indices for metadata */ + int16_t ivas_max_num_indices_metadata; /* Maximum allowed number of indices in the list of metadata */ +#endif + /* high-level encoder parameters */ int16_t nchan_transport; /* number of transport channels */ int16_t sba_analysis_order; /* Ambisonic (SBA) order used for analysis and coding */ diff --git a/lib_enc/ivas_stereo_mdct_core_enc.c b/lib_enc/ivas_stereo_mdct_core_enc.c index 047db979e2..b5f266cffa 100644 --- a/lib_enc/ivas_stereo_mdct_core_enc.c +++ b/lib_enc/ivas_stereo_mdct_core_enc.c @@ -117,9 +117,6 @@ static void sync_tcx_mode( void stereo_mdct_core_enc( CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ -#ifdef IND_LIST_DYN - const int16_t ivas_format, /* i : IVAS format */ -#endif float new_samples[CPE_CHANNELS][L_INP], /* i : new samples */ float old_wsp[CPE_CHANNELS][L_WSP], /* i : 12.8kHz weighted speech (for LTP */ float pitch_buf[CPE_CHANNELS][NB_SUBFR16k] /* o : floating pitch for each subframe */ @@ -148,9 +145,6 @@ void stereo_mdct_core_enc( int16_t p_param[CPE_CHANNELS][2]; int16_t stereo_bits; int16_t meta_bits, signal_bits; -#ifdef IND_LIST_DYN - int16_t max_num_indices; -#endif push_wmops( "stereo_mdct_core_enc" ); @@ -185,19 +179,6 @@ void stereo_mdct_core_enc( { st = sts[ch]; SetTCXModeInfo( st, st->hTranDet, &st->hTcxCfg->tcx_curr_overlap_mode ); - -#ifdef IND_LIST_DYN - /* re-allocate list of indices, if needed (note that st->total_brate is modified later in this function) */ - /* get the maximum allowed number of indices in the list */ - max_num_indices = get_max_num_indices( ivas_format, st->total_brate ); - - /* check, if the maximum number of allowed indices has changed */ - if ( max_num_indices != st->hBstr->max_num_indices ) - { - /* re-allocate the list of indices */ - ind_list_realloc( st->hBstr, max_num_indices ); - } -#endif } /* adaptively sync tcx modes*/ @@ -380,7 +361,13 @@ void stereo_mdct_core_enc( for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { st = sts[ch]; - +#ifdef IND_LIST_DYN + /* update the pointer to the buffer of indices of the second channel */ + if ( ch == 1 ) + { + st->hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot; + } +#endif ProcessIGF( st, st->hTcxEnc->spectrum[n], orig_spectrum[ch][n], &powerSpec[ch][n * L_subframeTCX], st->core == TCX_20_CORE, n, hCPE->hCoreCoder[0]->sp_aud_decision0, 0 ); } } @@ -391,6 +378,13 @@ void stereo_mdct_core_enc( for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { st = sts[ch]; +#ifdef IND_LIST_DYN + /* update the pointer to the buffer of indices of the second channel */ + if ( ch == 1 ) + { + st->hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot; + } +#endif nSubframes = ( st->hTcxEnc->tcxMode == TCX_20 ) ? 1 : NB_DIV; if ( st->igf ) { diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index 3857795dce..28cb1dfeb1 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -124,6 +124,14 @@ void stereo_td_init_enc( hStereoTD->tdm_prev_desired_idx = LRTD_STEREO_LEFT_IS_PRIM; } +#ifdef IND_LIST_DYN + hStereoTD->tdm_hBstr_tmp.ind_list = hStereoTD->tdm_ind_list_tmp; + hStereoTD->tdm_hBstr_tmp.ivas_ind_list_zero = hStereoTD->tdm_ind_list_tmp; + hStereoTD->max_ind_tdm_tmp = MAX_IND_TDM_TMP; + hStereoTD->tdm_hBstr_tmp.ivas_max_num_indices = &hStereoTD->max_ind_tdm_tmp; + reset_indices_enc( &hStereoTD->tdm_hBstr_tmp, MAX_IND_TDM_TMP ); +#endif + return; } @@ -314,12 +322,16 @@ void tdm_configure_enc( int16_t tdm_ratio_bit_alloc_idx, mod_ct; STEREO_TD_ENC_DATA_HANDLE hStereoTD; Encoder_State **sts; +#ifndef IND_LIST_DYN BSTR_ENC_HANDLE hBstr; +#endif int16_t loc_coder_tyape_raw0; hStereoTD = hCPE->hStereoTD; sts = hCPE->hCoreCoder; +#ifndef IND_LIST_DYN hBstr = sts[1]->hBstr; +#endif loc_coder_tyape_raw0 = sts[0]->coder_type_raw; /*----------------------------------------------------------------* @@ -475,6 +487,46 @@ void tdm_configure_enc( * Bitstream writing *----------------------------------------------------------------*/ +#ifdef IND_LIST_DYN + /* transmit the ratio index */ + if ( tdm_SM_or_LRTD_Pri && hStereoTD->tdm_LRTD_flag == 0 ) + { + push_indice( &hStereoTD->tdm_hBstr_tmp, IND_STEREO_TD_ALPHA, tdm_ratio_idx_SM, TDM_RATIO_BITS ); + } + else + { + if ( hStereoTD->tdm_LRTD_flag == 1 ) + { + push_indice( &hStereoTD->tdm_hBstr_tmp, IND_STEREO_TD_ALPHA, hStereoTD->tdm_inst_ratio_idx, TDM_RATIO_BITS ); + } + else + { + push_indice( &hStereoTD->tdm_hBstr_tmp, IND_STEREO_TD_ALPHA, tdm_ratio_idx, TDM_RATIO_BITS ); + } + } + + /* LPC reuse flag */ + if ( sts[1]->coder_type == INACTIVE && tdm_ratio_idx < 29 && tdm_ratio_idx > 1 ) + { + /* normal TD, tdm_lp_reuse_flag always on, tdm_use_IAWB_Ave_lpc varies tdm_ratio_idx<29 && tdm_ratio_idx> 1*/ + push_indice( &hStereoTD->tdm_hBstr_tmp, IND_STEREO_LPC_REUSE, hStereoTD->tdm_use_IAWB_Ave_lpc, TDM_LP_REUSE_BITS ); + } + else + { + push_indice( &hStereoTD->tdm_hBstr_tmp, IND_STEREO_LPC_REUSE, hStereoTD->tdm_lp_reuse_flag, TDM_LP_REUSE_BITS ); + } + + /* LRTD flag */ + push_indice( &hStereoTD->tdm_hBstr_tmp, IND_STEREO_LRTD_FLAG, hStereoTD->tdm_LRTD_flag, TDM_LR_CONTENT_BITS ); + + /* Stereo ICA parameters */ + if ( hStereoTD->tdm_LRTD_flag == 0 ) + { + push_indice( &hStereoTD->tdm_hBstr_tmp, IND_STEREO_REFCHAN, hCPE->hStereoTCA->refChanIndx, STEREO_BITS_TCA_CHAN ); + push_indice( &hStereoTD->tdm_hBstr_tmp, IND_STEREO_CORRSTATS, hCPE->hStereoTCA->indx_ica_NCShift, STEREO_BITS_TCA_CORRSTATS ); + push_indice( &hStereoTD->tdm_hBstr_tmp, IND_STEREO_GD, hCPE->hStereoTCA->indx_ica_gD, STEREO_BITS_TCA_GD ); + } +#else /* transmit the ratio index */ if ( tdm_SM_or_LRTD_Pri && hStereoTD->tdm_LRTD_flag == 0 ) { @@ -513,12 +565,14 @@ void tdm_configure_enc( push_indice( hBstr, IND_STEREO_CORRSTATS, hCPE->hStereoTCA->indx_ica_NCShift, STEREO_BITS_TCA_CORRSTATS ); push_indice( hBstr, IND_STEREO_GD, hCPE->hStereoTCA->indx_ica_gD, STEREO_BITS_TCA_GD ); } +#endif #ifdef DEBUG_MODE_TD dbgwrite( &hStereoTD->tdm_low_rate_mode, 2, 1, 320, "res/tdm_low_rate_mode" ); dbgwrite( &hStereoTD->tdm_lp_reuse_flag, 2, 1, 320, "res/tdm_lp_reuse_flag" ); dbgwrite( &mod_ct, 2, 1, 320, "res/mod_ct.enx" ); #endif + /*----------------------------------------------------------------* * Updates *----------------------------------------------------------------*/ diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index f3db751e0a..ee3618399c 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -35,11 +35,13 @@ #include "prot.h" #include #include +#include #include #ifdef DEBUGGING #include "debug.h" #endif #include "wmc_auto.h" +#include "options.h" /*---------------------------------------------------------------------* * Local struct @@ -182,6 +184,11 @@ ivas_error IVAS_ENC_Open( /* initialize pointers to handles to NULL */ ivas_initialize_handles_enc( st_ivas ); +#ifdef IND_LIST_DYN + st_ivas->ind_list = NULL; + st_ivas->ind_list_metadata = NULL; +#endif + /* set high-level parameters */ st_ivas->mc_mode = MC_MODE_NONE; st_ivas->ism_mode = ISM_MODE_NONE; @@ -1081,6 +1088,9 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( ENCODER_CONFIG_HANDLE hEncoderConfig; ENC_CORE_HANDLE hCoreCoder; int16_t i; +#ifdef IND_LIST_DYN + int16_t n, ch; +#endif ivas_error error; error = IVAS_ERR_OK; @@ -1148,6 +1158,73 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( hIvasEnc->switchingActive = true; } +#ifdef IND_LIST_DYN + /*-----------------------------------------------------------------* + * Re-allocate and re-initialize buffer of indices if IVAS total bitrate has changed + *-----------------------------------------------------------------*/ + + if ( hEncoderConfig->ivas_total_brate != hEncoderConfig->last_ivas_total_brate ) + { + /* de-allocate old buffer of indices */ + free( st_ivas->ind_list ); + free( st_ivas->ind_list_metadata ); + + /* set the maximum allowed number of indices in the list */ + st_ivas->ivas_max_num_indices = get_ivas_max_num_indices( hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); + st_ivas->ivas_max_num_indices_metadata = get_ivas_max_num_indices_metadata( hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); + + /* allocate new buffer of indices */ + if ( ( st_ivas->ind_list = (INDICE_HANDLE) malloc( st_ivas->ivas_max_num_indices * sizeof( Indice ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); + } + + if ( ( st_ivas->ind_list_metadata = (INDICE_HANDLE) malloc( st_ivas->ivas_max_num_indices_metadata * sizeof( Indice ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of metadata indices!\n" ) ); + } + + /* reset the list of indices */ + for ( i = 0; i < st_ivas->ivas_max_num_indices; i++ ) + { + st_ivas->ind_list[i].nb_bits = -1; + } + + for ( i = 0; i < st_ivas->ivas_max_num_indices_metadata; i++ ) + { + st_ivas->ind_list_metadata[i].nb_bits = -1; + } + + /* set pointers to the new buffer of indices in each element */ + for ( n = 0; n < st_ivas->nSCE; n++ ) + { + st_ivas->hSCE[n]->hCoreCoder[0]->hBstr->ind_list = st_ivas->ind_list; + st_ivas->hSCE[n]->hCoreCoder[0]->hBstr->ivas_ind_list_zero = st_ivas->ind_list; + + if ( st_ivas->hSCE[n]->hMetaData != NULL ) + { + st_ivas->hSCE[n]->hMetaData->ind_list = st_ivas->ind_list_metadata; + st_ivas->hSCE[n]->hMetaData->ivas_ind_list_zero = st_ivas->ind_list_metadata; + } + } + + for ( n = 0; n < st_ivas->nCPE; n++ ) + { + for ( ch = 0; ch < CPE_CHANNELS; ch++ ) + { + st_ivas->hCPE[n]->hCoreCoder[ch]->hBstr->ind_list = st_ivas->ind_list; + st_ivas->hCPE[n]->hCoreCoder[ch]->hBstr->ivas_ind_list_zero = st_ivas->ind_list; + } + + if ( st_ivas->hCPE[n]->hMetaData != NULL ) + { + st_ivas->hCPE[n]->hMetaData->ind_list = st_ivas->ind_list_metadata; + st_ivas->hCPE[n]->hMetaData->ivas_ind_list_zero = st_ivas->ind_list_metadata; + } + } + } +#endif + if ( hIvasEnc->switchingActive && hEncoderConfig->ivas_format == MONO_FORMAT ) { copy_encoder_config( st_ivas, hCoreCoder, 0 ); @@ -1188,6 +1265,31 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( } } + +#ifdef DEBUG_IND_LIST + int16_t total_nb_ind = 0; + for ( i = 0; i < st_ivas->ivas_max_num_indices; i++ ) + { + if ( st_ivas->ind_list[i].nb_bits > -1 ) + { + total_nb_ind++; + } + } + + fprintf( stdout, "Total number of allocated indices (codec): IVAS format: %d, bitrate: %d, #indices: %d\n", hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate, total_nb_ind ); + + total_nb_ind = 0; + for ( i = 0; i < st_ivas->ivas_max_num_indices_metadata; i++ ) + { + if ( st_ivas->ind_list_metadata[i].nb_bits > -1 ) + { + total_nb_ind++; + } + } + + fprintf( stdout, "Total number of allocated indices (metadata): IVAS format: %d, bitrate: %d, #indices: %d\n", hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate, total_nb_ind ); +#endif + /* write indices into bitstream buffer */ write_indices_ivas( st_ivas, outputBitStream, numOutBits ); diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index c37ed76dc7..fe4b00d849 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -81,7 +81,10 @@ typedef struct bitstream_enc_data_structure int16_t next_ind; /* pointer to the next empty slot in the list of indices */ int16_t last_ind; /* last written indice */ #endif - int16_t max_num_indices; /* maximum number of indices in the list */ +#ifdef IND_LIST_DYN + int16_t *ivas_max_num_indices; /* maximum total number of indices in the list */ + Indice *ivas_ind_list_zero; /* beginning of the buffer of indices */ +#endif } BSTR_ENC_DATA, *BSTR_ENC_HANDLE; /*----------------------------------------------------------------------------------* diff --git a/lib_enc/tcx_utils_enc.c b/lib_enc/tcx_utils_enc.c index 2dd5340992..8099b8cb07 100644 --- a/lib_enc/tcx_utils_enc.c +++ b/lib_enc/tcx_utils_enc.c @@ -1583,7 +1583,12 @@ void ProcessStereoIGF( #else pBsStart = hBstr->next_ind; #endif - +#ifdef IND_LIST_DYN + if ( ch > 0 ) + { + hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot; + } +#endif IGFEncWriteBitstream( hIGFEnc[ch], hBstr, &hIGFEnc[ch]->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag ); #ifdef IND_LIST_DYN -- GitLab From c39a37b3705c45fec60cdfec9c22abfe22a31322 Mon Sep 17 00:00:00 2001 From: malenov Date: Thu, 13 Apr 2023 13:00:00 +0200 Subject: [PATCH 28/43] increase the max number of indices of HOA3 metadata at 32 kbps --- lib_com/bitstream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 4d74baf88e..a2c351d49d 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -764,11 +764,11 @@ int16_t get_ivas_max_num_indices_metadata( /* o : max } else if ( ivas_total_brate <= IVAS_32k ) { - return 250; + return 300; } else if ( ivas_total_brate <= IVAS_192k ) { - return 300; + return 500; } else if ( ivas_total_brate <= IVAS_256k ) { -- GitLab From 1322bfda864256aab9abc876c59e0716562e7570 Mon Sep 17 00:00:00 2001 From: malenov Date: Thu, 13 Apr 2023 13:08:16 +0200 Subject: [PATCH 29/43] clang format --- lib_com/bitstream.c | 36 +++++++++++++-------------- lib_com/prot.h | 20 +++++++-------- lib_enc/init_enc.c | 4 +-- lib_enc/ivas_corecoder_enc_reconfig.c | 4 +-- lib_enc/ivas_init_enc.c | 3 +-- lib_enc/ivas_mct_enc_mct.c | 2 +- lib_enc/ivas_sce_enc.c | 2 +- lib_enc/ivas_stereo_mdct_core_enc.c | 2 +- 8 files changed, 36 insertions(+), 37 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index a2c351d49d..d2b53a2be9 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -242,7 +242,7 @@ ivas_error ind_list_realloc( } /* move indices from the old list to the new list */ - for ( i = 0; i < min(max_num_indices, *( hBstr->ivas_max_num_indices )); i++ ) + for ( i = 0; i < min( max_num_indices, *( hBstr->ivas_max_num_indices ) ); i++ ) { if ( hBstr->ivas_ind_list_zero[i].nb_bits > -1 ) { @@ -259,7 +259,7 @@ ivas_error ind_list_realloc( } /* get the current position inside the old list */ - ind_list_pos = (int16_t)(hBstr->ind_list - hBstr->ivas_ind_list_zero); + ind_list_pos = (int16_t) ( hBstr->ind_list - hBstr->ivas_ind_list_zero ); /* free the old list */ free( hBstr->ivas_ind_list_zero ); @@ -269,7 +269,7 @@ ivas_error ind_list_realloc( hBstr->ivas_ind_list_zero = new_ind_list; /* set the new maximum number of indices */ - *(hBstr->ivas_max_num_indices) = max_num_indices; + *( hBstr->ivas_max_num_indices ) = max_num_indices; return IVAS_ERR_OK; } @@ -282,8 +282,8 @@ ivas_error ind_list_realloc( *-----------------------------------------------------------------------*/ int16_t get_ivas_max_num_indices( /* o : maximum number of indices */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t ivas_total_brate /* i : IVAS total bitrate */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ ) { if ( ivas_format == STEREO_FORMAT ) @@ -516,12 +516,12 @@ int16_t get_ivas_max_num_indices( /* o : maximum /*-----------------------------------------------------------------------* * get_core_max_num_indices() * - * Get the maximum allowed number of indices in the core coder + * Get the maximum allowed number of indices in the core coder *-----------------------------------------------------------------------*/ -int16_t get_core_max_num_indices( /* o : maximum number of indices */ - const int16_t core, /* i : core */ - const int32_t total_brate /* i : total bitrate */ +int16_t get_core_max_num_indices( /* o : maximum number of indices */ + const int16_t core, /* i : core */ + const int32_t total_brate /* i : total bitrate */ ) { /* set the maximum number of indices in the core coder */ @@ -691,11 +691,11 @@ int16_t get_core_max_num_indices( /* o : maximum number of indices */ /*-----------------------------------------------------------------------* * get_BWE_max_num_indices() * - * Get the maximum number of indices in the BWE + * Get the maximum number of indices in the BWE *-----------------------------------------------------------------------*/ -int16_t get_BWE_max_num_indices( /* o : maximum number of indices */ - const int32_t extl_brate /* i : extensiona layer bitrate */ +int16_t get_BWE_max_num_indices( /* o : maximum number of indices */ + const int32_t extl_brate /* i : extensiona layer bitrate */ ) { /* set the maximum number of indices in the BWE */ @@ -708,7 +708,7 @@ int16_t get_BWE_max_num_indices( /* o : maximum numb return 150; } } - + /*-----------------------------------------------------------------------* * get_ivas_max_num_indices_metadata() @@ -716,9 +716,9 @@ int16_t get_BWE_max_num_indices( /* o : maximum numb * Set the maximum allowed number of metadata indices in the list *-----------------------------------------------------------------------*/ -int16_t get_ivas_max_num_indices_metadata( /* o : maximum number of indices */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t ivas_total_brate /* i : IVAS total bitrate */ +int16_t get_ivas_max_num_indices_metadata( /* o : maximum number of indices */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ ) { /* set the maximum required number of metadata indices */ @@ -903,7 +903,7 @@ ivas_error move_indices( * check_ind_list_limits() * * Check, if if the maximum number of indices has been reached -> reallocate - * Check, if we will not overwrite an existing indice -> adjust the location + * Check, if we will not overwrite an existing indice -> adjust the location *-------------------------------------------------------------------*/ ivas_error check_ind_list_limits( @@ -1872,7 +1872,7 @@ static ivas_error write_indices_element( for ( n = 0; n < n_channels; n++ ) { - reset_indices_enc( sts[n]->hBstr, + reset_indices_enc( sts[n]->hBstr, #ifdef IND_LIST_DYN sts[n]->hBstr->nb_ind_tot #else diff --git a/lib_com/prot.h b/lib_com/prot.h index f4960083ea..718ad91e41 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -516,23 +516,23 @@ void push_next_bits( ); #ifdef IND_LIST_DYN -int16_t get_ivas_max_num_indices( /* o : maximum number of indices */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t ivas_total_brate /* i : IVAS total bitrate */ +int16_t get_ivas_max_num_indices( /* o : maximum number of indices */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ ); int16_t get_core_max_num_indices( /* o : maximum number of indices */ - const int16_t core, /* i : core */ - const int32_t total_brate /* i : total bitrate */ + const int16_t core, /* i : core */ + const int32_t total_brate /* i : total bitrate */ ); -int16_t get_BWE_max_num_indices( /* o : maximum number of indices */ +int16_t get_BWE_max_num_indices( /* o : maximum number of indices */ const int32_t extl_brate /* i : extensiona layer bitrate */ ); -int16_t get_ivas_max_num_indices_metadata( /* o : maximum number of indices for metadata */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t ivas_total_brate /* i : IVAS total bitrate */ +int16_t get_ivas_max_num_indices_metadata( /* o : maximum number of indices for metadata */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ ); ivas_error ind_list_realloc( @@ -2273,7 +2273,7 @@ void read_next_force( ivas_error init_encoder( Encoder_State *st, /* i/o: state structure */ #ifdef IND_LIST_DYN - Encoder_Struct *st_ivas, /* i/o: encoder state structure */ + Encoder_Struct *st_ivas, /* i/o: encoder state structure */ #endif const int16_t idchan, /* i : channel ID */ const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index fcb605fc10..6e4611e3d6 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -54,9 +54,9 @@ *-----------------------------------------------------------------------*/ ivas_error init_encoder( - Encoder_State *st, /* i/o: state structure */ + Encoder_State *st, /* i/o: state structure */ #ifdef IND_LIST_DYN - Encoder_Struct *st_ivas, /* i/o: encoder state structure */ + Encoder_Struct *st_ivas, /* i/o: encoder state structure */ #endif const int16_t idchan, /* i : channel ID */ const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index c96771d38d..c8c8671aab 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -509,7 +509,7 @@ ivas_error ivas_corecoder_enc_reconfig( for ( n = 0; n < CPE_CHANNELS; n++ ) { st_ivas->hCPE[0]->hCoreCoder[n]->total_brate = st_ivas->hCPE[0]->element_brate; - st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal = ( int16_t )( st_ivas->hCPE[0]->element_brate / FRAMES_PER_SEC ); + st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal = (int16_t) ( st_ivas->hCPE[0]->element_brate / FRAMES_PER_SEC ); st_ivas->hCPE[0]->hCoreCoder[n]->igf = getIgfPresent( st_ivas->hCPE[0]->hCoreCoder[n]->element_mode, st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal * FRAMES_PER_SEC, st_ivas->hCPE[0]->hCoreCoder[n]->bwidth, @@ -589,7 +589,7 @@ ivas_error ivas_corecoder_enc_reconfig( for ( n = 0; n < CPE_CHANNELS; n++ ) { st_ivas->hCPE[0]->hCoreCoder[n]->total_brate = st_ivas->hCPE[0]->element_brate; - st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal = ( int16_t )( st_ivas->hCPE[0]->element_brate / FRAMES_PER_SEC ); + st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal = (int16_t) ( st_ivas->hCPE[0]->element_brate / FRAMES_PER_SEC ); st_ivas->hCPE[0]->hCoreCoder[n]->igf = getIgfPresent( st_ivas->hCPE[0]->hCoreCoder[n]->element_mode, st_ivas->hCPE[0]->hCoreCoder[n]->bits_frame_nominal * FRAMES_PER_SEC, st_ivas->hCPE[0]->hCoreCoder[n]->bwidth, diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index f370665381..a9960a445d 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -739,7 +739,6 @@ ivas_error ivas_init_encoder( } #endif } - } } #ifdef DEBUGGING @@ -808,7 +807,7 @@ void destroy_core_enc( { #ifdef IND_LIST_DYN /* reset buffer of indices */ - for ( i = 0; i < hCoreCoder->hBstr->nb_ind_tot; i++) + for ( i = 0; i < hCoreCoder->hBstr->nb_ind_tot; i++ ) { hCoreCoder->hBstr->ind_list[i].nb_bits = -1; } diff --git a/lib_enc/ivas_mct_enc_mct.c b/lib_enc/ivas_mct_enc_mct.c index de0e081240..fbe57791f4 100644 --- a/lib_enc/ivas_mct_enc_mct.c +++ b/lib_enc/ivas_mct_enc_mct.c @@ -856,7 +856,7 @@ void mctStereoIGF_enc( p_st[1] = sts[ch2]; #ifdef IND_LIST_DYN - if (ch1 > 0) + if ( ch1 > 0 ) { sts[ch1]->hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot; } diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 7fc461193b..4754470402 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -283,7 +283,7 @@ ivas_error create_sce_enc( Encoder_State *st; ivas_error error; #ifdef IND_LIST_DYN - //int16_t i; + // int16_t i; #endif error = IVAS_ERR_OK; diff --git a/lib_enc/ivas_stereo_mdct_core_enc.c b/lib_enc/ivas_stereo_mdct_core_enc.c index b5f266cffa..c78a3a63df 100644 --- a/lib_enc/ivas_stereo_mdct_core_enc.c +++ b/lib_enc/ivas_stereo_mdct_core_enc.c @@ -116,7 +116,7 @@ static void sync_tcx_mode( *-------------------------------------------------------------------*/ void stereo_mdct_core_enc( - CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ + CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ float new_samples[CPE_CHANNELS][L_INP], /* i : new samples */ float old_wsp[CPE_CHANNELS][L_WSP], /* i : 12.8kHz weighted speech (for LTP */ float pitch_buf[CPE_CHANNELS][NB_SUBFR16k] /* o : floating pitch for each subframe */ -- GitLab From 74d03a50a12831f104da01f3ecd7176391175a69 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Thu, 13 Apr 2023 14:19:51 +0200 Subject: [PATCH 30/43] cleanup --- lib_com/options.h.unchanged | 170 ------------------------------------ lib_enc/ivas_sce_enc.c | 3 - 2 files changed, 173 deletions(-) delete mode 100644 lib_com/options.h.unchanged diff --git a/lib_com/options.h.unchanged b/lib_com/options.h.unchanged deleted file mode 100644 index 2e5949f967..0000000000 --- a/lib_com/options.h.unchanged +++ /dev/null @@ -1,170 +0,0 @@ -/****************************************************************************************************** - - (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. - -*******************************************************************************************************/ - -/*==================================================================================== - EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 - ====================================================================================*/ - -#ifndef OPTIONS_H -#define OPTIONS_H - -/* clang-format off */ -/* ################### Start compiler switches ######################## */ - -#define SUPPORT_JBM_TRACEFILE /* support for JBM tracefile, which is needed for 3GPP objective/subjective testing, but not relevant for real-world implementations */ - -/* #################### End compiler switches ######################### */ - - -/* ################### Start DEBUGGING switches ########################### */ - -#ifndef RELEASE -#define DEBUGGING /* Activate debugging part of the code */ -#endif -/*#define WMOPS*/ /* Activate complexity and memory counters */ -/*#define WMOPS_PER_FRAME*/ /* Output per-frame complexity (writes one float value per frame to the file "wmops_analysis") */ -/*#define WMOPS_DETAIL*/ /* Output detailed complexity printout for every function. Increases runtime overhead */ -/*#define WMOPS_WC_FRAME_ANALYSIS*/ /* Output detailed complexity analysis for the worst-case frame */ -/*#define MEM_COUNT_DETAILS*/ /* Output detailed memory analysis for the worst-case frame (writes to the file "mem_analysis.csv") */ - -#ifdef DEBUGGING - -/*#define DEBUG_MODE_INFO*/ /* output most important parameters to the subdirectory "res/" */ -#ifdef DEBUG_MODE_INFO -/*#define DEBUG_MODE_ACELP*/ /* output most important ACELP core parameters to the subdirectory "res/" */ -/*#define DEBUG_MODE_TCX*/ /* output most important TCX core parameters to the subdirectory "res/" */ -/*#define DEBUG_MODE_DFT*/ /* output most important DFT stereo parameters to the subdirectory "res/" */ -/*#define DEBUG_MODE_TD*/ /* output most important TD stereo parameters to the subdirectory "res/ */ -/*#define DEBUG_MODE_DIRAC*/ /* output most important DIRAC parameters to the subdirectory "res/" */ -/*#define DEBUG_MODE_MDCT*/ /* output most important MDCT parameters to the subdirectory "res/" */ -/*#define DEBUG_MODE_PARAM_MC */ /* output Parametric MC paramters to the subdirectory "res/" */ -/*#define DEBUG_MODE_PARAM_ISM*/ /* output Parametric ISM paramters to the subdirectory "res/" */ -/*#define DEBUG_MODE_INFO_TWEAK*/ /* enable command line switch to specify subdirectory for debug info output inside "./res/" */ -/*#define DEBUG_MODE_INFO_PLC */ /* define to output PLC related parameters */ -/*#define DEBUG_MODE_INFO_ALLRAD*/ /* define to output generated HOA decoding mtx */ -/*#define DEBUG_MODE_LFE */ /* define to output LFE relevant parameters */ -#endif - -#ifdef DEBUG_MODE_MDCT -#define DEBUG_PLOT_BITS -#endif - -#define ENABLE_BITRATE_VERIFICATION /* Enable bitrate verification - use when playing with bit budget */ -/*#define DEBUG_PLOT*/ -/*#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: -stere 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*/ -/*#define DEBUG_STEREO_DFT_OUTRESPRED*/ /* output residual prediction signal instead of L/R*/ -/*#define DBG_STEREO_ICBWE2_TBE2K8*/ /* Enables TBE_2K8 for higher bitrates with ICBWE in operation for TD/DFT Stereo. Needs quality eval and currently only used for debugging purposes */ - -/*DirAC Debug switches*/ -/*#define DEBUG_DISABLE_DIRAC_DELAY_COMP */ /* temporarily disable delay compensation on DirAC encoder */ -/*#define DEBUG_BS_READ_WRITE*/ -/*#define DEBUG_MODE_DIRAC_NOCORE*/ -/*#define DEBUG_MODE_QMETADATA*/ /* output q_metadata parameters */ - -/*MCT Debug switches*/ -/*#define DEBUG_FORCE_MCT_CP*/ /* force MCT Stereo pairs for verification with SPAR */ -#ifdef DEBUG_FORCE_MCT_CP -/*#define DEBUG_SINGLE_CODE_OMNI*/ /* force 3 TC SBA always code W channel seperately */ -#endif - -/*PLC Debug switches*/ -/*#define DEBUG_NO_TONAL_PLC*/ -/*#define DEBUG_NO_TD_TCX_PLC */ -/*#define DEBUG_FORCE_TD_TCX_CONCEALMENT*/ -/*#define DEBUG_PLC_INFO*/ - -/*#define DEBUG_EFAP_POLY_TOFILE*/ /* Write poly_select values to file in EFAP, used for generating ROM LUTs */ -/*#define TDREND_HRTF_TABLE_METHODS*/ /* Enable HRTF lookup from tables, for testing & evaluation. Supply file in table format to use. Note that a suitable HR filter lookup method should be written if the filters sample point grids are not in the formats. */ -/*#define TDREND_STANDALONE*/ /* Used when renderer is built in standalone form, without IVAS encoding/decoding (see scripts/object_renderer_standalone). This is just here to ensure this is cleaned out by prepare_instrumentation.sh */ - -/*#define DEBUG_SBA*/ /* debug DIRAC/SPAR in-out */ -#ifdef DEBUG_SBA -/*#define DEBUG_SBA_AUDIO_DUMP*/ /* SBA intermediate audio wav file dumping */ -/*#define DEBUG_SBA_MD_DUMP*/ /* SBA metadata and variable file dumping */ -/*#define DEBUG_SPAR_MD_TARGET_TUNING*/ /* SPAR MD target bitrate tuning debug code */ -/*#define DEBUG_SPAR_BYPASS_EVS_CODEC*/ /* bypass EVS coding in float precision, emulating EVS encoder/decoder delay */ -/*#define DEBUG_SPAR_WRITE_OUT_COV*/ /* write covariance per frame into a text file for verification */ -/*#define DEBUG_SPAR_DIRAC_WRITE_OUT_PRED_PARS*/ -/*#define DEBUG_AGC*/ /* debug SPAR AGC in-out */ -#endif -/*#define SPAR_HOA_DBG*/ /* SPAR HOA debug statements */ -/*#define DEBUG_BINAURAL_FILTER_DESIGN*/ /* debugging of Crend binaural filter design */ -#define DEBUG_AGC_ENCODER_CMD_OPTION /* Ability to force enable or disable AGC behaviour in DIRAC/SPAR via command line option */ - -#endif -/* #################### End DEBUGGING switches ############################ */ - -/* ################# Start DEVELOPMENT switches ######################## */ - -#define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ -//#define IND_LIST_DYN /* VA: Issue 18: Dynamic allocation of ind_list[] and ind_list_metadata[] based on # of transport channels */ -//#define DEBUG_VLAD - -#define LSF_RE_USE_SECONDARY_CHANNEL /* TD stereo Secondary channel LSF Q improvement */ -#ifdef LSF_RE_USE_SECONDARY_CHANNEL -/*#define LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE */ /* switch to isolate the reuse mode case */ -#endif -#define DISABLE_ADAP_RES_COD_TMP /* temporary fix for IVAS-403, disables adaptive residual coding */ -/*#define ITD_WINNER_GAIN_MODIFY */ /* ITD optimization - WORK IN PROGRESS */ -/*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ -#define FIX_I109_ORIENTATION_TRACKING /* Issue 109: Harmonize head and orientation tracking */ -/*#define SBA_HPF_TUNING_DEC*/ - -#define BINAURALIZATION_DELAY_REPORT /* VA: Issue 255 - Changes the way the decoder delay is reported */ -#define TUNE_360_OBJECT_WITH_NOISE /* VA: issue 360: consider objects being speech+noise for active speech coding */ -#define FIX_350_MASA_DELAY_COMP /* Nokia: Issue 350: MASA audio/meta delay compensation */ -#define FIX_372_LIB_REND_VALIDATE_IO /* FhG: Issue 372: IVAS_rend segfaults with unsupported I/O configs - add validation checks of I/O config */ -#define FIX_376_SBA_ROTATE /*DLB: Fix for issue 376*/ -#define TD5 /* Eri: Contribution 17: Extended metadata for 6 DoF rendering in TD renderer */ -#define TD5_FIX_INVALID_MEMORY_ACCESS /* FhG: Resolves segfault in case IVAS_REND_InitConfig gets initialized with rendererConfigEnabled:=false && ISM are being rendered */ -#define FIX_371_DELAY_REPORT /* Issue 371: div. by zero with -no_delay_cmp */ -#define FIX_373_MASA_DELAY_COMP_MSAN /* Nokia: Issue 373: MASA audio/meta delay compensation. MSAN bugfix */ - -#ifdef FIX_I109_ORIENTATION_TRACKING -#define OTR_REFERENCE_VECTOR_TRACKING /* FhG: enables the reference position orientation tracking mode */ -#endif - -#define FIX_380_BFI_PARAMISM /* VA: issue 380 - fix metadata recovery in ParamISM BFI */ -#define FIX_MDCT_BASED_BWD /* FhG: fixes for BWD for issues with reaction to transients for MDCT-stereo and MCT */ -#define DISCRETE_ISM_DTX_CNG /* FhG/VA: contribution 15 - DTX/CNG for (discrete) ISM */ -#define NCHAN_ISM_PARAMETER /* VA: make 'nchan_ism' parameter part of st_ivas/hEncoderConfig */ - - -/* ################## End DEVELOPMENT switches ######################### */ -/* clang-format on */ -#endif diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 4754470402..649d378ce0 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -282,9 +282,6 @@ ivas_error create_sce_enc( SCE_ENC_HANDLE hSCE; Encoder_State *st; ivas_error error; -#ifdef IND_LIST_DYN - // int16_t i; -#endif error = IVAS_ERR_OK; -- GitLab From 6750cfb300a34ef4389e1ac469fbeaf32f92d9d5 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Thu, 13 Apr 2023 14:35:34 +0200 Subject: [PATCH 31/43] clang format --- lib_enc/ivas_cpe_enc.c | 4 ++-- lib_enc/ivas_mct_core_enc.c | 2 +- lib_enc/ivas_mct_enc.c | 2 +- lib_enc/ivas_mdct_core_enc.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index fbb16a341e..9f36ed53fe 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -869,9 +869,9 @@ ivas_error create_cpe_enc( #endif if ( ( error = init_encoder( st, #ifdef IND_LIST_DYN - st_ivas, + st_ivas, #endif - n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) + n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_mct_core_enc.c b/lib_enc/ivas_mct_core_enc.c index a8171b199f..49befac21c 100644 --- a/lib_enc/ivas_mct_core_enc.c +++ b/lib_enc/ivas_mct_core_enc.c @@ -444,7 +444,7 @@ void ivas_mct_core_enc( #ifdef IND_LIST_DYN /* update the pointer to the buffer of indices of the second channel */ - if (ch > 0) + if ( ch > 0 ) { st->hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot; } diff --git a/lib_enc/ivas_mct_enc.c b/lib_enc/ivas_mct_enc.c index b739868c24..c6ec1bbe1d 100644 --- a/lib_enc/ivas_mct_enc.c +++ b/lib_enc/ivas_mct_enc.c @@ -266,7 +266,7 @@ ivas_error ivas_mct_enc( hCPE = st_ivas->hCPE[cpe_id]; #ifdef IND_LIST_DYN - if (cpe_id > 0) + if ( cpe_id > 0 ) { hCPE->hCoreCoder[0]->hBstr->ind_list = st_ivas->hCPE[cpe_id - 1]->hCoreCoder[1]->hBstr->ind_list + st_ivas->hCPE[cpe_id - 1]->hCoreCoder[1]->hBstr->nb_ind_tot; } diff --git a/lib_enc/ivas_mdct_core_enc.c b/lib_enc/ivas_mdct_core_enc.c index 862a2436a2..3d68252654 100644 --- a/lib_enc/ivas_mdct_core_enc.c +++ b/lib_enc/ivas_mdct_core_enc.c @@ -1368,7 +1368,7 @@ void ivas_mdct_quant_coder( #ifdef IND_LIST_DYN /* update the pointer to the buffer of indices of the second channel */ - if (ch > 0) + if ( ch > 0 ) { st->hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot; } -- GitLab From 2d9f5839c8c13e9abc76c6658762d63235886439 Mon Sep 17 00:00:00 2001 From: malenov Date: Thu, 27 Apr 2023 14:45:48 +0200 Subject: [PATCH 32/43] fixing incorrect reset of ind_list_metadata[] --- lib_enc/ivas_init_enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index a9960a445d..8d113adf03 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -384,7 +384,7 @@ ivas_error ivas_init_encoder( /* reset the list of metadata indices */ for ( i = 0; i < st_ivas->ivas_max_num_indices_metadata; i++ ) { - st_ivas->ind_list[i].nb_bits = -1; + st_ivas->ind_list_metadata[i].nb_bits = -1; } #endif -- GitLab From e3dd0bab336be44636abf419f0ac217e2cdbed8f Mon Sep 17 00:00:00 2001 From: malenov Date: Thu, 27 Apr 2023 15:01:43 +0200 Subject: [PATCH 33/43] increase the amount of extra #indices during re-allocation to 100 --- lib_com/bitstream.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 99d9f17f80..2d51364654 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -63,7 +63,7 @@ FILE *FEC_pattern = NULL; /* FEC pattern file (for simulation of FEC) */ #endif #ifdef IND_LIST_DYN -#define STEP_MAX_NUM_INDICES 20 /* increase the maximum number of allowed indices in the list by this amount */ +#define STEP_MAX_NUM_INDICES 100 /* increase the maximum number of allowed indices in the list by this amount */ #endif #ifndef IND_LIST_DYN @@ -902,7 +902,7 @@ ivas_error move_indices( /*-------------------------------------------------------------------* * check_ind_list_limits() * - * Check, if if the maximum number of indices has been reached -> reallocate + * Check, if the maximum number of indices has been reached -> reallocate * Check, if we will not overwrite an existing indice -> adjust the location *-------------------------------------------------------------------*/ @@ -1020,7 +1020,7 @@ ivas_error push_indice( #endif #ifdef IND_LIST_DYN - /* check the limits in the list of indices */ + /* check the limits of the list of indices */ error = check_ind_list_limits( hBstr ); #endif @@ -1143,7 +1143,7 @@ ivas_error push_next_indice( #endif #ifdef IND_LIST_DYN - /* check the limits in the list of indices */ + /* check the limits of the list of indices */ error = check_ind_list_limits( hBstr ); #endif @@ -1233,7 +1233,7 @@ void push_next_bits( code = (uint16_t) ( ( bits[i] << 15 ) | ( ( bits[i + 1] << 14 ) | ( ( bits[i + 2] << 13 ) | ( ( bits[i + 3] << 12 ) | ( ( bits[i + 4] << 11 ) | ( ( bits[i + 5] << 10 ) | ( ( bits[i + 6] << 9 ) | ( ( bits[i + 7] << 8 ) | ( ( bits[i + 8] << 7 ) | ( ( bits[i + 9] << 6 ) | ( ( bits[i + 10] << 5 ) | ( ( bits[i + 11] << 4 ) | ( ( bits[i + 12] << 3 ) | ( ( bits[i + 13] << 2 ) | ( ( bits[i + 14] << 1 ) | bits[i + 15] ) ) ) ) ) ) ) ) ) ) ) ) ) ) ); #ifdef IND_LIST_DYN - /* check the limits in the list of indices */ + /* check the limits of the list of indices */ check_ind_list_limits( hBstr ); ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; #endif @@ -1253,7 +1253,7 @@ void push_next_bits( for ( ; i < nb_bits; ++i ) { #ifdef IND_LIST_DYN - /* check the limits in the list of indices */ + /* check the limits of the list of indices */ check_ind_list_limits( hBstr ); ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; #endif -- GitLab From 69eac64a578465065b1bfc2a40e6100404db5956 Mon Sep 17 00:00:00 2001 From: malenov Date: Thu, 27 Apr 2023 15:20:04 +0200 Subject: [PATCH 34/43] add warning message when re-allocating teh buffer of indices to prevent overwriting of existing indice(s) --- lib_com/bitstream.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 2d51364654..a695f6b95c 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -942,6 +942,10 @@ ivas_error check_ind_list_limits( if ( hBstr->ind_list >= &hBstr->ivas_ind_list_zero[*( hBstr->ivas_max_num_indices )] ) { +#ifdef DEBUGGING + fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame ); +#endif + /* no available empty slot -> need to re-allocate the buffer */ ind_list_realloc( hBstr, *( hBstr->ivas_max_num_indices ) + STEP_MAX_NUM_INDICES ); } -- GitLab From 262bc04e2bd86cc043d33047ce645a79d6c2111f Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Wed, 10 May 2023 16:01:05 +0200 Subject: [PATCH 35/43] fix cases where st_ivas->ind_list_metadata is NULL --- lib_enc/ivas_init_enc.c | 21 ++++++++++++++------- lib_enc/lib_enc.c | 36 ++++++++++++++++++++++++++---------- 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 8d113adf03..60423803e3 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -375,16 +375,23 @@ ivas_error ivas_init_encoder( /* set the maximum allowed number of metadata indices in the list */ st_ivas->ivas_max_num_indices_metadata = get_ivas_max_num_indices_metadata( st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); - /* allocate buffer of indices */ - if ( ( st_ivas->ind_list_metadata = (INDICE_HANDLE) malloc( st_ivas->ivas_max_num_indices_metadata * sizeof( Indice ) ) ) == NULL ) + /* allocate buffer of metadata indices */ + if ( st_ivas->ivas_max_num_indices_metadata > 0 ) { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of metadata indices!\n" ) ); - } + if ( ( st_ivas->ind_list_metadata = (INDICE_HANDLE) malloc( st_ivas->ivas_max_num_indices_metadata * sizeof( Indice ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of metadata indices!\n" ) ); + } - /* reset the list of metadata indices */ - for ( i = 0; i < st_ivas->ivas_max_num_indices_metadata; i++ ) + /* reset the list of metadata indices */ + for ( i = 0; i < st_ivas->ivas_max_num_indices_metadata; i++ ) + { + st_ivas->ind_list_metadata[i].nb_bits = -1; + } + } + else { - st_ivas->ind_list_metadata[i].nb_bits = -1; + st_ivas->ind_list_metadata = NULL; } #endif diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index b2c6351abc..6e4313e5a2 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -1167,11 +1167,9 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( { /* de-allocate old buffer of indices */ free( st_ivas->ind_list ); - free( st_ivas->ind_list_metadata ); /* set the maximum allowed number of indices in the list */ st_ivas->ivas_max_num_indices = get_ivas_max_num_indices( hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); - st_ivas->ivas_max_num_indices_metadata = get_ivas_max_num_indices_metadata( hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); /* allocate new buffer of indices */ if ( ( st_ivas->ind_list = (INDICE_HANDLE) malloc( st_ivas->ivas_max_num_indices * sizeof( Indice ) ) ) == NULL ) @@ -1179,23 +1177,41 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); } - if ( ( st_ivas->ind_list_metadata = (INDICE_HANDLE) malloc( st_ivas->ivas_max_num_indices_metadata * sizeof( Indice ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of metadata indices!\n" ) ); - } - /* reset the list of indices */ for ( i = 0; i < st_ivas->ivas_max_num_indices; i++ ) { st_ivas->ind_list[i].nb_bits = -1; } - for ( i = 0; i < st_ivas->ivas_max_num_indices_metadata; i++ ) + /* de-allocate old buffer of metadata indices */ + if ( st_ivas->ind_list_metadata != NULL ) + { + free( st_ivas->ind_list_metadata ); + } + + /* set the maximum allowed number of metadata indices in the list */ + st_ivas->ivas_max_num_indices_metadata = get_ivas_max_num_indices_metadata( hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate ); + + if ( st_ivas->ivas_max_num_indices_metadata > 0 ) + { + /* allocate new buffer of metadata indices */ + if ( ( st_ivas->ind_list_metadata = (INDICE_HANDLE) malloc( st_ivas->ivas_max_num_indices_metadata * sizeof( Indice ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of metadata indices!\n" ) ); + } + + /* reset the list of metadata indices */ + for ( i = 0; i < st_ivas->ivas_max_num_indices_metadata; i++ ) + { + st_ivas->ind_list_metadata[i].nb_bits = -1; + } + } + else { - st_ivas->ind_list_metadata[i].nb_bits = -1; + st_ivas->ind_list_metadata = NULL; } - /* set pointers to the new buffer of indices in each element */ + /* set pointers to the new buffers of indices in each element */ for ( n = 0; n < st_ivas->nSCE; n++ ) { st_ivas->hSCE[n]->hCoreCoder[0]->hBstr->ind_list = st_ivas->ind_list; -- GitLab From d8e924265ca51765eeb6895b2742dc154cfbe725 Mon Sep 17 00:00:00 2001 From: malenov Date: Thu, 18 May 2023 15:33:18 +0200 Subject: [PATCH 36/43] cleanup: bring back the default macro BITSTREAM_INDICES_MEMORY --- lib_com/options.h | 6 +++++- lib_enc/lib_enc.c | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index fafe4307e6..8b948ff5c6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -133,7 +133,11 @@ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ #define IND_LIST_DYN /* VA: Issue 18: Dynamic allocation of ind_list[] and ind_list_metadata[] based on # of transport channels */ -//#define DEBUG_IND_LIST +/*#define DEBUG_IND_LIST*/ + +#ifndef IND_LIST_DYN +#define BITSTREAM_INDICES_MEMORY /* Don't count memory for bitstream Indice at the encoder - it is a temporary solution for development only */ +#endif #define LSF_RE_USE_SECONDARY_CHANNEL /* TD stereo Secondary channel LSF Q improvement */ #ifdef LSF_RE_USE_SECONDARY_CHANNEL diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 6e4313e5a2..767750389e 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -125,7 +125,13 @@ ivas_error IVAS_ENC_Open( * Allocate and initialize IVAS application encoder handle *-----------------------------------------------------------------*/ +#ifdef BITSTREAM_INDICES_MEMORY +#define WMC_TOOL_SKIP if ( ( *phIvasEnc = (IVAS_ENC_HANDLE) malloc( sizeof( struct IVAS_ENC ) ) ) == NULL ) +#undef WMC_TOOL_SKIP +#else + if ( ( *phIvasEnc = (IVAS_ENC_HANDLE) malloc( sizeof( struct IVAS_ENC ) ) ) == NULL ) +#endif { return IVAS_ERR_FAILED_ALLOC; } @@ -238,7 +244,13 @@ void IVAS_ENC_Close( ( *phIvasEnc )->st_ivas = NULL; +#ifdef BITSTREAM_INDICES_MEMORY +#define WMC_TOOL_SKIP free( *phIvasEnc ); +#undef WMC_TOOL_SKIP +#else + free( *phIvasEnc ); +#endif *phIvasEnc = NULL; phIvasEnc = NULL; -- GitLab From 238a397f0fff44da5cae0006a175469327e920c1 Mon Sep 17 00:00:00 2001 From: malenov Date: Thu, 18 May 2023 15:53:24 +0200 Subject: [PATCH 37/43] avoid reset_indices_enc() in MC_PARAMUPMIX_MODE --- lib_enc/ivas_init_enc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 6ca627e58d..1a53481270 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -686,6 +686,7 @@ ivas_error ivas_init_encoder( return error; } +#ifndef IND_LIST_DYN for ( n = 0; n < CPE_CHANNELS; n++ ) { /* we need the correct bitstream also for the LFE channel since it might become a proper coded channel when @@ -699,6 +700,7 @@ ivas_error ivas_init_encoder( st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA ); } +#endif } if ( ( error = create_mct_enc( st_ivas ) ) != IVAS_ERR_OK ) -- GitLab From cc645b5569589c48023536214077630489f75545 Mon Sep 17 00:00:00 2001 From: malenov Date: Fri, 19 May 2023 10:40:41 +0200 Subject: [PATCH 38/43] set correct pointer in ind_list_realloc() --- lib_com/bitstream.c | 37 +++++++++++++++------------ lib_enc/init_enc.c | 2 +- lib_enc/ivas_corecoder_enc_reconfig.c | 2 +- lib_enc/ivas_cpe_enc.c | 2 +- lib_enc/ivas_sce_enc.c | 2 +- lib_enc/ivas_spar_md_enc.c | 2 +- lib_enc/ivas_stereo_td_enc.c | 2 +- lib_enc/lib_enc.c | 8 +++--- lib_enc/stat_enc.h | 2 +- 9 files changed, 31 insertions(+), 28 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index fc00482955..741095d2a3 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -244,12 +244,12 @@ ivas_error ind_list_realloc( /* move indices from the old list to the new list */ for ( i = 0; i < min( max_num_indices, *( hBstr->ivas_max_num_indices ) ); i++ ) { - if ( hBstr->ivas_ind_list_zero[i].nb_bits > -1 ) + if ( (* hBstr->ivas_ind_list_zero)[i].nb_bits > -1 ) { - new_ind_list[i].id = hBstr->ivas_ind_list_zero[i].id; - new_ind_list[i].value = hBstr->ivas_ind_list_zero[i].value; + new_ind_list[i].id = ( *hBstr->ivas_ind_list_zero )[i].id; + new_ind_list[i].value = ( *hBstr->ivas_ind_list_zero )[i].value; } - new_ind_list[i].nb_bits = hBstr->ivas_ind_list_zero[i].nb_bits; + new_ind_list[i].nb_bits = ( *hBstr->ivas_ind_list_zero )[i].nb_bits; } /* reset nb_bits of all other indices to -1 */ @@ -259,14 +259,14 @@ ivas_error ind_list_realloc( } /* get the current position inside the old list */ - ind_list_pos = (int16_t) ( hBstr->ind_list - hBstr->ivas_ind_list_zero ); + ind_list_pos = ( int16_t )( hBstr->ind_list - ( *hBstr->ivas_ind_list_zero ) ); /* free the old list */ - free( hBstr->ivas_ind_list_zero ); + free( ( *hBstr->ivas_ind_list_zero ) ); /* set pointers in the new list */ hBstr->ind_list = &new_ind_list[ind_list_pos]; - hBstr->ivas_ind_list_zero = new_ind_list; + *( hBstr->ivas_ind_list_zero ) = new_ind_list; /* set the new maximum number of indices */ *( hBstr->ivas_max_num_indices ) = max_num_indices; @@ -730,7 +730,7 @@ int16_t get_ivas_max_num_indices_metadata( /* o { if ( ivas_total_brate <= IVAS_16k4 ) { - return 40; + return 60; } else { @@ -749,7 +749,7 @@ int16_t get_ivas_max_num_indices_metadata( /* o } else { - return 30; + return 80; } } else if ( ivas_format == SBA_FORMAT ) @@ -776,11 +776,11 @@ int16_t get_ivas_max_num_indices_metadata( /* o } else if ( ivas_total_brate <= IVAS_384k ) { - return 1000; + return 1500; } else { - return 1000; + return 2000; } } else if ( ivas_format == MASA_FORMAT ) @@ -819,11 +819,11 @@ int16_t get_ivas_max_num_indices_metadata( /* o } else if ( ivas_total_brate <= IVAS_384k ) { - return 850; + return 1000; } else { - return 900; + return 1500; } } else if ( ivas_format == MC_FORMAT ) @@ -846,7 +846,7 @@ int16_t get_ivas_max_num_indices_metadata( /* o } else { - return 60; + return 300; } } @@ -910,13 +910,15 @@ ivas_error check_ind_list_limits( BSTR_ENC_HANDLE hBstr /* i/o: encoder bitstream handle */ ) { + Indice *ivas_ind_list_zero, *ivas_ind_list_last; ivas_error error; error = IVAS_ERR_OK; + ivas_ind_list_zero = *( hBstr->ivas_ind_list_zero ); /* check, if the maximum number of indices has been reached and re-allocate the buffer */ /* the re-allocation can be avoided by increasing the limits in get_ivas_max_num_indices() or get_ivas_max_num_indices_metadata() */ - if ( ( &hBstr->ind_list[hBstr->nb_ind_tot] - hBstr->ivas_ind_list_zero ) >= *( hBstr->ivas_max_num_indices ) ) + if ( ( &hBstr->ind_list[hBstr->nb_ind_tot] - ivas_ind_list_zero ) >= *( hBstr->ivas_max_num_indices ) ) { #ifdef DEBUGGING fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame ); @@ -935,12 +937,13 @@ ivas_error check_ind_list_limits( fprintf( stderr, "Warning: Trying to overwrite an existing indice ID = %d in frame %d!\n", hBstr->ind_list[hBstr->nb_ind_tot].id, frame ); #endif /* move the pointer to the next available empty slot */ - while ( hBstr->ind_list[0].nb_bits > 0 && hBstr->ind_list < &hBstr->ivas_ind_list_zero[*( hBstr->ivas_max_num_indices )] ) + ivas_ind_list_last = &ivas_ind_list_zero[*( hBstr->ivas_max_num_indices )]; + while ( hBstr->ind_list[0].nb_bits > 0 && hBstr->ind_list < ivas_ind_list_last ) { hBstr->ind_list++; } - if ( hBstr->ind_list >= &hBstr->ivas_ind_list_zero[*( hBstr->ivas_max_num_indices )] ) + if ( hBstr->ind_list >= ivas_ind_list_last ) { #ifdef DEBUGGING fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame ); diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index 5c04e65e7e..42b4e8957d 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -119,7 +119,7 @@ ivas_error init_encoder( #ifdef IND_LIST_DYN /* set pointer to the buffer of indices */ st->hBstr->ind_list = st_ivas->ind_list; - st->hBstr->ivas_ind_list_zero = st_ivas->ind_list; + st->hBstr->ivas_ind_list_zero = &st_ivas->ind_list; st->hBstr->ivas_max_num_indices = &st_ivas->ivas_max_num_indices; st->hBstr->nb_ind_tot = 0; st->hBstr->nb_bits_tot = 0; diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index cb59732244..f838fe36d3 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -552,7 +552,7 @@ ivas_error ivas_corecoder_enc_reconfig( #ifdef IND_LIST_DYN /* set pointer to the buffer of metadata indices */ st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ind_list = st_ivas->ind_list_metadata; - st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ivas_ind_list_zero = st_ivas->ind_list_metadata; + st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ivas_ind_list_zero = &st_ivas->ind_list_metadata; st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ivas_max_num_indices = &st_ivas->ivas_max_num_indices_metadata; st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->nb_ind_tot = 0; st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->nb_bits_tot = 0; diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index af11d07706..85448a6e4f 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -821,7 +821,7 @@ ivas_error create_cpe_enc( #ifdef IND_LIST_DYN /* set pointer to the buffer of metadata indices */ hCPE->hMetaData->ind_list = st_ivas->ind_list_metadata; - hCPE->hMetaData->ivas_ind_list_zero = st_ivas->ind_list_metadata; + hCPE->hMetaData->ivas_ind_list_zero = &st_ivas->ind_list_metadata; hCPE->hMetaData->ivas_max_num_indices = &st_ivas->ivas_max_num_indices_metadata; reset_indices_enc( hCPE->hMetaData, st_ivas->ivas_max_num_indices_metadata ); #endif diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 649d378ce0..1b3eac4f1a 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -316,7 +316,7 @@ ivas_error create_sce_enc( #ifdef IND_LIST_DYN /* set pointer to the buffer of metadata indices */ hSCE->hMetaData->ind_list = st_ivas->ind_list_metadata; - hSCE->hMetaData->ivas_ind_list_zero = st_ivas->ind_list_metadata; + hSCE->hMetaData->ivas_ind_list_zero = &st_ivas->ind_list_metadata; hSCE->hMetaData->ivas_max_num_indices = &st_ivas->ivas_max_num_indices_metadata; reset_indices_enc( hSCE->hMetaData, st_ivas->ivas_max_num_indices_metadata ); #endif diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 6a0573081d..d96526375f 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -651,7 +651,7 @@ ivas_error ivas_spar_md_enc_process( #ifdef IND_LIST_DYN max_num_indices_tmp = MAX_BITS_METADATA; hMetaData_tmp.ivas_max_num_indices = &max_num_indices_tmp; - hMetaData_tmp.ivas_ind_list_zero = ind_list_tmp; + hMetaData_tmp.ivas_ind_list_zero = (Indice **) ( &hMetaData_tmp.ind_list ); #endif /* Save state of metadata bitstream buffer */ diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index 28cb1dfeb1..2357e307c5 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -126,7 +126,7 @@ void stereo_td_init_enc( #ifdef IND_LIST_DYN hStereoTD->tdm_hBstr_tmp.ind_list = hStereoTD->tdm_ind_list_tmp; - hStereoTD->tdm_hBstr_tmp.ivas_ind_list_zero = hStereoTD->tdm_ind_list_tmp; + hStereoTD->tdm_hBstr_tmp.ivas_ind_list_zero = (Indice **) ( &hStereoTD->tdm_hBstr_tmp.ind_list ); hStereoTD->max_ind_tdm_tmp = MAX_IND_TDM_TMP; hStereoTD->tdm_hBstr_tmp.ivas_max_num_indices = &hStereoTD->max_ind_tdm_tmp; reset_indices_enc( &hStereoTD->tdm_hBstr_tmp, MAX_IND_TDM_TMP ); diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index ed985b8360..f39a621ef9 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -1206,12 +1206,12 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( for ( n = 0; n < st_ivas->nSCE; n++ ) { st_ivas->hSCE[n]->hCoreCoder[0]->hBstr->ind_list = st_ivas->ind_list; - st_ivas->hSCE[n]->hCoreCoder[0]->hBstr->ivas_ind_list_zero = st_ivas->ind_list; + st_ivas->hSCE[n]->hCoreCoder[0]->hBstr->ivas_ind_list_zero = &st_ivas->ind_list; if ( st_ivas->hSCE[n]->hMetaData != NULL ) { st_ivas->hSCE[n]->hMetaData->ind_list = st_ivas->ind_list_metadata; - st_ivas->hSCE[n]->hMetaData->ivas_ind_list_zero = st_ivas->ind_list_metadata; + st_ivas->hSCE[n]->hMetaData->ivas_ind_list_zero = &st_ivas->ind_list_metadata; } } @@ -1220,13 +1220,13 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { st_ivas->hCPE[n]->hCoreCoder[ch]->hBstr->ind_list = st_ivas->ind_list; - st_ivas->hCPE[n]->hCoreCoder[ch]->hBstr->ivas_ind_list_zero = st_ivas->ind_list; + st_ivas->hCPE[n]->hCoreCoder[ch]->hBstr->ivas_ind_list_zero = &st_ivas->ind_list; } if ( st_ivas->hCPE[n]->hMetaData != NULL ) { st_ivas->hCPE[n]->hMetaData->ind_list = st_ivas->ind_list_metadata; - st_ivas->hCPE[n]->hMetaData->ivas_ind_list_zero = st_ivas->ind_list_metadata; + st_ivas->hCPE[n]->hMetaData->ivas_ind_list_zero = &st_ivas->ind_list_metadata; } } } diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index fe4b00d849..60d14dce0b 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -83,7 +83,7 @@ typedef struct bitstream_enc_data_structure #endif #ifdef IND_LIST_DYN int16_t *ivas_max_num_indices; /* maximum total number of indices in the list */ - Indice *ivas_ind_list_zero; /* beginning of the buffer of indices */ + Indice **ivas_ind_list_zero; /* beginning of the buffer of indices */ #endif } BSTR_ENC_DATA, *BSTR_ENC_HANDLE; -- GitLab From 550696b2fd6ac42c9b81f2c49f09abeed5d728ce Mon Sep 17 00:00:00 2001 From: malenov Date: Fri, 19 May 2023 10:55:25 +0200 Subject: [PATCH 39/43] clang format + removal of debugging code --- apps/encoder.c | 2 -- lib_com/bitstream.c | 4 ++-- lib_com/options.h | 1 - lib_enc/evs_enc.c | 16 ++-------------- lib_enc/ivas_core_enc.c | 26 -------------------------- lib_enc/ivas_cpe_enc.c | 6 +++--- lib_enc/ivas_ism_enc.c | 2 +- lib_enc/ivas_mdct_core_enc.c | 2 +- lib_enc/lib_enc.c | 25 ------------------------- lib_enc/stat_enc.h | 2 +- 10 files changed, 10 insertions(+), 76 deletions(-) diff --git a/apps/encoder.c b/apps/encoder.c index 57ce805850..a23970a270 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -757,12 +757,10 @@ int main( } frame++; -#ifndef DEBUG_IND_LIST if ( !arg.quietModeEnabled ) { fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame ); } -#endif #ifdef WMOPS update_mem(); diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 741095d2a3..38c5baf953 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -244,7 +244,7 @@ ivas_error ind_list_realloc( /* move indices from the old list to the new list */ for ( i = 0; i < min( max_num_indices, *( hBstr->ivas_max_num_indices ) ); i++ ) { - if ( (* hBstr->ivas_ind_list_zero)[i].nb_bits > -1 ) + if ( ( *hBstr->ivas_ind_list_zero )[i].nb_bits > -1 ) { new_ind_list[i].id = ( *hBstr->ivas_ind_list_zero )[i].id; new_ind_list[i].value = ( *hBstr->ivas_ind_list_zero )[i].value; @@ -259,7 +259,7 @@ ivas_error ind_list_realloc( } /* get the current position inside the old list */ - ind_list_pos = ( int16_t )( hBstr->ind_list - ( *hBstr->ivas_ind_list_zero ) ); + ind_list_pos = (int16_t) ( hBstr->ind_list - ( *hBstr->ivas_ind_list_zero ) ); /* free the old list */ free( ( *hBstr->ivas_ind_list_zero ) ); diff --git a/lib_com/options.h b/lib_com/options.h index 5fbdacacdb..c9216048ab 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -135,7 +135,6 @@ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ #define IND_LIST_DYN /* VA: Issue 18: Dynamic allocation of ind_list[] and ind_list_metadata[] based on # of transport channels */ -/*#define DEBUG_IND_LIST*/ #ifndef IND_LIST_DYN #define BITSTREAM_INDICES_MEMORY /* Don't count memory for bitstream Indice at the encoder - it is a temporary solution for development only */ diff --git a/lib_enc/evs_enc.c b/lib_enc/evs_enc.c index e5457f1d0e..c45bb444f3 100644 --- a/lib_enc/evs_enc.c +++ b/lib_enc/evs_enc.c @@ -99,12 +99,11 @@ ivas_error evs_enc( int16_t pitch_orig[3]; /* original open-loop pitch values that might be altered in core_acelp_tcx20_switching() within MODE2 */ #endif ivas_error error; -#ifdef DEBUG_IND_LIST - int16_t old_nb_ind; -#endif + error = IVAS_ERR_OK; push_wmops( "evs_enc" ); + /*------------------------------------------------------------------* * Initialization *-----------------------------------------------------------------*/ @@ -383,10 +382,6 @@ ivas_error evs_enc( *---------------------------------------------------------------------*/ push_wmops( "BWE_encoding" ); -#ifdef DEBUG_IND_LIST - old_nb_ind = st->hBstr->nb_ind_tot; -#endif - if ( st->input_Fs >= 16000 && st->bwidth < SWB ) { /* Common pre-processing for WB TBE and WB BWE */ @@ -508,13 +503,6 @@ ivas_error evs_enc( st->codec_mode = MODE2; } -#ifdef DEBUG_IND_LIST - if ( st->hBstr->nb_ind_tot - old_nb_ind > 0 ) - { - fprintf( stdout, "Total number of allocated indices (BWE): %d, bitrate: %d, #indices: %d\n", st->extl, st->extl_brate, st->hBstr->nb_ind_tot - old_nb_ind ); - } -#endif - #ifdef DEBUG_MODE_INFO dbgwrite( &st->codec_mode, sizeof( int16_t ), 1, input_frame, "res/codec" ); dbgwrite( &st->core, sizeof( int16_t ), 1, input_frame, "res/core" ); diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index f99b27cb29..639722b41e 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -105,9 +105,6 @@ ivas_error ivas_core_enc( ivas_error error; #ifdef IND_LIST_DYN int16_t max_num_indices_BWE; -#ifdef DEBUG_IND_LIST - int16_t old_nb_ind; -#endif #endif push_wmops( "ivas_core_enc" ); @@ -322,10 +319,6 @@ ivas_error ivas_core_enc( { st = sts[n]; -#ifdef DEBUG_IND_LIST - old_nb_ind = st->hBstr->nb_ind_tot; -#endif - /*---------------------------------------------------------------------* * Postprocessing for ACELP/HQ core switching *---------------------------------------------------------------------*/ @@ -432,26 +425,7 @@ ivas_error ivas_core_enc( updt_enc_common( st ); } -#ifdef DEBUG_IND_LIST - if ( sts[n]->hBstr->nb_ind_tot - old_nb_ind > 0 ) - { - fprintf( stdout, "Total number of allocated indices (BWE): %d, bitrate: %d, #indices: %d\n", sts[n]->extl, sts[n]->extl_brate, sts[n]->hBstr->nb_ind_tot - old_nb_ind ); - } -#endif - } - -#ifdef IND_LIST_DYN -#ifdef DEBUG_IND_LIST - for ( n = 0; n < n_CoreChannels; n++ ) - { - if ( sts[n]->hBstr->nb_ind_tot > 0 ) - { - fprintf( stdout, "Total number of allocated indices (core): %d, bitrate: %d, #indices: %d\n", sts[n]->core, sts[n]->total_brate, sts[n]->hBstr->nb_ind_tot ); - } } -#endif -#endif - #ifdef DEBUG_MODE_INFO for ( n = 0; n < n_CoreChannels; n++ ) diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 85448a6e4f..ab4a36cb5f 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -843,9 +843,9 @@ ivas_error create_cpe_enc( st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; if ( ( error = init_encoder( st, #ifdef IND_LIST_DYN - st_ivas, -#endif - n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) + st_ivas, +#endif + n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index ffceb71607..bfa1342bb5 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -88,7 +88,7 @@ ivas_error ivas_ism_enc( int16_t nchan_ism, dtx_flag, sid_flag, flag_noisy_speech; int16_t md_diff_flag[MAX_NUM_OBJECTS]; #ifdef IND_LIST_DYN - Encoder_State* prev_st = NULL; + Encoder_State *prev_st = NULL; #endif ivas_error error; diff --git a/lib_enc/ivas_mdct_core_enc.c b/lib_enc/ivas_mdct_core_enc.c index 0f13402ca1..b3f76cc4ab 100644 --- a/lib_enc/ivas_mdct_core_enc.c +++ b/lib_enc/ivas_mdct_core_enc.c @@ -1424,7 +1424,7 @@ void ivas_mdct_quant_coder( #ifdef IND_LIST_DYN /* update the pointer to the buffer of indices of the second channel */ - if (ch > 0) + if ( ch > 0 ) { st->hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot; } diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index f39a621ef9..3da409f6ae 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -1272,31 +1272,6 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( } } - -#ifdef DEBUG_IND_LIST - int16_t total_nb_ind = 0; - for ( i = 0; i < st_ivas->ivas_max_num_indices; i++ ) - { - if ( st_ivas->ind_list[i].nb_bits > -1 ) - { - total_nb_ind++; - } - } - - fprintf( stdout, "Total number of allocated indices (codec): IVAS format: %d, bitrate: %d, #indices: %d\n", hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate, total_nb_ind ); - - total_nb_ind = 0; - for ( i = 0; i < st_ivas->ivas_max_num_indices_metadata; i++ ) - { - if ( st_ivas->ind_list_metadata[i].nb_bits > -1 ) - { - total_nb_ind++; - } - } - - fprintf( stdout, "Total number of allocated indices (metadata): IVAS format: %d, bitrate: %d, #indices: %d\n", hEncoderConfig->ivas_format, hEncoderConfig->ivas_total_brate, total_nb_ind ); -#endif - /* write indices into bitstream buffer */ write_indices_ivas( st_ivas, outputBitStream, numOutBits ); diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index 60d14dce0b..77c0ea3d34 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -83,7 +83,7 @@ typedef struct bitstream_enc_data_structure #endif #ifdef IND_LIST_DYN int16_t *ivas_max_num_indices; /* maximum total number of indices in the list */ - Indice **ivas_ind_list_zero; /* beginning of the buffer of indices */ + Indice **ivas_ind_list_zero; /* beginning of the buffer of indices */ #endif } BSTR_ENC_DATA, *BSTR_ENC_HANDLE; -- GitLab From baff7159ba767ebed9d01ce8f0697be38c415776 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Fri, 19 May 2023 11:06:05 +0200 Subject: [PATCH 40/43] more clang foratting --- lib_enc/ivas_core_enc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 639722b41e..6536ee333e 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -424,7 +424,6 @@ ivas_error ivas_core_enc( { updt_enc_common( st ); } - } #ifdef DEBUG_MODE_INFO -- GitLab From f73c8d9fe32ad799f3a5bb97cb1ef0dee0083468 Mon Sep 17 00:00:00 2001 From: malenov Date: Fri, 19 May 2023 11:30:26 +0200 Subject: [PATCH 41/43] reintroduce DEBUG_IND_LIST - just to see if CI job passes without error message --- lib_com/bitstream.c | 8 ++++++++ lib_com/options.h | 1 + 2 files changed, 9 insertions(+) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 38c5baf953..d62248e818 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -922,6 +922,10 @@ ivas_error check_ind_list_limits( { #ifdef DEBUGGING fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame ); + +#ifdef DEBUG_IND_LIST + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Max number of indices exceeded!" ); +#endif #endif /* reallocate the buffer of indices with increased limit */ @@ -947,6 +951,10 @@ ivas_error check_ind_list_limits( { #ifdef DEBUGGING fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame ); + +#ifdef DEBUG_IND_LIST + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Max number of indices exceeded!" ); +#endif #endif /* no available empty slot -> need to re-allocate the buffer */ diff --git a/lib_com/options.h b/lib_com/options.h index c9216048ab..e265384a4f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -135,6 +135,7 @@ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ #define IND_LIST_DYN /* VA: Issue 18: Dynamic allocation of ind_list[] and ind_list_metadata[] based on # of transport channels */ +#define DEBUG_IND_LIST #ifndef IND_LIST_DYN #define BITSTREAM_INDICES_MEMORY /* Don't count memory for bitstream Indice at the encoder - it is a temporary solution for development only */ -- GitLab From 3bd6cbc4f7561b66d559a46f6e9c9ddf0db36812 Mon Sep 17 00:00:00 2001 From: malenov Date: Fri, 19 May 2023 11:48:19 +0200 Subject: [PATCH 42/43] everything OK -> clear DEBUG_IND_LIST --- lib_com/bitstream.c | 8 -------- lib_com/options.h | 1 - 2 files changed, 9 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index d62248e818..38c5baf953 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -922,10 +922,6 @@ ivas_error check_ind_list_limits( { #ifdef DEBUGGING fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame ); - -#ifdef DEBUG_IND_LIST - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Max number of indices exceeded!" ); -#endif #endif /* reallocate the buffer of indices with increased limit */ @@ -951,10 +947,6 @@ ivas_error check_ind_list_limits( { #ifdef DEBUGGING fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame ); - -#ifdef DEBUG_IND_LIST - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Max number of indices exceeded!" ); -#endif #endif /* no available empty slot -> need to re-allocate the buffer */ diff --git a/lib_com/options.h b/lib_com/options.h index e265384a4f..c9216048ab 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -135,7 +135,6 @@ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ #define IND_LIST_DYN /* VA: Issue 18: Dynamic allocation of ind_list[] and ind_list_metadata[] based on # of transport channels */ -#define DEBUG_IND_LIST #ifndef IND_LIST_DYN #define BITSTREAM_INDICES_MEMORY /* Don't count memory for bitstream Indice at the encoder - it is a temporary solution for development only */ -- GitLab From ecbf511c1ac846d02144f0f1ef7a592c71f9e3d3 Mon Sep 17 00:00:00 2001 From: malenov Date: Fri, 19 May 2023 14:07:50 +0200 Subject: [PATCH 43/43] insert assert() message to catch siatuations when ind_list[] runs out of memory -> must be replaced with a warning message before the finalization of the IVAS codec --- lib_com/bitstream.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 38c5baf953..86e1615d5a 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -921,7 +921,9 @@ ivas_error check_ind_list_limits( if ( ( &hBstr->ind_list[hBstr->nb_ind_tot] - ivas_ind_list_zero ) >= *( hBstr->ivas_max_num_indices ) ) { #ifdef DEBUGGING - fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame ); + /* TODO: replace with the warning message below before the finalization of the IVAS codec */ + /* fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame ); */ + assert( 0 && "The maximum number of indices has been exceeded! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata()." ); #endif /* reallocate the buffer of indices with increased limit */ @@ -946,7 +948,9 @@ ivas_error check_ind_list_limits( if ( hBstr->ind_list >= ivas_ind_list_last ) { #ifdef DEBUGGING - fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame ); + /* TODO: replace with the warning message below before the finalization of the IVAS codec */ + /* fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame ); */ + assert( 0 && "The maximum number of indices has been exceeded! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata()." ); #endif /* no available empty slot -> need to re-allocate the buffer */ -- GitLab